Page MenuHomeFreeBSD

D14810.diff
No OneTemporary

D14810.diff

Index: head/sys/x86/x86/identcpu.c
===================================================================
--- head/sys/x86/x86/identcpu.c
+++ head/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
Sun, Jan 12, 5:25 AM (21 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15761626
Default Alt Text
D14810.diff (779 B)

Event Timeline