aboutsummaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@amd.com>2009-06-25 00:08:03 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 13:52:11 -0500
commit671e4676076fb62860986decd44440d97bcc872d (patch)
treeae54197434549bb3f634e187ce83ba59bfb70a9d /target-i386
parent6c1f42fe83bf9bc14a7a6cc5afd8dad83ee25c74 (diff)
remove CPUID host hacks
KVM provides an in-kernel feature to disable CPUID bits that are not present in the current host. So there is no need here to duplicate this work. Additionally allows 3DNow! on capable processors, since the restriction seems to apply to QEMU/TCG only. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/helper.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 2e775701d6..bcaaab71a4 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1643,28 +1643,11 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
*edx = env->cpuid_ext2_features;
if (kvm_enabled()) {
- uint32_t h_eax, h_edx;
-
- host_cpuid(index, 0, &h_eax, NULL, NULL, &h_edx);
-
- /* disable CPU features that the host does not support */
-
- /* long mode */
- if ((h_edx & 0x20000000) == 0 /* || !lm_capable_kernel */)
- *edx &= ~0x20000000;
- /* syscall */
- if ((h_edx & 0x00000800) == 0)
- *edx &= ~0x00000800;
- /* nx */
- if ((h_edx & 0x00100000) == 0)
- *edx &= ~0x00100000;
-
- /* disable CPU features that KVM cannot support */
-
- /* svm */
- *ecx &= ~4UL;
- /* 3dnow */
- *edx &= ~0xc0000000;
+ /* Nested SVM not yet supported in KVM */
+ *ecx &= ~CPUID_EXT3_SVM;
+ } else {
+ /* AMD 3DNow! is not supported in QEMU */
+ *edx &= ~(CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT);
}
break;
case 0x80000002: