Commit 3e98dc8ec6af89c7f4f1e006b979eb405b431629
1 parent
e6198a70
Correct the max cpuid level for each x86 cpu model (Dan Kenigsberg).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3847 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
8 additions
and
1 deletions
target-i386/helper2.c
... | ... | @@ -119,6 +119,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) |
119 | 119 | |
120 | 120 | typedef struct x86_def_t { |
121 | 121 | const char *name; |
122 | + uint32_t level; | |
122 | 123 | uint32_t vendor1, vendor2, vendor3; |
123 | 124 | int family; |
124 | 125 | int model; |
... | ... | @@ -135,6 +136,7 @@ static x86_def_t x86_defs[] = { |
135 | 136 | #ifdef TARGET_X86_64 |
136 | 137 | { |
137 | 138 | .name = "qemu64", |
139 | + .level = 2, | |
138 | 140 | .vendor1 = 0x68747541, /* "Auth" */ |
139 | 141 | .vendor2 = 0x69746e65, /* "enti" */ |
140 | 142 | .vendor3 = 0x444d4163, /* "cAMD" */ |
... | ... | @@ -155,6 +157,7 @@ static x86_def_t x86_defs[] = { |
155 | 157 | #endif |
156 | 158 | { |
157 | 159 | .name = "qemu32", |
160 | + .level = 2, | |
158 | 161 | .family = 6, |
159 | 162 | .model = 3, |
160 | 163 | .stepping = 3, |
... | ... | @@ -164,6 +167,7 @@ static x86_def_t x86_defs[] = { |
164 | 167 | }, |
165 | 168 | { |
166 | 169 | .name = "486", |
170 | + .level = 0, | |
167 | 171 | .family = 4, |
168 | 172 | .model = 0, |
169 | 173 | .stepping = 0, |
... | ... | @@ -172,6 +176,7 @@ static x86_def_t x86_defs[] = { |
172 | 176 | }, |
173 | 177 | { |
174 | 178 | .name = "pentium", |
179 | + .level = 1, | |
175 | 180 | .family = 5, |
176 | 181 | .model = 4, |
177 | 182 | .stepping = 3, |
... | ... | @@ -180,6 +185,7 @@ static x86_def_t x86_defs[] = { |
180 | 185 | }, |
181 | 186 | { |
182 | 187 | .name = "pentium2", |
188 | + .level = 2, | |
183 | 189 | .family = 6, |
184 | 190 | .model = 5, |
185 | 191 | .stepping = 2, |
... | ... | @@ -188,6 +194,7 @@ static x86_def_t x86_defs[] = { |
188 | 194 | }, |
189 | 195 | { |
190 | 196 | .name = "pentium3", |
197 | + .level = 2, | |
191 | 198 | .family = 6, |
192 | 199 | .model = 7, |
193 | 200 | .stepping = 3, |
... | ... | @@ -306,7 +313,7 @@ static int cpu_x86_register (CPUX86State *env, const char *cpu_model) |
306 | 313 | env->cpuid_vendor2 = 0x49656e69; /* "ineI" */ |
307 | 314 | env->cpuid_vendor3 = 0x6c65746e; /* "ntel" */ |
308 | 315 | } |
309 | - env->cpuid_level = 2; | |
316 | + env->cpuid_level = def->level; | |
310 | 317 | env->cpuid_version = (def->family << 8) | (def->model << 4) | def->stepping; |
311 | 318 | env->cpuid_features = def->features; |
312 | 319 | env->pat = 0x0007040600070406ULL; | ... | ... |