aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/head_64.S
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-08 19:27:41 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-05-08 20:18:47 -0400
commit0a137736704ef9af719409933b3c33e138461786 (patch)
treeb6ca7c13de5db34de9eda7bfa7549121f4c6a855 /arch/x86/boot/compressed/head_64.S
parent5b11f1cee5797b38d16b94d8745b12b6727a8373 (diff)
x86, boot: set up the decompression stack as early as possible
Set up the decompression stack as soon as we know where it needs to go. That way we have a full-service stack as soon as possible, rather than relying on the BP_scratch field. Note that the stack does need to be empty during bss zeroing (or else the stack needs to be moved out of the bss segment, which is also an option.) [ Impact: cleanup, minor paranoia ] Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/boot/compressed/head_64.S')
-rw-r--r--arch/x86/boot/compressed/head_64.S16
1 files changed, 8 insertions, 8 deletions
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)
249 addq $(32768 + 18 + 4095), %rbx 249 addq $(32768 + 18 + 4095), %rbx
250 andq $~4095, %rbx 250 andq $~4095, %rbx
251 251
252 /* Set up the stack */
253 leaq boot_stack_end(%rbx), %rsp
254
255 /* Zero EFLAGS */
256 pushq $0
257 popfq
258
252/* 259/*
253 * Copy the compressed kernel to the end of our buffer 260 * Copy the compressed kernel to the end of our buffer
254 * where decompression in place becomes safe. 261 * where decompression in place becomes safe.
@@ -273,7 +280,7 @@ ENTRY(startup_64)
273relocated: 280relocated:
274 281
275/* 282/*
276 * Clear BSS 283 * Clear BSS (stack is currently empty)
277 */ 284 */
278 xorq %rax, %rax 285 xorq %rax, %rax
279 leaq _bss(%rbx), %rdi 286 leaq _bss(%rbx), %rdi
@@ -282,13 +289,6 @@ relocated:
282 cld 289 cld
283 rep stosb 290 rep stosb
284 291
285 /* Setup the stack */
286 leaq boot_stack_end(%rip), %rsp
287
288 /* zero EFLAGS after setting rsp */
289 pushq $0
290 popfq
291
292/* 292/*
293 * Do the decompression, and jump to the new kernel.. 293 * Do the decompression, and jump to the new kernel..
294 */ 294 */