Commit ca0d1734b44a67ca0077c3f5714d901f7489559d

Authored by bellard
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
... ... @@ -119,13 +119,19 @@ static void kqemu_update_cpuid(CPUState *env)
119 119 critical_features_mask =
120 120 CPUID_CMOV | CPUID_CX8 |
121 121 CPUID_FXSR | CPUID_MMX | CPUID_SSE |
122   - CPUID_SSE2;
  122 + CPUID_SSE2 | CPUID_SEP;
123 123 if (!is_cpuid_supported()) {
124 124 features = 0;
125 125 } else {
126 126 cpuid(1, eax, ebx, ecx, edx);
127 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 135 env->cpuid_features = (env->cpuid_features & ~critical_features_mask) |
130 136 (features & critical_features_mask);
131 137 /* XXX: we could update more of the target CPUID state so that the
... ...