From d172a5dddb8be871f1b4c545db294651b50b196f Mon Sep 17 00:00:00 2001 From: Thomas Prescher Date: Wed, 21 May 2025 17:08:08 +0200 Subject: [PATCH] arch: fix extended topology enumeration leaf When booting a Linux guest in SMP configuration, the following kernel warning can be observed: [Firmware Bug]: CPUID leaf 0xb subleaf 1 APIC ID mismatch 1 != 0 The reason is that we announce the presence of the extended topology leaf, but fail to announce the x2apic ID in EDX. Signed-off-by: Thomas Prescher On-behalf-of: SAP thomas.prescher@sap.com --- arch/src/x86_64/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/src/x86_64/mod.rs b/arch/src/x86_64/mod.rs index 7a0bc0696..977bf3678 100644 --- a/arch/src/x86_64/mod.rs +++ b/arch/src/x86_64/mod.rs @@ -1411,6 +1411,7 @@ fn update_cpuid_topology( u32::from(dies_per_package * cores_per_die * threads_per_core), ); CpuidPatch::set_cpuid_reg(cpuid, 0xb, Some(1), CpuidReg::ECX, 2 << 8); + CpuidPatch::set_cpuid_reg(cpuid, 0xb, Some(1), CpuidReg::EDX, x2apic_id); // CPU Topology leaf 0x1f CpuidPatch::set_cpuid_reg(cpuid, 0x1f, Some(0), CpuidReg::EAX, thread_width);