diff mbox series

[kvm-unit-tests] x86: fix stack pointer after call

Message ID 20200625111526.1620-1-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests] x86: fix stack pointer after call | expand

Commit Message

Paolo Bonzini June 25, 2020, 11:15 a.m. UTC
Since setup_multiboot has a C calling convention, the stack pointer must
be adjusted after the call.  Without this change, the bottom of the
percpu area would be 4 bytes below the bottom of the stack.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 x86/cstart.S | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Huth June 25, 2020, 1:01 p.m. UTC | #1
On 25/06/2020 13.15, Paolo Bonzini wrote:
> Since setup_multiboot has a C calling convention, the stack pointer must
> be adjusted after the call.  Without this change, the bottom of the
> percpu area would be 4 bytes below the bottom of the stack.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   x86/cstart.S | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/x86/cstart.S b/x86/cstart.S
> index deb08b7..409cb00 100644
> --- a/x86/cstart.S
> +++ b/x86/cstart.S
> @@ -116,6 +116,7 @@ start:
>   
>           push %ebx
>           call setup_multiboot
> +        addl $4, %esp
>           call setup_libcflat
>           mov mb_cmdline(%ebx), %eax
>           mov %eax, __args

Looks right.

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/x86/cstart.S b/x86/cstart.S
index deb08b7..409cb00 100644
--- a/x86/cstart.S
+++ b/x86/cstart.S
@@ -116,6 +116,7 @@  start:
 
         push %ebx
         call setup_multiboot
+        addl $4, %esp
         call setup_libcflat
         mov mb_cmdline(%ebx), %eax
         mov %eax, __args