diff mbox series

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

Message ID 20240819010854.13931-1-sidongli1997@gmail.com (mailing list archive)
State New, archived
Headers show
Series [kvmtool,1/4] x86: Set the correct srcbusirq of pci irq mptable | expand

Commit Message

Dongli Si Aug. 19, 2024, 1:08 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;