Commit 0de6bb73fd213db5a9d703e10c284c5c0321d82e

Authored by bellard
1 parent 3d7374c5

monitor/mwait workaround


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2045 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 1 deletions
@@ -119,7 +119,7 @@ static int is_cpuid_supported(void) @@ -119,7 +119,7 @@ static int is_cpuid_supported(void)
119 119
120 static void kqemu_update_cpuid(CPUState *env) 120 static void kqemu_update_cpuid(CPUState *env)
121 { 121 {
122 - int critical_features_mask, features; 122 + int critical_features_mask, features, ext_features, ext_features_mask;
123 uint32_t eax, ebx, ecx, edx; 123 uint32_t eax, ebx, ecx, edx;
124 124
125 /* the following features are kept identical on the host and 125 /* the following features are kept identical on the host and
@@ -130,11 +130,14 @@ static void kqemu_update_cpuid(CPUState *env) @@ -130,11 +130,14 @@ static void kqemu_update_cpuid(CPUState *env)
130 CPUID_CMOV | CPUID_CX8 | 130 CPUID_CMOV | CPUID_CX8 |
131 CPUID_FXSR | CPUID_MMX | CPUID_SSE | 131 CPUID_FXSR | CPUID_MMX | CPUID_SSE |
132 CPUID_SSE2 | CPUID_SEP; 132 CPUID_SSE2 | CPUID_SEP;
  133 + ext_features_mask = CPUID_EXT_SSE3 | CPUID_EXT_MONITOR;
133 if (!is_cpuid_supported()) { 134 if (!is_cpuid_supported()) {
134 features = 0; 135 features = 0;
  136 + ext_features = 0;
135 } else { 137 } else {
136 cpuid(1, eax, ebx, ecx, edx); 138 cpuid(1, eax, ebx, ecx, edx);
137 features = edx; 139 features = edx;
  140 + ext_features = ecx;
138 } 141 }
139 #ifdef __x86_64__ 142 #ifdef __x86_64__
140 /* NOTE: on x86_64 CPUs, SYSENTER is not supported in 143 /* NOTE: on x86_64 CPUs, SYSENTER is not supported in
@@ -144,6 +147,8 @@ static void kqemu_update_cpuid(CPUState *env) @@ -144,6 +147,8 @@ static void kqemu_update_cpuid(CPUState *env)
144 #endif 147 #endif
145 env->cpuid_features = (env->cpuid_features & ~critical_features_mask) | 148 env->cpuid_features = (env->cpuid_features & ~critical_features_mask) |
146 (features & critical_features_mask); 149 (features & critical_features_mask);
  150 + env->cpuid_ext_features = (env->cpuid_ext_features & ~ext_features_mask) |
  151 + (ext_features & ext_features_mask);
147 /* XXX: we could update more of the target CPUID state so that the 152 /* XXX: we could update more of the target CPUID state so that the
148 non accelerated code sees exactly the same CPU features as the 153 non accelerated code sees exactly the same CPU features as the
149 accelerated code */ 154 accelerated code */