head_64.S 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * linux/boot/head.S
  4. *
  5. * Copyright (C) 1991, 1992, 1993 Linus Torvalds
  6. */
  7. /*
  8. * head.S contains the 32-bit startup code.
  9. *
  10. * NOTE!!! Startup happens at absolute address 0x00001000, which is also where
  11. * the page directory will exist. The startup code will be overwritten by
  12. * the page directory. [According to comments etc elsewhere on a compressed
  13. * kernel it will end up at 0x1000 + 1Mb I hope so as I assume this. - AC]
  14. *
  15. * Page 0 is deliberately kept safe, since System Management Mode code in
  16. * laptops may need to access the BIOS data stored there. This is also
  17. * useful for future device drivers that either access the BIOS via VM86
  18. * mode.
  19. */
  20. /*
  21. * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
  22. */
  23. .code32
  24. .text
  25. #include <linux/init.h>
  26. #include <linux/linkage.h>
  27. #include <asm/segment.h>
  28. #include <asm/boot.h>
  29. #include <asm/msr.h>
  30. #include <asm/processor-flags.h>
  31. #include <asm/asm-offsets.h>
  32. #include <asm/bootparam.h>
  33. #include "pgtable.h"
  34. /*
  35. * Locally defined symbols should be marked hidden:
  36. */
  37. .hidden _bss
  38. .hidden _ebss
  39. .hidden _got
  40. .hidden _egot
  41. __HEAD
  42. .code32
  43. ENTRY(startup_32)
  44. /*
  45. * 32bit entry is 0 and it is ABI so immutable!
  46. * If we come here directly from a bootloader,
  47. * kernel(text+data+bss+brk) ramdisk, zero_page, command line
  48. * all need to be under the 4G limit.
  49. */
  50. cld
  51. /*
  52. * Test KEEP_SEGMENTS flag to see if the bootloader is asking
  53. * us to not reload segments
  54. */
  55. testb $KEEP_SEGMENTS, BP_loadflags(%esi)
  56. jnz 1f
  57. cli
  58. movl $(__BOOT_DS), %eax
  59. movl %eax, %ds
  60. movl %eax, %es
  61. movl %eax, %ss
  62. 1:
  63. /*
  64. * Calculate the delta between where we were compiled to run
  65. * at and where we were actually loaded at. This can only be done
  66. * with a short local call on x86. Nothing else will tell us what
  67. * address we are running at. The reserved chunk of the real-mode
  68. * data at 0x1e4 (defined as a scratch field) are used as the stack
  69. * for this calculation. Only 4 bytes are needed.
  70. */
  71. leal (BP_scratch+4)(%esi), %esp
  72. call 1f
  73. 1: popl %ebp
  74. subl $1b, %ebp
  75. /* setup a stack and make sure cpu supports long mode. */
  76. movl $boot_stack_end, %eax
  77. addl %ebp, %eax
  78. movl %eax, %esp
  79. call verify_cpu
  80. testl %eax, %eax
  81. jnz no_longmode
  82. /*
  83. * Compute the delta between where we were compiled to run at
  84. * and where the code will actually run at.
  85. *
  86. * %ebp contains the address we are loaded at by the boot loader and %ebx
  87. * contains the address where we should move the kernel image temporarily
  88. * for safe in-place decompression.
  89. */
  90. #ifdef CONFIG_RELOCATABLE
  91. movl %ebp, %ebx
  92. movl BP_kernel_alignment(%esi), %eax
  93. decl %eax
  94. addl %eax, %ebx
  95. notl %eax
  96. andl %eax, %ebx
  97. cmpl $LOAD_PHYSICAL_ADDR, %ebx
  98. jge 1f
  99. #endif
  100. movl $LOAD_PHYSICAL_ADDR, %ebx
  101. 1:
  102. /* Target address to relocate to for decompression */
  103. movl BP_init_size(%esi), %eax
  104. subl $_end, %eax
  105. addl %eax, %ebx
  106. /*
  107. * Prepare for entering 64 bit mode
  108. */
  109. /* Load new GDT with the 64bit segments using 32bit descriptor */
  110. addl %ebp, gdt+2(%ebp)
  111. lgdt gdt(%ebp)
  112. /* Enable PAE mode */
  113. movl %cr4, %eax
  114. orl $X86_CR4_PAE, %eax
  115. movl %eax, %cr4
  116. /*
  117. * Build early 4G boot pagetable
  118. */
  119. /*
  120. * If SEV is active then set the encryption mask in the page tables.
  121. * This will insure that when the kernel is copied and decompressed
  122. * it will be done so encrypted.
  123. */
  124. call get_sev_encryption_bit
  125. xorl %edx, %edx
  126. testl %eax, %eax
  127. jz 1f
  128. subl $32, %eax /* Encryption bit is always above bit 31 */
  129. bts %eax, %edx /* Set encryption mask for page tables */
  130. 1:
  131. /* Initialize Page tables to 0 */
  132. leal pgtable(%ebx), %edi
  133. xorl %eax, %eax
  134. movl $(BOOT_INIT_PGT_SIZE/4), %ecx
  135. rep stosl
  136. /* Build Level 4 */
  137. leal pgtable + 0(%ebx), %edi
  138. leal 0x1007 (%edi), %eax
  139. movl %eax, 0(%edi)
  140. addl %edx, 4(%edi)
  141. /* Build Level 3 */
  142. leal pgtable + 0x1000(%ebx), %edi
  143. leal 0x1007(%edi), %eax
  144. movl $4, %ecx
  145. 1: movl %eax, 0x00(%edi)
  146. addl %edx, 0x04(%edi)
  147. addl $0x00001000, %eax
  148. addl $8, %edi
  149. decl %ecx
  150. jnz 1b
  151. /* Build Level 2 */
  152. leal pgtable + 0x2000(%ebx), %edi
  153. movl $0x00000183, %eax
  154. movl $2048, %ecx
  155. 1: movl %eax, 0(%edi)
  156. addl %edx, 4(%edi)
  157. addl $0x00200000, %eax
  158. addl $8, %edi
  159. decl %ecx
  160. jnz 1b
  161. /* Enable the boot page tables */
  162. leal pgtable(%ebx), %eax
  163. movl %eax, %cr3
  164. /* Enable Long mode in EFER (Extended Feature Enable Register) */
  165. movl $MSR_EFER, %ecx
  166. rdmsr
  167. btsl $_EFER_LME, %eax
  168. wrmsr
  169. /* After gdt is loaded */
  170. xorl %eax, %eax
  171. lldt %ax
  172. movl $__BOOT_TSS, %eax
  173. ltr %ax
  174. /*
  175. * Setup for the jump to 64bit mode
  176. *
  177. * When the jump is performend we will be in long mode but
  178. * in 32bit compatibility mode with EFER.LME = 1, CS.L = 0, CS.D = 1
  179. * (and in turn EFER.LMA = 1). To jump into 64bit mode we use
  180. * the new gdt/idt that has __KERNEL_CS with CS.L = 1.
  181. * We place all of the values on our mini stack so lret can
  182. * used to perform that far jump.
  183. */
  184. pushl $__KERNEL_CS
  185. leal startup_64(%ebp), %eax
  186. #ifdef CONFIG_EFI_MIXED
  187. movl efi32_config(%ebp), %ebx
  188. cmp $0, %ebx
  189. jz 1f
  190. leal handover_entry(%ebp), %eax
  191. 1:
  192. #endif
  193. pushl %eax
  194. /* Enter paged protected Mode, activating Long Mode */
  195. movl $(X86_CR0_PG | X86_CR0_PE), %eax /* Enable Paging and Protected mode */
  196. movl %eax, %cr0
  197. /* Jump from 32bit compatibility mode into 64bit mode. */
  198. lret
  199. ENDPROC(startup_32)
  200. #ifdef CONFIG_EFI_MIXED
  201. .org 0x190
  202. ENTRY(efi32_stub_entry)
  203. add $0x4, %esp /* Discard return address */
  204. popl %ecx
  205. popl %edx
  206. popl %esi
  207. leal (BP_scratch+4)(%esi), %esp
  208. call 1f
  209. 1: pop %ebp
  210. subl $1b, %ebp
  211. movl %ecx, efi32_config(%ebp)
  212. movl %edx, efi32_config+8(%ebp)
  213. sgdtl efi32_boot_gdt(%ebp)
  214. leal efi32_config(%ebp), %eax
  215. movl %eax, efi_config(%ebp)
  216. jmp startup_32
  217. ENDPROC(efi32_stub_entry)
  218. #endif
  219. .code64
  220. .org 0x200
  221. ENTRY(startup_64)
  222. /*
  223. * 64bit entry is 0x200 and it is ABI so immutable!
  224. * We come here either from startup_32 or directly from a
  225. * 64bit bootloader.
  226. * If we come here from a bootloader, kernel(text+data+bss+brk),
  227. * ramdisk, zero_page, command line could be above 4G.
  228. * We depend on an identity mapped page table being provided
  229. * that maps our entire kernel(text+data+bss+brk), zero page
  230. * and command line.
  231. */
  232. /* Setup data segments. */
  233. xorl %eax, %eax
  234. movl %eax, %ds
  235. movl %eax, %es
  236. movl %eax, %ss
  237. movl %eax, %fs
  238. movl %eax, %gs
  239. /*
  240. * Compute the decompressed kernel start address. It is where
  241. * we were loaded at aligned to a 2M boundary. %rbp contains the
  242. * decompressed kernel start address.
  243. *
  244. * If it is a relocatable kernel then decompress and run the kernel
  245. * from load address aligned to 2MB addr, otherwise decompress and
  246. * run the kernel from LOAD_PHYSICAL_ADDR
  247. *
  248. * We cannot rely on the calculation done in 32-bit mode, since we
  249. * may have been invoked via the 64-bit entry point.
  250. */
  251. /* Start with the delta to where the kernel will run at. */
  252. #ifdef CONFIG_RELOCATABLE
  253. leaq startup_32(%rip) /* - $startup_32 */, %rbp
  254. movl BP_kernel_alignment(%rsi), %eax
  255. decl %eax
  256. addq %rax, %rbp
  257. notq %rax
  258. andq %rax, %rbp
  259. cmpq $LOAD_PHYSICAL_ADDR, %rbp
  260. jge 1f
  261. #endif
  262. movq $LOAD_PHYSICAL_ADDR, %rbp
  263. 1:
  264. /* Target address to relocate to for decompression */
  265. movl BP_init_size(%rsi), %ebx
  266. subl $_end, %ebx
  267. addq %rbp, %rbx
  268. /* Set up the stack */
  269. leaq boot_stack_end(%rbx), %rsp
  270. /*
  271. * paging_prepare() and cleanup_trampoline() below can have GOT
  272. * references. Adjust the table with address we are running at.
  273. *
  274. * Zero RAX for adjust_got: the GOT was not adjusted before;
  275. * there's no adjustment to undo.
  276. */
  277. xorq %rax, %rax
  278. /*
  279. * Calculate the address the binary is loaded at and use it as
  280. * a GOT adjustment.
  281. */
  282. call 1f
  283. 1: popq %rdi
  284. subq $1b, %rdi
  285. call adjust_got
  286. /*
  287. * At this point we are in long mode with 4-level paging enabled,
  288. * but we might want to enable 5-level paging or vice versa.
  289. *
  290. * The problem is that we cannot do it directly. Setting or clearing
  291. * CR4.LA57 in long mode would trigger #GP. So we need to switch off
  292. * long mode and paging first.
  293. *
  294. * We also need a trampoline in lower memory to switch over from
  295. * 4- to 5-level paging for cases when the bootloader puts the kernel
  296. * above 4G, but didn't enable 5-level paging for us.
  297. *
  298. * The same trampoline can be used to switch from 5- to 4-level paging
  299. * mode, like when starting 4-level paging kernel via kexec() when
  300. * original kernel worked in 5-level paging mode.
  301. *
  302. * For the trampoline, we need the top page table to reside in lower
  303. * memory as we don't have a way to load 64-bit values into CR3 in
  304. * 32-bit mode.
  305. *
  306. * We go though the trampoline even if we don't have to: if we're
  307. * already in a desired paging mode. This way the trampoline code gets
  308. * tested on every boot.
  309. */
  310. /* Make sure we have GDT with 32-bit code segment */
  311. leaq gdt(%rip), %rax
  312. movq %rax, gdt64+2(%rip)
  313. lgdt gdt64(%rip)
  314. /*
  315. * paging_prepare() sets up the trampoline and checks if we need to
  316. * enable 5-level paging.
  317. *
  318. * Address of the trampoline is returned in RAX.
  319. * Non zero RDX on return means we need to enable 5-level paging.
  320. *
  321. * RSI holds real mode data and needs to be preserved across
  322. * this function call.
  323. */
  324. pushq %rsi
  325. movq %rsi, %rdi /* real mode address */
  326. call paging_prepare
  327. popq %rsi
  328. /* Save the trampoline address in RCX */
  329. movq %rax, %rcx
  330. /*
  331. * Load the address of trampoline_return() into RDI.
  332. * It will be used by the trampoline to return to the main code.
  333. */
  334. leaq trampoline_return(%rip), %rdi
  335. /* Switch to compatibility mode (CS.L = 0 CS.D = 1) via far return */
  336. pushq $__KERNEL32_CS
  337. leaq TRAMPOLINE_32BIT_CODE_OFFSET(%rax), %rax
  338. pushq %rax
  339. lretq
  340. trampoline_return:
  341. /* Restore the stack, the 32-bit trampoline uses its own stack */
  342. leaq boot_stack_end(%rbx), %rsp
  343. /*
  344. * cleanup_trampoline() would restore trampoline memory.
  345. *
  346. * RDI is address of the page table to use instead of page table
  347. * in trampoline memory (if required).
  348. *
  349. * RSI holds real mode data and needs to be preserved across
  350. * this function call.
  351. */
  352. pushq %rsi
  353. leaq top_pgtable(%rbx), %rdi
  354. call cleanup_trampoline
  355. popq %rsi
  356. /* Zero EFLAGS */
  357. pushq $0
  358. popfq
  359. /*
  360. * Previously we've adjusted the GOT with address the binary was
  361. * loaded at. Now we need to re-adjust for relocation address.
  362. *
  363. * Calculate the address the binary is loaded at, so that we can
  364. * undo the previous GOT adjustment.
  365. */
  366. call 1f
  367. 1: popq %rax
  368. subq $1b, %rax
  369. /* The new adjustment is the relocation address */
  370. movq %rbx, %rdi
  371. call adjust_got
  372. /*
  373. * Copy the compressed kernel to the end of our buffer
  374. * where decompression in place becomes safe.
  375. */
  376. pushq %rsi
  377. leaq (_bss-8)(%rip), %rsi
  378. leaq (_bss-8)(%rbx), %rdi
  379. movq $_bss /* - $startup_32 */, %rcx
  380. shrq $3, %rcx
  381. std
  382. rep movsq
  383. cld
  384. popq %rsi
  385. /*
  386. * Jump to the relocated address.
  387. */
  388. leaq relocated(%rbx), %rax
  389. jmp *%rax
  390. #ifdef CONFIG_EFI_STUB
  391. /* The entry point for the PE/COFF executable is efi_pe_entry. */
  392. ENTRY(efi_pe_entry)
  393. movq %rcx, efi64_config(%rip) /* Handle */
  394. movq %rdx, efi64_config+8(%rip) /* EFI System table pointer */
  395. leaq efi64_config(%rip), %rax
  396. movq %rax, efi_config(%rip)
  397. call 1f
  398. 1: popq %rbp
  399. subq $1b, %rbp
  400. /*
  401. * Relocate efi_config->call().
  402. */
  403. addq %rbp, efi64_config+40(%rip)
  404. movq %rax, %rdi
  405. call make_boot_params
  406. cmpq $0,%rax
  407. je fail
  408. mov %rax, %rsi
  409. leaq startup_32(%rip), %rax
  410. movl %eax, BP_code32_start(%rsi)
  411. jmp 2f /* Skip the relocation */
  412. handover_entry:
  413. call 1f
  414. 1: popq %rbp
  415. subq $1b, %rbp
  416. /*
  417. * Relocate efi_config->call().
  418. */
  419. movq efi_config(%rip), %rax
  420. addq %rbp, 40(%rax)
  421. 2:
  422. movq efi_config(%rip), %rdi
  423. call efi_main
  424. movq %rax,%rsi
  425. cmpq $0,%rax
  426. jne 2f
  427. fail:
  428. /* EFI init failed, so hang. */
  429. hlt
  430. jmp fail
  431. 2:
  432. movl BP_code32_start(%esi), %eax
  433. leaq startup_64(%rax), %rax
  434. jmp *%rax
  435. ENDPROC(efi_pe_entry)
  436. .org 0x390
  437. ENTRY(efi64_stub_entry)
  438. movq %rdi, efi64_config(%rip) /* Handle */
  439. movq %rsi, efi64_config+8(%rip) /* EFI System table pointer */
  440. leaq efi64_config(%rip), %rax
  441. movq %rax, efi_config(%rip)
  442. movq %rdx, %rsi
  443. jmp handover_entry
  444. ENDPROC(efi64_stub_entry)
  445. #endif
  446. .text
  447. relocated:
  448. /*
  449. * Clear BSS (stack is currently empty)
  450. */
  451. xorl %eax, %eax
  452. leaq _bss(%rip), %rdi
  453. leaq _ebss(%rip), %rcx
  454. subq %rdi, %rcx
  455. shrq $3, %rcx
  456. rep stosq
  457. /*
  458. * Do the extraction, and jump to the new kernel..
  459. */
  460. pushq %rsi /* Save the real mode argument */
  461. movq %rsi, %rdi /* real mode address */
  462. leaq boot_heap(%rip), %rsi /* malloc area for uncompression */
  463. leaq input_data(%rip), %rdx /* input_data */
  464. movl $z_input_len, %ecx /* input_len */
  465. movq %rbp, %r8 /* output target address */
  466. movq $z_output_len, %r9 /* decompressed length, end of relocs */
  467. call extract_kernel /* returns kernel location in %rax */
  468. popq %rsi
  469. /*
  470. * Jump to the decompressed kernel.
  471. */
  472. jmp *%rax
  473. /*
  474. * Adjust the global offset table
  475. *
  476. * RAX is the previous adjustment of the table to undo (use 0 if it's the
  477. * first time we touch GOT).
  478. * RDI is the new adjustment to apply.
  479. */
  480. adjust_got:
  481. /* Walk through the GOT adding the address to the entries */
  482. leaq _got(%rip), %rdx
  483. leaq _egot(%rip), %rcx
  484. 1:
  485. cmpq %rcx, %rdx
  486. jae 2f
  487. subq %rax, (%rdx) /* Undo previous adjustment */
  488. addq %rdi, (%rdx) /* Apply the new adjustment */
  489. addq $8, %rdx
  490. jmp 1b
  491. 2:
  492. ret
  493. .code32
  494. /*
  495. * This is the 32-bit trampoline that will be copied over to low memory.
  496. *
  497. * RDI contains the return address (might be above 4G).
  498. * ECX contains the base address of the trampoline memory.
  499. * Non zero RDX on return means we need to enable 5-level paging.
  500. */
  501. ENTRY(trampoline_32bit_src)
  502. /* Set up data and stack segments */
  503. movl $__KERNEL_DS, %eax
  504. movl %eax, %ds
  505. movl %eax, %ss
  506. /* Set up new stack */
  507. leal TRAMPOLINE_32BIT_STACK_END(%ecx), %esp
  508. /* Disable paging */
  509. movl %cr0, %eax
  510. btrl $X86_CR0_PG_BIT, %eax
  511. movl %eax, %cr0
  512. /* Check what paging mode we want to be in after the trampoline */
  513. cmpl $0, %edx
  514. jz 1f
  515. /* We want 5-level paging: don't touch CR3 if it already points to 5-level page tables */
  516. movl %cr4, %eax
  517. testl $X86_CR4_LA57, %eax
  518. jnz 3f
  519. jmp 2f
  520. 1:
  521. /* We want 4-level paging: don't touch CR3 if it already points to 4-level page tables */
  522. movl %cr4, %eax
  523. testl $X86_CR4_LA57, %eax
  524. jz 3f
  525. 2:
  526. /* Point CR3 to the trampoline's new top level page table */
  527. leal TRAMPOLINE_32BIT_PGTABLE_OFFSET(%ecx), %eax
  528. movl %eax, %cr3
  529. 3:
  530. /* Enable PAE and LA57 (if required) paging modes */
  531. movl $X86_CR4_PAE, %eax
  532. cmpl $0, %edx
  533. jz 1f
  534. orl $X86_CR4_LA57, %eax
  535. 1:
  536. movl %eax, %cr4
  537. /* Calculate address of paging_enabled() once we are executing in the trampoline */
  538. leal paging_enabled - trampoline_32bit_src + TRAMPOLINE_32BIT_CODE_OFFSET(%ecx), %eax
  539. /* Prepare the stack for far return to Long Mode */
  540. pushl $__KERNEL_CS
  541. pushl %eax
  542. /* Enable paging again */
  543. movl $(X86_CR0_PG | X86_CR0_PE), %eax
  544. movl %eax, %cr0
  545. lret
  546. .code64
  547. paging_enabled:
  548. /* Return from the trampoline */
  549. jmp *%rdi
  550. /*
  551. * The trampoline code has a size limit.
  552. * Make sure we fail to compile if the trampoline code grows
  553. * beyond TRAMPOLINE_32BIT_CODE_SIZE bytes.
  554. */
  555. .org trampoline_32bit_src + TRAMPOLINE_32BIT_CODE_SIZE
  556. .code32
  557. no_longmode:
  558. /* This isn't an x86-64 CPU, so hang intentionally, we cannot continue */
  559. 1:
  560. hlt
  561. jmp 1b
  562. #include "../../kernel/verify_cpu.S"
  563. .data
  564. gdt64:
  565. .word gdt_end - gdt
  566. .long 0
  567. .word 0
  568. .quad 0
  569. gdt:
  570. .word gdt_end - gdt
  571. .long gdt
  572. .word 0
  573. .quad 0x00cf9a000000ffff /* __KERNEL32_CS */
  574. .quad 0x00af9a000000ffff /* __KERNEL_CS */
  575. .quad 0x00cf92000000ffff /* __KERNEL_DS */
  576. .quad 0x0080890000000000 /* TS descriptor */
  577. .quad 0x0000000000000000 /* TS continued */
  578. gdt_end:
  579. #ifdef CONFIG_EFI_STUB
  580. efi_config:
  581. .quad 0
  582. #ifdef CONFIG_EFI_MIXED
  583. .global efi32_config
  584. efi32_config:
  585. .fill 5,8,0
  586. .quad efi64_thunk
  587. .byte 0
  588. #endif
  589. .global efi64_config
  590. efi64_config:
  591. .fill 5,8,0
  592. .quad efi_call
  593. .byte 1
  594. #endif /* CONFIG_EFI_STUB */
  595. /*
  596. * Stack and heap for uncompression
  597. */
  598. .bss
  599. .balign 4
  600. boot_heap:
  601. .fill BOOT_HEAP_SIZE, 1, 0
  602. boot_stack:
  603. .fill BOOT_STACK_SIZE, 1, 0
  604. boot_stack_end:
  605. /*
  606. * Space for page tables (not in .bss so not zeroed)
  607. */
  608. .section ".pgtable","a",@nobits
  609. .balign 4096
  610. pgtable:
  611. .fill BOOT_PGT_SIZE, 1, 0
  612. /*
  613. * The page table is going to be used instead of page table in the trampoline
  614. * memory.
  615. */
  616. top_pgtable:
  617. .fill PAGE_SIZE, 1, 0