Page MenuHomeFreeBSD

D14810.id40653.diff
No OneTemporary

D14810.id40653.diff

Index: sys/x86/x86/identcpu.c
===================================================================
--- sys/x86/x86/identcpu.c
+++ sys/x86/x86/identcpu.c
@@ -1304,6 +1304,18 @@
if (cpu_feature2 & CPUID2_HV) {
vm_guest = VM_GUEST_VM;
do_cpuid(0x40000000, regs);
+
+ /*
+ * KVM from Linux kernels prior to commit
+ * 57c22e5f35aa4b9b2fe11f73f3e62bbf9ef36190 set %eax
+ * to 0 rather than a valid hv_high value. Check for
+ * the KVM signature bytes and fixup %eax to the
+ * highest supported leaf in that case.
+ */
+ if (regs[0] == 0 && regs[1] == 0x4b4d564b &&
+ regs[2] == 0x564b4d56 && regs[3] == 0x0000004d)
+ regs[0] = 0x40000001;
+
if (regs[0] >= 0x40000000) {
hv_high = regs[0];
((u_int *)&hv_vendor)[0] = regs[1];

File Metadata

Mime Type
text/plain
Expires
Sat, Feb 7, 2:49 PM (6 h, 17 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28456774
Default Alt Text
D14810.id40653.diff (764 B)

Event Timeline