Revision 0de6bb73
b/kqemu.c | ||
---|---|---|
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 | 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 | 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 */ |
Also available in: Unified diff