diff options
author | Maciek Molerus <maciek@google.com> | 2011-08-31 16:39:55 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2011-09-13 13:00:02 +0200 |
commit | aab4f055c481d3b0c4ee06154eeb5d9d25e71977 (patch) | |
tree | 56bc8797ecfafa9489259198c022711222a8dfe1 /target-i386 | |
parent | 9ff69721d24f81317183ddb2e9e352bb34650752 (diff) | |
download | external_qemu-aab4f055c481d3b0c4ee06154eeb5d9d25e71977.zip external_qemu-aab4f055c481d3b0c4ee06154eeb5d9d25e71977.tar.gz external_qemu-aab4f055c481d3b0c4ee06154eeb5d9d25e71977.tar.bz2 |
Restricting processor features in KVM mode
Some processors don't have full features set as in 'qemu32',
eg. AMD doesn't have SSSE3 extensions yet.
Added code which restricts CPU features set in KVM
mode to those it actually has.
Change-Id: I37c2d44a03e4445a607b723b0f63c91989c251dc
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/helper.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c index 550b348..6d0f18c 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1590,8 +1590,15 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, break; case 1: *eax = env->cpuid_version; + if (kvm_enabled() && !env->cpuid_vendor_override) { + /* take only subset of ext features which processor can handle */ + uint32_t unused; + host_cpuid(1, 0, NULL, &unused, ecx, &unused); + } else { + *ecx = UINT32_MAX; + } *ebx = (env->cpuid_apic_id << 24) | 8 << 8; /* CLFLUSH size in quad words, Linux wants it. */ - *ecx = env->cpuid_ext_features; + *ecx &= env->cpuid_ext_features; *edx = env->cpuid_features; /* "Hypervisor present" bit required for Microsoft SVVP */ |