summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/boot/compressed/head_32.S8
-rw-r--r--arch/x86/boot/compressed/head_64.S18
-rw-r--r--arch/x86/boot/compressed/vmlinux.lds.S19
3 files changed, 29 insertions, 16 deletions
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 7bd7766ffab..59425e157df 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -93,9 +93,9 @@ ENTRY(startup_32)
* where decompression in place becomes safe.
*/
pushl %esi
- leal _ebss(%ebp), %esi
- leal _ebss(%ebx), %edi
- movl $(_ebss - startup_32), %ecx
+ leal _bss(%ebp), %esi
+ leal _bss(%ebx), %edi
+ movl $(_bss - startup_32), %ecx
std
rep movsb
cld
@@ -125,7 +125,7 @@ relocated:
* Clear BSS
*/
xorl %eax, %eax
- leal _edata(%ebx), %edi
+ leal _bss(%ebx), %edi
leal _ebss(%ebx), %ecx
subl %edi, %ecx
cld
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 26c3def43ac..5bc9052615b 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -253,9 +253,9 @@ ENTRY(startup_64)
* Copy the compressed kernel to the end of our buffer
* where decompression in place becomes safe.
*/
- leaq _end_before_pgt(%rip), %r8
- leaq _end_before_pgt(%rbx), %r9
- movq $_end_before_pgt /* - $startup_32 */, %rcx
+ leaq _bss(%rip), %r8
+ leaq _bss(%rbx), %r9
+ movq $_bss /* - $startup_32 */, %rcx
1: subq $8, %r8
subq $8, %r9
movq 0(%r8), %rax
@@ -276,8 +276,8 @@ relocated:
* Clear BSS
*/
xorq %rax, %rax
- leaq _edata(%rbx), %rdi
- leaq _end_before_pgt(%rbx), %rcx
+ leaq _bss(%rbx), %rdi
+ leaq _ebss(%rbx), %rcx
subq %rdi, %rcx
cld
rep stosb
@@ -329,3 +329,11 @@ boot_heap:
boot_stack:
.fill BOOT_STACK_SIZE, 1, 0
boot_stack_end:
+
+/*
+ * Space for page tables (not in .bss so not zeroed)
+ */
+ .section ".pgtable","a",@nobits
+ .balign 4096
+pgtable:
+ .fill 6*4096, 1, 0
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index dbe515e13fe..cc353e1b3ff 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -2,6 +2,8 @@ OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
#undef i386
+#include <asm/page_types.h>
+
#ifdef CONFIG_X86_64
OUTPUT_ARCH(i386:x86-64)
ENTRY(startup_64)
@@ -48,13 +50,16 @@ SECTIONS
*(.bss)
*(.bss.*)
*(COMMON)
-#ifdef CONFIG_X86_64
- . = ALIGN(8);
- _end_before_pgt = . ;
- . = ALIGN(4096);
- pgtable = . ;
- . = . + 4096 * 6;
-#endif
+ . = ALIGN(8); /* For convenience during zeroing */
_ebss = .;
}
+#ifdef CONFIG_X86_64
+ . = ALIGN(PAGE_SIZE);
+ .pgtable : {
+ _pgtable = . ;
+ *(.pgtable)
+ _epgtable = . ;
+ }
+#endif
+ _end = .;
}