Commit a6f379881e1acae7708ef647f4b9c921ed054ae8
1 parent
f419b321
return model id in cpuid for x86_64
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1374 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
17 additions
and
0 deletions
target-i386/helper2.c
... | ... | @@ -102,15 +102,32 @@ CPUX86State *cpu_x86_init(void) |
102 | 102 | stepping = 3; |
103 | 103 | #endif |
104 | 104 | #endif |
105 | + env->cpuid_level = 2; | |
105 | 106 | env->cpuid_version = (family << 8) | (model << 4) | stepping; |
106 | 107 | env->cpuid_features = (CPUID_FP87 | CPUID_DE | CPUID_PSE | |
107 | 108 | CPUID_TSC | CPUID_MSR | CPUID_MCE | |
108 | 109 | CPUID_CX8 | CPUID_PGE | CPUID_CMOV); |
109 | 110 | env->cpuid_ext_features = 0; |
110 | 111 | env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | CPUID_PAE | CPUID_SEP; |
112 | + env->cpuid_xlevel = 0; | |
113 | + { | |
114 | + const char *model_id = "QEMU Virtual CPU version " QEMU_VERSION; | |
115 | + int c, len, i; | |
116 | + len = strlen(model_id); | |
117 | + for(i = 0; i < 48; i++) { | |
118 | + if (i >= len) | |
119 | + c = '\0'; | |
120 | + else | |
121 | + c = model_id[i]; | |
122 | + env->cpuid_model[i >> 2] |= c << (8 * (i & 3)); | |
123 | + } | |
124 | + } | |
111 | 125 | #ifdef TARGET_X86_64 |
112 | 126 | /* currently not enabled for std i386 because not fully tested */ |
113 | 127 | env->cpuid_features |= CPUID_APIC; |
128 | + env->cpuid_ext2_features = (env->cpuid_features & 0x0183F3FF); | |
129 | + env->cpuid_ext2_features |= CPUID_EXT2_LM | CPUID_EXT2_SYSCALL; | |
130 | + env->cpuid_xlevel = 0x80000008; | |
114 | 131 | #endif |
115 | 132 | } |
116 | 133 | cpu_single_env = env; | ... | ... |