summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot')
-rw-r--r--arch/x86/boot/compressed/head_32.S10
-rw-r--r--arch/x86/boot/compressed/head_64.S16
2 files changed, 12 insertions, 14 deletions
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 59425e157df3..d7245cf80261 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -88,6 +88,9 @@ ENTRY(startup_32)
addl $4095, %ebx
andl $~4095, %ebx
+ /* Set up the stack */
+ leal boot_stack_end(%ebx), %esp
+
/*
* Copy the compressed kernel to the end of our buffer
* where decompression in place becomes safe.
@@ -122,7 +125,7 @@ ENDPROC(startup_32)
relocated:
/*
- * Clear BSS
+ * Clear BSS (stack is currently empty)
*/
xorl %eax, %eax
leal _bss(%ebx), %edi
@@ -132,11 +135,6 @@ relocated:
rep stosb
/*
- * Setup the stack for the decompressor
- */
- leal boot_stack_end(%ebx), %esp
-
-/*
* Do the decompression, and jump to the new kernel..
*/
movl output_len(%ebx), %eax
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 5bc9052615b6..a0b18426069a 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -249,6 +249,13 @@ ENTRY(startup_64)
addq $(32768 + 18 + 4095), %rbx
andq $~4095, %rbx
+ /* Set up the stack */
+ leaq boot_stack_end(%rbx), %rsp
+
+ /* Zero EFLAGS */
+ pushq $0
+ popfq
+
/*
* Copy the compressed kernel to the end of our buffer
* where decompression in place becomes safe.
@@ -273,7 +280,7 @@ ENTRY(startup_64)
relocated:
/*
- * Clear BSS
+ * Clear BSS (stack is currently empty)
*/
xorq %rax, %rax
leaq _bss(%rbx), %rdi
@@ -282,13 +289,6 @@ relocated:
cld
rep stosb
- /* Setup the stack */
- leaq boot_stack_end(%rip), %rsp
-
- /* zero EFLAGS after setting rsp */
- pushq $0
- popfq
-
/*
* Do the decompression, and jump to the new kernel..
*/
OpenPOWER on IntegriCloud