Re: [patch V2 01/22] x86/cpu/topology: Make the APIC mismatch warnings complete
From: Ashok Raj
Date: Thu Jan 25 2024 - 04:56:25 EST
On Tue, Jan 23, 2024 at 02:10:04PM +0100, Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>
> Detect all possible combinations of mismatch right in the CPUID evaluation
> code.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>
> ---
> arch/x86/include/asm/apic.h | 5 ++---
> arch/x86/kernel/cpu/common.c | 15 ++-------------
> arch/x86/kernel/cpu/topology_common.c | 12 ++++++++++++
> 3 files changed, 16 insertions(+), 16 deletions(-)
[snip]
> --- a/arch/x86/kernel/cpu/topology_common.c
> +++ b/arch/x86/kernel/cpu/topology_common.c
> @@ -177,6 +177,18 @@ void cpu_parse_topology(struct cpuinfo_x
>
> parse_topology(&tscan, false);
>
> + if (IS_ENABLED(CONFIG_X86_LOCAL_APIC)) {
> + if (c->topo.initial_apicid != c->topo.apicid) {
> + pr_err(FW_BUG "CPU%4u: APIC ID mismatch. CPUID: 0x%04x APIC: 0x%04x\n",
> + cpu, c->topo.initial_apicid, c->topo.apicid);
> + }
> +
> + if (c->topo.apicid != cpuid_to_apicid[cpu]) {
> + pr_err(FW_BUG "CPU%4u: APIC ID mismatch. Firmware: 0x%04x APIC: 0x%04x\n",
> + cpu, cpuid_to_apicid[cpu], c->topo.apicid);
> + }
Should we consider tainting the kernel when there is any mismatch?