From: "Jürgen Groß" <jgross@suse.com>
To: x86@kernel.org, Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH 1/1] x86: SMP broken on Xen PV DomU since 6.9
Date: Fri, 4 Oct 2024 12:29:57 +0200 [thread overview]
Message-ID: <45f3a10c-8695-42cb-abb8-8c13ce1a476b@suse.com> (raw)
In-Reply-To: <864022534.0ifERbkFSE@gongov>
[-- Attachment #1.1.1: Type: text/plain, Size: 1041 bytes --]
On 04.10.24 12:05, Niels Dettenbach wrote:
> Virtual machines under Xen Hypervisor (DomU) running in Xen PV mode use a
> special, nonstandard synthetized CPU topology which "just works" under
> kernels 6.9.x while newer kernels wrongly assuming a "crash kernel" and
> disable SMP (reducing to one CPU core) because the newer topology
> implementation produces a wrong error "[Firmware Bug]: APIC enumeration
> order not specification compliant" after new topology checks which are
> improper for Xen PV platform. As a result, the kernel disables SMP and
> activates just one CPU core within the PV DomU "VM" (DomU in PV mode).
>
> The patch disables the regarding checks if it is running in Xen PV
> mode (only) and bring back SMP / all CPUs as in the past to such DomU
> VMs. The Xen subsystem takes care of the proper interaction between "guest"
> (DomU) and the "host" (Dom0).
>
> Signed-off-by: Niels Dettenbach <nd@syndicat.com>
Does the attached patch instead of yours help?
Compile tested only.
Juergen
[-- Attachment #1.1.2: 0001-x86-xen-mark-boot-CPU-of-PV-guest-in-MSR_IA32_APICBA.patch --]
[-- Type: text/x-patch, Size: 1066 bytes --]
From 2d48fb9ddca0aa6510f4f18966112222d405aedc Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Fri, 4 Oct 2024 12:22:12 +0200
Subject: [PATCH] x86/xen: mark boot CPU of PV guest in MSR_IA32_APICBASE
Recent topology checks of the x86 boot code uncovered the need for
PV guests to have the boot cpu marked in the APICBASE MSR.
Fixes: 9d22c96316ac ("x86/topology: Handle bogus ACPI tables correctly")
Reported-by: Niels Dettenbach <nd@syndicat.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
arch/x86/xen/enlighten_pv.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 2c12ae42dc8b..d6818c6cafda 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1032,6 +1032,10 @@ static u64 xen_do_read_msr(unsigned int msr, int *err)
switch (msr) {
case MSR_IA32_APICBASE:
val &= ~X2APIC_ENABLE;
+ if (smp_processor_id() == 0)
+ val |= MSR_IA32_APICBASE_BSP;
+ else
+ val &= ~MSR_IA32_APICBASE_BSP;
break;
}
return val;
--
2.43.0
[-- Attachment #1.1.3: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
next prev parent reply other threads:[~2024-10-04 10:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2210883.Icojqenx9y@gongov>
[not found] ` <878qv8ypkl.ffs@tglx>
2024-10-04 10:05 ` Niels Dettenbach
2024-10-04 10:29 ` Jürgen Groß [this message]
2024-10-04 10:36 ` Niels Dettenbach
2024-10-07 10:29 ` Niels Dettenbach
2024-10-07 12:12 ` 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=45f3a10c-8695-42cb-abb8-8c13ce1a476b@suse.com \
--to=jgross@suse.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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®