diff mbox series

[kvm-unit-tests,v1,1/8] x86/cstart.S: initialize stack before using it

Message ID 20200622162141.279716-2-imbrenda@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series Minor fixes, improvements, and cleanup | expand

Commit Message

Claudio Imbrenda June 22, 2020, 4:21 p.m. UTC
It seems the 32-bit initialization code uses the stack before actually
initializing it.

Probably the boot loader leaves a reasonable value in the stack pointer so
this issue has not been noticed before.

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
 x86/cstart.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/x86/cstart.S b/x86/cstart.S
index 38ac19b..fa62e09 100644
--- a/x86/cstart.S
+++ b/x86/cstart.S
@@ -96,13 +96,13 @@  MSR_GS_BASE = 0xc0000101
 
 .globl start
 start:
+        mov $stacktop, %esp
         push %ebx
         call setup_multiboot
         call setup_libcflat
         mov mb_cmdline(%ebx), %eax
         mov %eax, __args
         call __setup_args
-        mov $stacktop, %esp
         setup_percpu_area
         call prepare_32
         jmpl $8, $start32