diff --git a/kqemu.c b/kqemu.c index 61983d01de1a3aa0c4def010ddd4aed0cdf98af9..b7a93b0be6d057d415a83be0a9b7a4d650dcf453 100644 --- a/kqemu.c +++ b/kqemu.c @@ -119,7 +119,7 @@ static int is_cpuid_supported(void) static void kqemu_update_cpuid(CPUState *env) { - int critical_features_mask, features; + int critical_features_mask, features, ext_features, ext_features_mask; uint32_t eax, ebx, ecx, edx; /* the following features are kept identical on the host and @@ -130,11 +130,14 @@ static void kqemu_update_cpuid(CPUState *env) CPUID_CMOV | CPUID_CX8 | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | CPUID_SEP; + ext_features_mask = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR; if (!is_cpuid_supported()) { features = 0; + ext_features = 0; } else { cpuid(1, eax, ebx, ecx, edx); features = edx; + ext_features = ecx; } #ifdef __x86_64__ /* NOTE: on x86_64 CPUs, SYSENTER is not supported in @@ -144,6 +147,8 @@ static void kqemu_update_cpuid(CPUState *env) #endif env->cpuid_features = (env->cpuid_features & ~critical_features_mask) | (features & critical_features_mask); + env->cpuid_ext_features = (env->cpuid_ext_features & ~ext_features_mask) | + (ext_features & ext_features_mask); /* XXX: we could update more of the target CPUID state so that the non accelerated code sees exactly the same CPU features as the accelerated code */