summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-02-03 21:16:37 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2010-02-03 19:47:34 -0200
commit19ccb8ea1799f6f29ba5bc37d5f18dc8050d4029 (patch)
tree9db6ad5c5a420776846e077557c8f90b44d26f5a
parentaee028b95d1d250a727583a14c864bc95ec27c69 (diff)
KVM: x86: Fix up misreported CPU features
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 <jan.kiszka@siemens.com>
-rw-r--r--target-i386/kvm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index b457b96d46..0d08cd532e 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -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;
}