On Fri, Apr 18, 2025 at 11:31:27AM -0700, Sean Christopherson wrote:
IMO, this is blatantly a QEMU bug (I verified the behavior when using "kvm64" on AMD). As per QEMU commit d1cd4bf419 ("introduce kvm64 CPU"), the vendor + FMS enumerates an Intel P4:
.name = "kvm64", .level = 0xd, .vendor = CPUID_VENDOR_INTEL, .family = 15, .model = 6,
Per x86_cpu_load_model(), QEMU overrides the vendor when using KVM (at a glance, I can't find the code that actually overrides the vendor, gotta love QEMU's object model):
LOL, I thought I was the only one who thought this is madness. :-P
/* * vendor property is set here but then overloaded with the * host cpu vendor for KVM and HVF. */ object_property_set_str(OBJECT(cpu), "vendor", def->vendor, &error_abort);
Overriding the vendor but using Intel's P4 FMS is flat out wrong. IMO, QEMU should use the same FMS as qemu64 for kvm64 when running on AMD.
.name = "qemu64", .level = 0xd, .vendor = CPUID_VENDOR_AMD, .family = 15, .model = 107, .stepping = 1,
Yeah, scraping FMS information is a bad idea, but what QEMU is doing is arguably far worse.
Ok, let's fix qemu. I don't have a clue, though, how to go about that so I'd rely on your guidance here.
Because I really hate wagging the dog and "fixing" the kernel because something else can't be bothered. I didn't object stronger to that fix because it is meh, more of those "if I'm a guest" gunk which we sprinkle nowadays and that's apparently not that awful-ish...
Thx.