]> Git Repo - qemu.git/commitdiff
KVM: x86: Fix up misreported CPU features
authorJan Kiszka <[email protected]>
Wed, 3 Feb 2010 20:16:37 +0000 (21:16 +0100)
committerMarcelo Tosatti <[email protected]>
Wed, 3 Feb 2010 21:47:34 +0000 (19:47 -0200)
From qemu-kvm: Kernels before 2.6.30 misreported some essential CPU
features via KVM_GET_SUPPORTED_CPUID. Fix them up.

Signed-off-by: Jan Kiszka <[email protected]>
target-i386/kvm.c

index b457b96d46437813968c9c8151d5f68def4375ca..0d08cd532ec309abadd99687243614976191dce9 100644 (file)
@@ -99,12 +99,18 @@ 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 == 0x80000001) {
+                switch (function) {
+                case 1:
+                    /* KVM before 2.6.30 misreports the following features */
+                    ret |= CPUID_MTRR | CPUID_PAT | CPUID_MCE | CPUID_MCA;
+                    break;
+                case 0x80000001:
                     /* On Intel, kvm returns cpuid according to the Intel spec,
                      * so add missing bits according to the AMD spec:
                      */
                     cpuid_1_edx = kvm_arch_get_supported_cpuid(env, 1, R_EDX);
                     ret |= cpuid_1_edx & 0xdfeff7ff;
+                    break;
                 }
                 break;
             }
This page took 0.028893 seconds and 4 git commands to generate.