public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] x86/cstart: Delete "local" version of save_id() to fix x2APIC SMP bug
@ 2025-12-18 23:26 Sean Christopherson
  2025-12-19  8:47 ` Igor Mammedov
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Christopherson @ 2025-12-18 23:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kvm, Igor Mammedov, Peter Xu, Sean Christopherson

Delete cstart.S's version of save_id() to play nice with 32-bit SMP tests
on CPUs that support x2APIC.  The local version assumes xAPIC mode and so
depending on the underlying "hardware" (e.g. AVIC vs. APICv vs. emulated,
and with or without KVM_X86_QUIRK_LAPIC_MMIO_HOLE), may mark the wrong CPU
as being online.

Fixes: 0991c0ea ("x86: fix APs with APIC ID more that 255 not showing in id_map")
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 x86/cstart.S | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/x86/cstart.S b/x86/cstart.S
index dafb330d..49ba4818 100644
--- a/x86/cstart.S
+++ b/x86/cstart.S
@@ -84,13 +84,6 @@ prepare_32:
 
 smp_stacktop:	.long stacktop - per_cpu_size
 
-save_id:
-	movl $(APIC_DEFAULT_PHYS_BASE + APIC_ID), %eax
-	movl (%eax), %eax
-	shrl $24, %eax
-	lock btsl %eax, online_cpus
-	retl
-
 ap_start32:
 	setup_segments
 	mov $-per_cpu_size, %esp

base-commit: 31d91f5c9b7546471b729491664b05c933d64a7a
-- 
2.52.0.322.g1dd061c0dc-goog


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

* Re: [kvm-unit-tests PATCH] x86/cstart: Delete "local" version of save_id() to fix x2APIC SMP bug
  2025-12-18 23:26 [kvm-unit-tests PATCH] x86/cstart: Delete "local" version of save_id() to fix x2APIC SMP bug Sean Christopherson
@ 2025-12-19  8:47 ` Igor Mammedov
  0 siblings, 0 replies; 2+ messages in thread
From: Igor Mammedov @ 2025-12-19  8:47 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, kvm, Peter Xu

On Thu, 18 Dec 2025 15:26:18 -0800
Sean Christopherson <seanjc@google.com> wrote:

> Delete cstart.S's version of save_id() to play nice with 32-bit SMP tests
> on CPUs that support x2APIC.  The local version assumes xAPIC mode and so
> depending on the underlying "hardware" (e.g. AVIC vs. APICv vs. emulated,
> and with or without KVM_X86_QUIRK_LAPIC_MMIO_HOLE), may mark the wrong CPU
> as being online.
> 
> Fixes: 0991c0ea ("x86: fix APs with APIC ID more that 255 not showing in id_map")
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Peter Xu <peterx@redhat.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>

Acked-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  x86/cstart.S | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/x86/cstart.S b/x86/cstart.S
> index dafb330d..49ba4818 100644
> --- a/x86/cstart.S
> +++ b/x86/cstart.S
> @@ -84,13 +84,6 @@ prepare_32:
>  
>  smp_stacktop:	.long stacktop - per_cpu_size
>  
> -save_id:
> -	movl $(APIC_DEFAULT_PHYS_BASE + APIC_ID), %eax
> -	movl (%eax), %eax
> -	shrl $24, %eax
> -	lock btsl %eax, online_cpus
> -	retl
> -
>  ap_start32:
>  	setup_segments
>  	mov $-per_cpu_size, %esp
> 
> base-commit: 31d91f5c9b7546471b729491664b05c933d64a7a


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

end of thread, other threads:[~2025-12-19  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18 23:26 [kvm-unit-tests PATCH] x86/cstart: Delete "local" version of save_id() to fix x2APIC SMP bug Sean Christopherson
2025-12-19  8:47 ` Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox