[PATCH] Work around misreported kvm cpuid features

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kvm misreports MCA, MCE, MTRR, and PAT as unsupported.  This causes Vista to
fail.  Since QEMU does not support any version of kvm that does not actually
support these features, it is safe to enable them unconditionally.

These features are needed by Vista x64 to boot.

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 target-i386/kvm.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index fe67eed..a7b7ae3 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -88,6 +88,13 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg)
                 break;
             case R_EDX:
                 ret = cpuid->entries[i].edx;
+                if (function == 1) {
+                    /* kvm misreports the following features: */
+                    ret |= 1 << 12; /* MTRR */
+                    ret |= 1 << 16; /* PAT */
+                    ret |= 1 << 7;  /* MCE */
+                    ret |= 1 << 14; /* MCA */
+                }
                 if (function == 0x80000001) {
                     /* On Intel, kvm returns cpuid according to the Intel spec,
                      * so add missing bits according to the AMD spec:
-- 
1.6.1.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux