[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <df39d7d9-4291-450b-85b7-4c57a3c4a025@amd.com>
Date: Wed, 18 Jun 2025 10:56:11 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Naveen N Rao <naveen@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org, linux-kernel@...r.kernel.org, "H. Peter Anvin"
<hpa@...or.com>, Sairaj Kodilkar <sarunkod@....com>,
Mario Limonciello <mario.limonciello@....com>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
"Gautham R. Shenoy" <gautham.shenoy@....com>, Babu Moger
<babu.moger@....com>, Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Subject: Re: [PATCH 2/2] x86/cpu/topology: Use initial APICID from XTOPOEXT on
AMD/HYGON
Hello Naveen,
On 6/18/2025 9:30 AM, Naveen N Rao wrote:
>> diff --git a/arch/x86/kernel/cpu/topology_amd.c b/arch/x86/kernel/cpu/topology_amd.c
>> index fec849fff82f..2ff6988e020a 100644
>> --- a/arch/x86/kernel/cpu/topology_amd.c
>> +++ b/arch/x86/kernel/cpu/topology_amd.c
>> @@ -80,7 +80,13 @@ static bool parse_8000_001e(struct topo_scan *tscan, bool has_topoext)
>>
>> cpuid_leaf(0x8000001e, &leaf);
>>
>> - tscan->c->topo.initial_apicid = leaf.ext_apic_id;
>> + /*
>> + * Prefer initial_apicid parsed from CPUID leaf 0x8000026 or 0xb
>> + * if available. Otherwise prefer the one from leaf 0x8000001e
>> + * over 0x1.
>> + */
>> + if (!has_topoext)
>> + tscan->c->topo.initial_apicid = leaf.ext_apic_id;
>
> My understanding is that the rest of this function continues to work
> properly with an all-zero return value from CPUID leaf 0x8000001e - data
> from topoext is preferred where available, and other sources are used
> for llc_id.
Yes. QEMU just errs on the side of caution for CoreID collision in
0x8000001e and "NumSharingCache" in 0x8000001d EAX[25:14] can still
represent 2^12 (4096) CPUs in each cache domain which is larger than
the total number of vCPUs possible currently I believe.
> And, this fixes the firmware bug warning seen during a guest boot in
> qemu for me, so for this patch:
> Tested-by: Naveen N Rao (AMD) <naveen@...nel.org>
Thank you for debugging the issue and testing :)
--
Thanks and Regards,
Prateek
Powered by blists - more mailing lists