diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-05-09 01:27:41 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-09 02:18:47 +0200 |
commit | 0a137736704ef9af719409933b3c33e138461786 (patch) | |
tree | b6ca7c13de5db34de9eda7bfa7549121f4c6a855 /arch/x86/boot/compressed/head_64.S | |
parent | x86, boot: straighten out ranges to copy/zero in compressed/head*.S (diff) | |
download | linux-0a137736704ef9af719409933b3c33e138461786.tar.xz linux-0a137736704ef9af719409933b3c33e138461786.zip |
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.S | 16 |
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) 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.. */ |