mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Petr Vaněk" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: arkamar@atlas.cz, Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/urgent] x86/acpi: Don't limit CPUs to 1 for Xen PV guests due to disabled ACPI
Date: Mon, 07 Apr 2025 14:44:29 -0000	[thread overview]
Message-ID: <174403706955.31282.7031075757256146451.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250407132445.6732-2-arkamar@atlas.cz>

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     8b37357a78d7fa13d88ea822b35b40137da1c85e
Gitweb:        https://git.kernel.org/tip/8b37357a78d7fa13d88ea822b35b40137da1c85e
Author:        Petr Vaněk <arkamar@atlas.cz>
AuthorDate:    Mon, 07 Apr 2025 15:24:27 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 07 Apr 2025 16:35:21 +02:00

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 7c0edad3643f
("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: 7c0edad3643f ("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
---
 arch/x86/kernel/acpi/boot.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index dae6a73..9fa321a 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -23,6 +23,8 @@
 #include <linux/serial_core.h>
 #include <linux/pgtable.h>
 
+#include <xen/xen.h>
+
 #include <asm/e820/api.h>
 #include <asm/irqdomain.h>
 #include <asm/pci_x86.h>
@@ -1729,6 +1731,15 @@ int __init acpi_mps_check(void)
 {
 #if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_X86_MPPARSE)
 /* mptable code is not built-in*/
+
+	/*
+	 * Xen disables ACPI in PV DomU guests but it still emulates APIC and
+	 * supports SMP. Returning early here ensures that APIC is not disabled
+	 * unnecessarily and the guest is not limited to a single vCPU.
+	 */
+	if (xen_pv_domain() && !xen_initial_domain())
+		return 0;
+
 	if (acpi_disabled || acpi_noirq) {
 		pr_warn("MPS support code is not built-in, using acpi=off or acpi=noirq or pci=noacpi may have problem\n");
 		return 1;

  reply	other threads:[~2025-04-07 14:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-05 18:16 [PATCH 0/1] x86/topology: Fix regression limiting Xen PV DomU CPUs to 1 Petr Vaněk
2025-04-05 18:16 ` [PATCH 1/1] x86/cpu/topology: Don't limit CPUs to 1 for Xen PV guests due to disabled APIC Petr Vaněk
2025-04-06 10:08   ` Thomas Gleixner
2025-04-07 13:24     ` Petr Vaněk
2025-04-07 13:24       ` [PATCH v2 1/1] x86/acpi: Don't limit CPUs to 1 for Xen PV guests due to disabled ACPI Petr Vaněk
2025-04-07 14:44         ` tip-bot2 for Petr Vaněk [this message]
2025-04-08  6:19           ` [tip: x86/urgent] " Petr Vaněk
2025-04-08  8:50             ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=174403706955.31282.7031075757256146451.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=arkamar@atlas.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®