Patchwork x86: Show model_id in CPU list.

login
register
mail settings
Submitter Nathan Baum
Date Sept. 28, 2009, 12:26 a.m.
Message ID <1254097584.7387.12.camel@athens.parenthephobia.org.uk>
Download mbox | patch
Permalink /patch/34359/
State Superseded
Headers show

Comments

Nathan Baum - Sept. 28, 2009, 12:26 a.m.
Shows the model_id in the CPU list:

$ qemu-system-x86_64 -cpu ?
x86           qemu64  QEMU Virtual CPU version 0.11.50
x86           phenom  AMD Phenom(tm) 9550 Quad-Core Processor
x86         core2duo  Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz
x86            kvm64  Common KVM processor
x86           qemu32  QEMU Virtual CPU version 0.11.50
x86          coreduo  Genuine Intel(R) CPU           T2600  @ 2.16GHz
x86              486 
x86          pentium 
x86         pentium2 
x86         pentium3 
x86           athlon  QEMU Virtual CPU version 0.11.50
x86             n270  Intel(R) Atom(TM) CPU N270   @ 1.60GHz

No particular reason for it; just thought it could be considered useful.

As an aside, is it intentional that "athlon"'s model_id describes it as
a generic Qemu CPU?

Signed-off-by: Nathan Baum <nathan@parenthephobia.org.uk>
---
 static int cpu_x86_register (CPUX86State *env, const char *cpu_model)
Andre Przywara - Sept. 28, 2009, 11:10 a.m.
Nathan Baum wrote:
> Shows the model_id in the CPU list:
> $ qemu-system-x86_64 -cpu ?
> x86           qemu64  QEMU Virtual CPU version 0.11.50
> x86           phenom  AMD Phenom(tm) 9550 Quad-Core Processor
> x86         core2duo  Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz
> x86            kvm64  Common KVM processor
> x86           qemu32  QEMU Virtual CPU version 0.11.50
> x86          coreduo  Genuine Intel(R) CPU           T2600  @ 2.16GHz
> x86              486 
> x86          pentium 
> x86         pentium2 
> x86         pentium3 
> x86           athlon  QEMU Virtual CPU version 0.11.50
> x86             n270  Intel(R) Atom(TM) CPU N270   @ 1.60GHz
> 
> No particular reason for it; just thought it could be considered useful.
> 
> As an aside, is it intentional that "athlon"'s model_id describes it as
> a generic Qemu CPU?
I fixed that already in the CPUID rework patch series I sent out 10 days 
ago:
http://lists.gnu.org/archive/html/qemu-devel/2009-09/msg01236.html

Anthony's staging tree (http://repo.or.cz/w/qemu/aliguori-queue.git) has 
been pretty stale for the last 2 weeks, so if my patch series should be 
applied before your patch, you have to rework your's (should be almost 
trivial, see patch 08/21).

Regards,
Andre.

Patch

diff --git a/target-i386/helper.c b/target-i386/helper.c
index 8111f25..57eed1a 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -495,8 +495,14 @@  void x86_cpu_list (FILE *f, int (*cpu_fprintf)(FILE
*f, const char *fmt, ...))
 {
     unsigned int i;
 
-    for (i = 0; i < ARRAY_SIZE(x86_defs); i++)
-        (*cpu_fprintf)(f, "x86 %16s\n", x86_defs[i].name);
+    for (i = 0; i < ARRAY_SIZE(x86_defs); i++) {
+       if (x86_defs[i].model_id) {
+           (*cpu_fprintf)(f, "x86 %16s  %s\n", x86_defs[i].name,
+                          x86_defs[i].model_id);
+       } else {
+           (*cpu_fprintf)(f, "x86 %16s\n", x86_defs[i].name);
+       }
+    }
 }