Skip to content

Commit 8b37357

Browse files
arkamarKAGA-KOKO
authored andcommitted
x86/acpi: Don't limit CPUs to 1 for Xen PV guests due to disabled ACPI
Xen disables ACPI for PV guests in DomU, which causes acpi_mps_check() to return 1 when CONFIG_X86_MPPARSE is not set. As a result, the local APIC is disabled and the guest is later limited to a single vCPU, despite being configured with more. This regression was introduced in version 6.9 in commit 7c0edad ("x86/cpu/topology: Rework possible CPU management"), which added an early check that limits CPUs to 1 if apic_is_disabled. Update the acpi_mps_check() logic to return 0 early when running as a Xen PV guest in DomU, preventing APIC from being disabled in this specific case and restoring correct multi-vCPU behaviour. Fixes: 7c0edad ("x86/cpu/topology: Rework possible CPU management") Signed-off-by: Petr Vaněk <arkamar@atlas.cz> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250407132445.6732-2-arkamar@atlas.cz
1 parent 0af2f6b commit 8b37357

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

arch/x86/kernel/acpi/boot.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <linux/serial_core.h>
2424
#include <linux/pgtable.h>
2525

26+
#include <xen/xen.h>
27+
2628
#include <asm/e820/api.h>
2729
#include <asm/irqdomain.h>
2830
#include <asm/pci_x86.h>
@@ -1729,6 +1731,15 @@ int __init acpi_mps_check(void)
17291731
{
17301732
#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_X86_MPPARSE)
17311733
/* mptable code is not built-in*/
1734+
1735+
/*
1736+
* Xen disables ACPI in PV DomU guests but it still emulates APIC and
1737+
* supports SMP. Returning early here ensures that APIC is not disabled
1738+
* unnecessarily and the guest is not limited to a single vCPU.
1739+
*/
1740+
if (xen_pv_domain() && !xen_initial_domain())
1741+
return 0;
1742+
17321743
if (acpi_disabled || acpi_noirq) {
17331744
pr_warn("MPS support code is not built-in, using acpi=off or acpi=noirq or pci=noacpi may have problem\n");
17341745
return 1;

0 commit comments

Comments
 (0)