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