diff mbox series

[kvmtool,v2,4/4] x86: Disable Topology Extensions on AMD processors in cpuid

Message ID 20240907021321.30222-5-sidongli1997@gmail.com (mailing list archive)
State New, archived
Headers show
Series x86: Fixes issue with only one CPU available in kernel 6.9 | expand

Commit Message

Dongli Si Sept. 7, 2024, 2:13 a.m. UTC
When running guest kernel 6.9 and later on AMD processors, dmesg reports:

[    0.001987] [Firmware Bug]: CPU   1: APIC ID mismatch. CPUID: 0x0000 APIC: 0x0001

This is because kvmtool does not support topoext but does not tell the guest,
causing the guest kernel to read the wrong Extended APIC ID.

Signed-off-by: Dongli Si <sidongli1997@gmail.com>
---
 x86/cpuid.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/x86/cpuid.c b/x86/cpuid.c
index f4347a8..fd23429 100644
--- a/x86/cpuid.c
+++ b/x86/cpuid.c
@@ -56,6 +56,9 @@  static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid, int cpu_id)
 			}
 			break;
 		}
+		case 0x80000001:
+			entry->ecx &= ~(1 << 22);
+			break;
 		default:
 			/* Keep the CPUID function as -is */
 			break;