diff options
-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 */ |