aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-24 14:04:06 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-24 14:04:06 +0000
commit3e98dc8ec6af89c7f4f1e006b979eb405b431629 (patch)
tree2ede11eb4b3c0597b32c1d239dc38835593f2f07 /target-i386
parentAvoid the use of $ in format strings because it's system-specific - fixes dri... (diff)
downloadqemu-kvm-3e98dc8ec6af89c7f4f1e006b979eb405b431629.tar.gz
qemu-kvm-3e98dc8ec6af89c7f4f1e006b979eb405b431629.tar.bz2
qemu-kvm-3e98dc8ec6af89c7f4f1e006b979eb405b431629.zip
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
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/helper2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/target-i386/helper2.c b/target-i386/helper2.c
index 4916d1f5f..551a0d8b9 100644
--- a/target-i386/helper2.c
+++ b/target-i386/helper2.c
@@ -119,6 +119,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
typedef struct x86_def_t {
const char *name;
+ uint32_t level;
uint32_t vendor1, vendor2, vendor3;
int family;
int model;
@@ -135,6 +136,7 @@ static x86_def_t x86_defs[] = {
#ifdef TARGET_X86_64
{
.name = "qemu64",
+ .level = 2,
.vendor1 = 0x68747541, /* "Auth" */
.vendor2 = 0x69746e65, /* "enti" */
.vendor3 = 0x444d4163, /* "cAMD" */
@@ -155,6 +157,7 @@ static x86_def_t x86_defs[] = {
#endif
{
.name = "qemu32",
+ .level = 2,
.family = 6,
.model = 3,
.stepping = 3,
@@ -164,6 +167,7 @@ static x86_def_t x86_defs[] = {
},
{
.name = "486",
+ .level = 0,
.family = 4,
.model = 0,
.stepping = 0,
@@ -172,6 +176,7 @@ static x86_def_t x86_defs[] = {
},
{
.name = "pentium",
+ .level = 1,
.family = 5,
.model = 4,
.stepping = 3,
@@ -180,6 +185,7 @@ static x86_def_t x86_defs[] = {
},
{
.name = "pentium2",
+ .level = 2,
.family = 6,
.model = 5,
.stepping = 2,
@@ -188,6 +194,7 @@ static x86_def_t x86_defs[] = {
},
{
.name = "pentium3",
+ .level = 2,
.family = 6,
.model = 7,
.stepping = 3,
@@ -306,7 +313,7 @@ static int cpu_x86_register (CPUX86State *env, const char *cpu_model)
env->cpuid_vendor2 = 0x49656e69; /* "ineI" */
env->cpuid_vendor3 = 0x6c65746e; /* "ntel" */
}
- env->cpuid_level = 2;
+ env->cpuid_level = def->level;
env->cpuid_version = (def->family << 8) | (def->model << 4) | def->stepping;
env->cpuid_features = def->features;
env->pat = 0x0007040600070406ULL;