[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mcclyouhgeqzkhljovu7euzvowyqrtf5q4madh3f32yeb7ubnk@xdtbsvi2m7en>
Date: Wed, 20 Aug 2025 13:41:28 +0530
From: Naveen N Rao <naveen@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: K Prateek Nayak <kprateek.nayak@....com>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>, Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>, x86@...nel.org, Sairaj Kodilkar <sarunkod@....com>,
"H. Peter Anvin" <hpa@...or.com>, "Peter Zijlstra (Intel)" <peterz@...radead.org>,
"Xin Li (Intel)" <xin@...or.com>, Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Mario Limonciello <mario.limonciello@....com>, "Gautham R. Shenoy" <gautham.shenoy@....com>,
Babu Moger <babu.moger@....com>, Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Subject: Re: [PATCH v3 0/4] x86/cpu/topology: Work around the nuances of
virtualization on AMD/Hygon
On Tue, Aug 19, 2025 at 01:34:47PM +0200, Borislav Petkov wrote:
> Lemme try to make some sense of this because the wild use of names and things
> is making my head spin...
>
> On Mon, Aug 18, 2025 at 06:04:31AM +0000, K Prateek Nayak wrote:
> > When running an AMD guest on QEMU with > 255 cores, the following FW_BUG
> > was noticed with recent kernels:
> >
> > [Firmware Bug]: CPU 512: APIC ID mismatch. CPUID: 0x0000 APIC: 0x0200
> >
> > Naveen, Sairaj debugged the cause to commit c749ce393b8f ("x86/cpu: Use
> > common topology code for AMD") where, after the rework, the initial
> > APICID was set using the CPUID leaf 0x8000001e EAX[31:0] as opposed to
>
> That's
>
> CPUID_Fn8000001E_ECX [Node Identifiers] (Core::X86::Cpuid::NodeId)
>
> > the value from CPUID leaf 0xb EDX[31:0] previously.
>
> That's
>
> CPUID_Fn0000000B_EDX [Extended Topology Enumeration]
> (Core::X86::Cpuid::ExtTopEnumEdx)
Regardless of the qemu bug with leaf 0x8000001e (with >255 cores),
section '16.12 x2APIC_ID' of the APM says:
CPUID. The x2APIC ID is reported by CPUID functions Fn0000_000B
(Extended Topology Enumeration) and CPUID Fn8000_001E (Extended APIC
ID) as follows:
- Fn0000_000B_EDX[31:0]_x0 reports the full 32-bit ID, independent of
APIC mode (i.e. even with APIC disabled)
- Fn8000_001E_EAX[31:0] conditionally reports APIC ID. There are 3
cases:
- 32-bit x2APIC_ID, in x2APIC mode.
- 8-bit APIC ID (upper 24 bits are 0), in xAPIC mode.
- 0, if the APIC is disabled.
That suggests use of leaf 0xb for the initial x2APIC ID especially
during early init. I'm not sure why leaf 0x8000001e was preferred over
leaf 0xb in commit c749ce393b8f ("x86/cpu: Use common topology code for
AMD") though.
- Naveen
Powered by blists - more mailing lists