提交 3e98dc8e 编写于 作者: B balrog

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
上级 e6198a70
...@@ -119,6 +119,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) ...@@ -119,6 +119,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
typedef struct x86_def_t { typedef struct x86_def_t {
const char *name; const char *name;
uint32_t level;
uint32_t vendor1, vendor2, vendor3; uint32_t vendor1, vendor2, vendor3;
int family; int family;
int model; int model;
...@@ -135,6 +136,7 @@ static x86_def_t x86_defs[] = { ...@@ -135,6 +136,7 @@ static x86_def_t x86_defs[] = {
#ifdef TARGET_X86_64 #ifdef TARGET_X86_64
{ {
.name = "qemu64", .name = "qemu64",
.level = 2,
.vendor1 = 0x68747541, /* "Auth" */ .vendor1 = 0x68747541, /* "Auth" */
.vendor2 = 0x69746e65, /* "enti" */ .vendor2 = 0x69746e65, /* "enti" */
.vendor3 = 0x444d4163, /* "cAMD" */ .vendor3 = 0x444d4163, /* "cAMD" */
...@@ -155,6 +157,7 @@ static x86_def_t x86_defs[] = { ...@@ -155,6 +157,7 @@ static x86_def_t x86_defs[] = {
#endif #endif
{ {
.name = "qemu32", .name = "qemu32",
.level = 2,
.family = 6, .family = 6,
.model = 3, .model = 3,
.stepping = 3, .stepping = 3,
...@@ -164,6 +167,7 @@ static x86_def_t x86_defs[] = { ...@@ -164,6 +167,7 @@ static x86_def_t x86_defs[] = {
}, },
{ {
.name = "486", .name = "486",
.level = 0,
.family = 4, .family = 4,
.model = 0, .model = 0,
.stepping = 0, .stepping = 0,
...@@ -172,6 +176,7 @@ static x86_def_t x86_defs[] = { ...@@ -172,6 +176,7 @@ static x86_def_t x86_defs[] = {
}, },
{ {
.name = "pentium", .name = "pentium",
.level = 1,
.family = 5, .family = 5,
.model = 4, .model = 4,
.stepping = 3, .stepping = 3,
...@@ -180,6 +185,7 @@ static x86_def_t x86_defs[] = { ...@@ -180,6 +185,7 @@ static x86_def_t x86_defs[] = {
}, },
{ {
.name = "pentium2", .name = "pentium2",
.level = 2,
.family = 6, .family = 6,
.model = 5, .model = 5,
.stepping = 2, .stepping = 2,
...@@ -188,6 +194,7 @@ static x86_def_t x86_defs[] = { ...@@ -188,6 +194,7 @@ static x86_def_t x86_defs[] = {
}, },
{ {
.name = "pentium3", .name = "pentium3",
.level = 2,
.family = 6, .family = 6,
.model = 7, .model = 7,
.stepping = 3, .stepping = 3,
...@@ -306,7 +313,7 @@ static int cpu_x86_register (CPUX86State *env, const char *cpu_model) ...@@ -306,7 +313,7 @@ static int cpu_x86_register (CPUX86State *env, const char *cpu_model)
env->cpuid_vendor2 = 0x49656e69; /* "ineI" */ env->cpuid_vendor2 = 0x49656e69; /* "ineI" */
env->cpuid_vendor3 = 0x6c65746e; /* "ntel" */ 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_version = (def->family << 8) | (def->model << 4) | def->stepping;
env->cpuid_features = def->features; env->cpuid_features = def->features;
env->pat = 0x0007040600070406ULL; env->pat = 0x0007040600070406ULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册