Commit ca0d1734b44a67ca0077c3f5714d901f7489559d
1 parent
aa0bc6b6
SYSENTER fix for x86_64 CPUs
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1565 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
7 additions
and
1 deletions
kqemu.c
| @@ -119,13 +119,19 @@ static void kqemu_update_cpuid(CPUState *env) | @@ -119,13 +119,19 @@ static void kqemu_update_cpuid(CPUState *env) | ||
| 119 | critical_features_mask = | 119 | critical_features_mask = |
| 120 | CPUID_CMOV | CPUID_CX8 | | 120 | CPUID_CMOV | CPUID_CX8 | |
| 121 | CPUID_FXSR | CPUID_MMX | CPUID_SSE | | 121 | CPUID_FXSR | CPUID_MMX | CPUID_SSE | |
| 122 | - CPUID_SSE2; | 122 | + CPUID_SSE2 | CPUID_SEP; |
| 123 | if (!is_cpuid_supported()) { | 123 | if (!is_cpuid_supported()) { |
| 124 | features = 0; | 124 | features = 0; |
| 125 | } else { | 125 | } else { |
| 126 | cpuid(1, eax, ebx, ecx, edx); | 126 | cpuid(1, eax, ebx, ecx, edx); |
| 127 | features = edx; | 127 | features = edx; |
| 128 | } | 128 | } |
| 129 | +#ifdef __x86_64__ | ||
| 130 | + /* NOTE: on x86_64 CPUs, SYSENTER is not supported in | ||
| 131 | + compatibility mode, so in order to have the best performances | ||
| 132 | + it is better not to use it */ | ||
| 133 | + features &= ~CPUID_SEP; | ||
| 134 | +#endif | ||
| 129 | env->cpuid_features = (env->cpuid_features & ~critical_features_mask) | | 135 | env->cpuid_features = (env->cpuid_features & ~critical_features_mask) | |
| 130 | (features & critical_features_mask); | 136 | (features & critical_features_mask); |
| 131 | /* XXX: we could update more of the target CPUID state so that the | 137 | /* XXX: we could update more of the target CPUID state so that the |