kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: fix smp_stacktop on 32-bit
@ 2020-06-24 20:36 Nadav Amit
  2020-06-25 10:41 ` Paolo Bonzini
  2020-06-25 11:15 ` Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Nadav Amit @ 2020-06-24 20:36 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kvm, Nadav Amit

smp_stacktop in 32-bit is fixed to some magic address. Use the address
of the memory that was reserved for the stack instead.

Signed-off-by: Nadav Amit <namit@vmware.com>
---
 x86/cstart.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x86/cstart.S b/x86/cstart.S
index 1d8b8ac..a072aed 100644
--- a/x86/cstart.S
+++ b/x86/cstart.S
@@ -134,7 +134,7 @@ prepare_32:
 	mov %eax, %cr0
 	ret
 
-smp_stacktop:	.long 0xa0000
+smp_stacktop:	.long stacktop - 4096
 
 save_id:
 	movl $(APIC_DEFAULT_PHYS_BASE + APIC_ID), %eax
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: fix smp_stacktop on 32-bit
  2020-06-24 20:36 [PATCH] x86: fix smp_stacktop on 32-bit Nadav Amit
@ 2020-06-25 10:41 ` Paolo Bonzini
  2020-06-25 11:15 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2020-06-25 10:41 UTC (permalink / raw)
  To: Nadav Amit; +Cc: kvm

On 24/06/20 22:36, Nadav Amit wrote:
> smp_stacktop in 32-bit is fixed to some magic address. Use the address
> of the memory that was reserved for the stack instead.
> 
> Signed-off-by: Nadav Amit <namit@vmware.com>
> ---
>  x86/cstart.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/x86/cstart.S b/x86/cstart.S
> index 1d8b8ac..a072aed 100644
> --- a/x86/cstart.S
> +++ b/x86/cstart.S
> @@ -134,7 +134,7 @@ prepare_32:
>  	mov %eax, %cr0
>  	ret
>  
> -smp_stacktop:	.long 0xa0000
> +smp_stacktop:	.long stacktop - 4096
>  
>  save_id:
>  	movl $(APIC_DEFAULT_PHYS_BASE + APIC_ID), %eax
> 

Queued, thanks.

Paolo


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: fix smp_stacktop on 32-bit
  2020-06-24 20:36 [PATCH] x86: fix smp_stacktop on 32-bit Nadav Amit
  2020-06-25 10:41 ` Paolo Bonzini
@ 2020-06-25 11:15 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2020-06-25 11:15 UTC (permalink / raw)
  To: Nadav Amit; +Cc: kvm

On 24/06/20 22:36, Nadav Amit wrote:
> smp_stacktop in 32-bit is fixed to some magic address. Use the address
> of the memory that was reserved for the stack instead.
> 
> Signed-off-by: Nadav Amit <namit@vmware.com>
> ---
>  x86/cstart.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/x86/cstart.S b/x86/cstart.S
> index 1d8b8ac..a072aed 100644
> --- a/x86/cstart.S
> +++ b/x86/cstart.S
> @@ -134,7 +134,7 @@ prepare_32:
>  	mov %eax, %cr0
>  	ret
>  
> -smp_stacktop:	.long 0xa0000
> +smp_stacktop:	.long stacktop - 4096
>  
>  save_id:
>  	movl $(APIC_DEFAULT_PHYS_BASE + APIC_ID), %eax
> 

This uncovers a latent bug for which I've just sent a patch ("x86: fix
stack pointer after call").

Paolo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-25 11:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 20:36 [PATCH] x86: fix smp_stacktop on 32-bit Nadav Amit
2020-06-25 10:41 ` Paolo Bonzini
2020-06-25 11:15 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).