* [Qemu-devel] [5664] x86 CPUID extended family/model (Andre Przywara).
@ 2008-11-10 1:05 Andrzej Zaborowski
0 siblings, 0 replies; only message in thread
From: Andrzej Zaborowski @ 2008-11-10 1:05 UTC (permalink / raw)
To: qemu-devel
Revision: 5664
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5664
Author: balrog
Date: 2008-11-10 01:05:01 +0000 (Mon, 10 Nov 2008)
Log Message:
-----------
x86 CPUID extended family/model (Andre Przywara).
x86 CPUs feature extended family/model bits in CPUID leaf
0000_0001|EAX. Refer to page 10 in:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25481.pdf
Those bits are necessary to model newer AMD CPUs:
-cpu qemu64,family=15,model=65,stepping=3 or
-cpu qemu64,family=16,model=4,stepping=2
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Modified Paths:
--------------
trunk/target-i386/helper.c
Modified: trunk/target-i386/helper.c
===================================================================
--- trunk/target-i386/helper.c 2008-11-09 19:52:36 UTC (rev 5663)
+++ trunk/target-i386/helper.c 2008-11-10 01:05:01 UTC (rev 5664)
@@ -337,7 +337,7 @@
} else if (!strcmp(featurestr, "model")) {
char *err;
model = strtol(val, &err, 10);
- if (!*val || *err || model < 0 || model > 0xf) {
+ if (!*val || *err || model < 0 || model > 0xff) {
fprintf(stderr, "bad numerical value %s\n", val);
goto error;
}
@@ -416,7 +416,12 @@
env->cpuid_vendor3 = CPUID_VENDOR_INTEL_3;
}
env->cpuid_level = def->level;
- env->cpuid_version = (def->family << 8) | (def->model << 4) | def->stepping;
+ if (def->family > 0x0f)
+ env->cpuid_version = 0xf00 | ((def->family - 0x0f) << 20);
+ else
+ env->cpuid_version = def->family << 8;
+ env->cpuid_version |= ((def->model & 0xf) << 4) | ((def->model >> 4) << 16);
+ env->cpuid_version |= def->stepping;
env->cpuid_features = def->features;
env->pat = 0x0007040600070406ULL;
env->cpuid_ext_features = def->ext_features;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-11-10 1:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-10 1:05 [Qemu-devel] [5664] x86 CPUID extended family/model (Andre Przywara) Andrzej Zaborowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).