Skip to contentSkip to conversation

x86 CPU patches that didn't get into 1.2

PATCH In review Eduardo Habkost 4 participants 29 messages Sep 5, 2012 – Sep 17, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

cover x86 CPU patches that didn't get into 1.2

Hi,

This is a small queue of patches that I consider "ready to go", that didn't enter QEMU 1.2.

Eduardo Habkost (5):
i386: add missing CPUID_* constants
move CPU models from cpus-x86_64.conf to C
eliminate cpus-x86_64.conf file
x86_cpudef_setup: coding style change
i386: kill cpudef config section support

Peter Maydell (2):
target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop
?dump
Drop cpu_list_id macro

 Makefile                           |   1 -
 arch_init.c                        |   1 -
 cpus.c                             |   6 +-
 linux-user/main.c                  |   6 +-
 sysconfigs/target/cpus-x86_64.conf | 128 ------------
 target-i386/cpu.c                  | 399 ++++++++++++++++++++++---------------
 target-i386/cpu.h                  |  26 ++-
 7 files changed, 269 insertions(+), 298 deletions(-)
 delete mode 100644 sysconfigs/target/cpus-x86_64.conf
Signature · 1 line
1.7.11.4
#1 lore raw

PATCH 1/7 target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump

From: Peter Maydell <[email protected]>

Commit c8057f95 (accidentally) disabled the ability to pass option strings starting with '?' to the target-specific cpu_list function, so the target-i386 specific "-cpu ?dump", "-cpu ?cpuid" and "-cpu ?model" stopped working.

Since these options are undocumented and not used by libvirt, simply drop them completely rather than reinstating them with new style syntax. Instead, we fold the ?model and ?cpuid output into the output of the plain "-cpu help" output. The detailed output produced by ?dump is dropped.

---
 target-i386/cpu.c | 64 ++++++++++---------------------------------------------
 1 file changed, 11 insertions(+), 53 deletions(-)
target-i386/cpu.c +11 -53
index 423e009..5c98064 100644
@@ -1073,70 +1073,28 @@ static void listflags(char *buf, int bufsize, uint32_t fbits,
         }
 }
 
-/* generate CPU information:
- * -?        list model names
- * -?model   list model names/IDs
- * -?dump    output all model (x86_def_t) data
- * -?cpuid   list all recognized cpuid flag names
- */
+/* generate CPU information */
 void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
 {
-    unsigned char model = !strcmp("?model", optarg);
-    unsigned char dump = !strcmp("?dump", optarg);
-    unsigned char cpuid = !strcmp("?cpuid", optarg);
     x86_def_t *def;
     char buf[256];
 
-    if (cpuid) {
-        (*cpu_fprintf)(f, "Recognized CPUID flags:\n");
-        listflags(buf, sizeof (buf), (uint32_t)~0, feature_name, 1);
-        (*cpu_fprintf)(f, "  f_edx: %s\n", buf);
-        listflags(buf, sizeof (buf), (uint32_t)~0, ext_feature_name, 1);
-        (*cpu_fprintf)(f, "  f_ecx: %s\n", buf);
-        listflags(buf, sizeof (buf), (uint32_t)~0, ext2_feature_name, 1);
-        (*cpu_fprintf)(f, "  extf_edx: %s\n", buf);
-        listflags(buf, sizeof (buf), (uint32_t)~0, ext3_feature_name, 1);
-        (*cpu_fprintf)(f, "  extf_ecx: %s\n", buf);
-        return;
-    }
     for (def = x86_defs; def; def = def->next) {
         snprintf(buf, sizeof (buf), def->flags ? "[%s]": "%s", def->name);
-        if (model || dump) {
-            (*cpu_fprintf)(f, "x86 %16s  %-48s\n", buf, def->model_id);
-        } else {
-            (*cpu_fprintf)(f, "x86 %16s\n", buf);
-        }
-        if (dump) {
-            memcpy(buf, &def->vendor1, sizeof (def->vendor1));
-            memcpy(buf + 4, &def->vendor2, sizeof (def->vendor2));
-            memcpy(buf + 8, &def->vendor3, sizeof (def->vendor3));
-            buf[12] = '\0';
-            (*cpu_fprintf)(f,
-                "  family %d model %d stepping %d level %d xlevel 0x%x"
-                " vendor \"%s\"\n",
-                def->family, def->model, def->stepping, def->level,
-                def->xlevel, buf);
-            listflags(buf, sizeof (buf), def->features, feature_name, 0);
-            (*cpu_fprintf)(f, "  feature_edx %08x (%s)\n", def->features,
-                buf);
-            listflags(buf, sizeof (buf), def->ext_features, ext_feature_name,
-                0);
-            (*cpu_fprintf)(f, "  feature_ecx %08x (%s)\n", def->ext_features,
-                buf);
-            listflags(buf, sizeof (buf), def->ext2_features, ext2_feature_name,
-                0);
-            (*cpu_fprintf)(f, "  extfeature_edx %08x (%s)\n",
-                def->ext2_features, buf);
-            listflags(buf, sizeof (buf), def->ext3_features, ext3_feature_name,
-                0);
-            (*cpu_fprintf)(f, "  extfeature_ecx %08x (%s)\n",
-                def->ext3_features, buf);
-            (*cpu_fprintf)(f, "\n");
-        }
+        (*cpu_fprintf)(f, "x86 %16s  %-48s\n", buf, def->model_id);
     }
     if (kvm_enabled()) {
         (*cpu_fprintf)(f, "x86 %16s\n", "[host]");
     }
+    (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n");
+    listflags(buf, sizeof(buf), (uint32_t)~0, feature_name, 1);
+    (*cpu_fprintf)(f, "  f_edx: %s\n", buf);
+    listflags(buf, sizeof(buf), (uint32_t)~0, ext_feature_name, 1);
+    (*cpu_fprintf)(f, "  f_ecx: %s\n", buf);
+    listflags(buf, sizeof(buf), (uint32_t)~0, ext2_feature_name, 1);
+    (*cpu_fprintf)(f, "  extf_edx: %s\n", buf);
+    listflags(buf, sizeof(buf), (uint32_t)~0, ext3_feature_name, 1);
+    (*cpu_fprintf)(f, "  extf_ecx: %s\n", buf);
 }
 
 CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
Signature · 1 line
1.7.11.4
Reviewed-by on v1 1/7
#2 lore raw

Re: [Qemu-devel] [PATCH 1/7] target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop ?dump

Quoted 101 lines · On Wed, 5 Sep 2012 17:41:07 -0300 Eduardo Habkost <[email protected]> wrote:

From: Peter Maydell <[email protected]>

Commit c8057f95 (accidentally) disabled the ability to pass option strings starting with '?' to the target-specific cpu_list function, so the target-i386 specific "-cpu ?dump", "-cpu ?cpuid" and "-cpu ?model" stopped working.

Since these options are undocumented and not used by libvirt, simply drop them completely rather than reinstating them with new style syntax. Instead, we fold the ?model and ?cpuid output into the output of the plain "-cpu help" output. The detailed output produced by ?dump is dropped.

---
 target-i386/cpu.c | 64

++++++++++--------------------------------------------- 1 file changed, 11 insertions(+), 53 deletions(-)

target-i386/cpu.c +4 -53
index 423e009..5c98064 100644
@@ -1073,70 +1073,28 @@ static void listflags(char *buf, int bufsize,
 uint32_t fbits, }
 }
 
-/* generate CPU information:
- * -?        list model names
- * -?model   list model names/IDs
- * -?dump    output all model (x86_def_t) data
- * -?cpuid   list all recognized cpuid flag names
- */
+/* generate CPU information */
 void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char
 *optarg) {
-    unsigned char model = !strcmp("?model", optarg);
-    unsigned char dump = !strcmp("?dump", optarg);
-    unsigned char cpuid = !strcmp("?cpuid", optarg);
     x86_def_t *def;
     char buf[256];
 
-    if (cpuid) {
-        (*cpu_fprintf)(f, "Recognized CPUID flags:\n");
-        listflags(buf, sizeof (buf), (uint32_t)~0, feature_name, 1);
-        (*cpu_fprintf)(f, "  f_edx: %s\n", buf);
-        listflags(buf, sizeof (buf), (uint32_t)~0, ext_feature_name, 1);
-        (*cpu_fprintf)(f, "  f_ecx: %s\n", buf);
-        listflags(buf, sizeof (buf), (uint32_t)~0, ext2_feature_name, 1);
-        (*cpu_fprintf)(f, "  extf_edx: %s\n", buf);
-        listflags(buf, sizeof (buf), (uint32_t)~0, ext3_feature_name, 1);
-        (*cpu_fprintf)(f, "  extf_ecx: %s\n", buf);
-        return;
-    }
     for (def = x86_defs; def; def = def->next) {
         snprintf(buf, sizeof (buf), def->flags ? "[%s]": "%s", def->name);
-        if (model || dump) {
-            (*cpu_fprintf)(f, "x86 %16s  %-48s\n", buf, def->model_id);
-        } else {
-            (*cpu_fprintf)(f, "x86 %16s\n", buf);
-        }
-        if (dump) {
-            memcpy(buf, &def->vendor1, sizeof (def->vendor1));
-            memcpy(buf + 4, &def->vendor2, sizeof (def->vendor2));
-            memcpy(buf + 8, &def->vendor3, sizeof (def->vendor3));
-            buf[12] = '\0';
-            (*cpu_fprintf)(f,
-                "  family %d model %d stepping %d level %d xlevel 0x%x"
-                " vendor \"%s\"\n",
-                def->family, def->model, def->stepping, def->level,
-                def->xlevel, buf);
-            listflags(buf, sizeof (buf), def->features, feature_name, 0);
-            (*cpu_fprintf)(f, "  feature_edx %08x (%s)\n", def->features,
-                buf);
-            listflags(buf, sizeof (buf), def->ext_features,
 ext_feature_name,
-                0);
-            (*cpu_fprintf)(f, "  feature_ecx %08x (%s)\n",
 def->ext_features,
-                buf);
-            listflags(buf, sizeof (buf), def->ext2_features,
 ext2_feature_name,
-                0);
-            (*cpu_fprintf)(f, "  extfeature_edx %08x (%s)\n",
-                def->ext2_features, buf);
-            listflags(buf, sizeof (buf), def->ext3_features,
 ext3_feature_name,
-                0);
-            (*cpu_fprintf)(f, "  extfeature_ecx %08x (%s)\n",
-                def->ext3_features, buf);
-            (*cpu_fprintf)(f, "\n");
-        }
+        (*cpu_fprintf)(f, "x86 %16s  %-48s\n", buf, def->model_id);
     }
     if (kvm_enabled()) {
         (*cpu_fprintf)(f, "x86 %16s\n", "[host]");
     }
+    (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n");
+    listflags(buf, sizeof(buf), (uint32_t)~0, feature_name, 1);

target-i386/cpu.c static void listflags(char *buf, int bufsize, · line 1100

Quoted 10 lines
target-i386/cpu.c +7 -0
+    (*cpu_fprintf)(f, "  f_edx: %s\n", buf);
+    listflags(buf, sizeof(buf), (uint32_t)~0, ext_feature_name, 1);
+    (*cpu_fprintf)(f, "  f_ecx: %s\n", buf);
+    listflags(buf, sizeof(buf), (uint32_t)~0, ext2_feature_name, 1);
+    (*cpu_fprintf)(f, "  extf_edx: %s\n", buf);
+    listflags(buf, sizeof(buf), (uint32_t)~0, ext3_feature_name, 1);
+    (*cpu_fprintf)(f, "  extf_ecx: %s\n", buf);
 }
 
 CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
#3 lore raw

PATCH 2/7 Drop cpu_list_id macro

In reply to Eduardo Habkost

From: Peter Maydell <[email protected]>

Since the only user of the extended cpu_list_id() format was the x86 ?model/?dump/?cpuid output, we can drop it completely.

---
 cpus.c            | 6 ++----
 linux-user/main.c | 6 ++----
 target-i386/cpu.c | 4 ++--
 target-i386/cpu.h | 4 ++--
 4 files changed, 8 insertions(+), 12 deletions(-)
cpus.c +2 -4
index e476a3c..4b726ef 100644
@@ -1192,10 +1192,8 @@ void set_cpu_log_filename(const char *optarg)
 void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
 {
     /* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list_id)
-    cpu_list_id(f, cpu_fprintf, optarg);
-#elif defined(cpu_list)
-    cpu_list(f, cpu_fprintf); /* deprecated */
+#if defined(cpu_list)
+    cpu_list(f, cpu_fprintf);
 #endif
 }
 
linux-user/main.c +2 -4
index 1a1c661..6e66e5d 100644
@@ -3143,10 +3143,8 @@ static void handle_arg_cpu(const char *arg)
     cpu_model = strdup(arg);
     if (cpu_model == NULL || is_help_option(cpu_model)) {
         /* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list_id)
-        cpu_list_id(stdout, &fprintf, "");
-#elif defined(cpu_list)
-        cpu_list(stdout, &fprintf); /* deprecated */
+#if defined(cpu_list)
+        cpu_list(stdout, &fprintf);
 #endif
         exit(1);
     }
target-i386/cpu.c +2 -2
index 5c98064..d2af0ff 100644
@@ -1073,8 +1073,8 @@ static void listflags(char *buf, int bufsize, uint32_t fbits,
         }
 }
 
-/* generate CPU information */
-void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
+/* generate CPU information. */
+void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
 {
     x86_def_t *def;
     char buf[256];
target-i386/cpu.h +2 -2
index 0677502..49e0259 100644
@@ -792,7 +792,7 @@ typedef struct CPUX86State {
 
 X86CPU *cpu_x86_init(const char *cpu_model);
 int cpu_x86_exec(CPUX86State *s);
-void x86_cpu_list (FILE *f, fprintf_function cpu_fprintf, const char *optarg);
+void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 void x86_cpudef_setup(void);
 int cpu_x86_support_mca_broadcast(CPUX86State *env);
 
@@ -976,7 +976,7 @@ static inline CPUX86State *cpu_init(const char *cpu_model)
 #define cpu_exec cpu_x86_exec
 #define cpu_gen_code cpu_x86_gen_code
 #define cpu_signal_handler cpu_x86_signal_handler
-#define cpu_list_id x86_cpu_list
+#define cpu_list x86_cpu_list
 #define cpudef_setup	x86_cpudef_setup
 
 #define CPU_SAVE_VERSION 12
Signature · 1 line
1.7.11.4
Reviewed-by on v1 2/7
#4 lore raw

Re: [Qemu-devel] [PATCH 2/7] Drop cpu_list_id macro

Quoted 79 lines · On Wed, 5 Sep 2012 17:41:08 -0300 Eduardo Habkost <[email protected]> wrote:

From: Peter Maydell <[email protected]>

Since the only user of the extended cpu_list_id() format was the x86 ?model/?dump/?cpuid output, we can drop it completely.

---
 cpus.c            | 6 ++----
 linux-user/main.c | 6 ++----
 target-i386/cpu.c | 4 ++--
 target-i386/cpu.h | 4 ++--
 4 files changed, 8 insertions(+), 12 deletions(-)
cpus.c +2 -4
index e476a3c..4b726ef 100644
@@ -1192,10 +1192,8 @@ void set_cpu_log_filename(const char *optarg)
 void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
 {
     /* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list_id)
-    cpu_list_id(f, cpu_fprintf, optarg);
-#elif defined(cpu_list)
-    cpu_list(f, cpu_fprintf); /* deprecated */
+#if defined(cpu_list)
+    cpu_list(f, cpu_fprintf);
 #endif
 }
 
linux-user/main.c +2 -4
index 1a1c661..6e66e5d 100644
@@ -3143,10 +3143,8 @@ static void handle_arg_cpu(const char *arg)
     cpu_model = strdup(arg);
     if (cpu_model == NULL || is_help_option(cpu_model)) {
         /* XXX: implement xxx_cpu_list for targets that still miss it */
-#if defined(cpu_list_id)
-        cpu_list_id(stdout, &fprintf, "");
-#elif defined(cpu_list)
-        cpu_list(stdout, &fprintf); /* deprecated */
+#if defined(cpu_list)
+        cpu_list(stdout, &fprintf);
 #endif
         exit(1);
     }
target-i386/cpu.c +1 -2
index 5c98064..d2af0ff 100644
@@ -1073,8 +1073,8 @@ static void listflags(char *buf, int bufsize,
 uint32_t fbits, }
 }
 
-/* generate CPU information */
-void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char
 *optarg) +/* generate CPU information. */
+void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
 {
     x86_def_t *def;
     char buf[256];
target-i386/cpu.h +0 -1
index 0677502..49e0259 100644
@@ -792,7 +792,7 @@ typedef struct CPUX86State {
 
 X86CPU *cpu_x86_init(const char *cpu_model);
 int cpu_x86_exec(CPUX86State *s);
-void x86_cpu_list (FILE *f, fprintf_function cpu_fprintf, const char
 *optarg); +void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 void x86_cpudef_setup(void);
 int cpu_x86_support_mca_broadcast(CPUX86State *env);

target-i386/cpu.h static inline CPUX86State *cpu_init(const char · line 982

Quoted 8 lines
target-i386/cpu.h +1 -1
@@ -976,7 +976,7 @@ static inline CPUX86State *cpu_init(const char
 *cpu_model) #define cpu_exec cpu_x86_exec
 #define cpu_gen_code cpu_x86_gen_code
 #define cpu_signal_handler cpu_x86_signal_handler
-#define cpu_list_id x86_cpu_list
+#define cpu_list x86_cpu_list
 #define cpudef_setup	x86_cpudef_setup
 
 #define CPU_SAVE_VERSION 12
#5 lore raw

PATCH 3/7 i386: add missing CPUID_* constants

In reply to Eduardo Habkost

Those constants will be used by new CPU model definitions.

---
 target-i386/cpu.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
target-i386/cpu.h +22 -0
index 49e0259..d7ea2f9 100644
@@ -382,6 +382,7 @@
 #define CPUID_PBE (1 << 31)
 
 #define CPUID_EXT_SSE3     (1 << 0)
+#define CPUID_EXT_PCLMULQDQ (1 << 1)
 #define CPUID_EXT_DTES64   (1 << 2)
 #define CPUID_EXT_MONITOR  (1 << 3)
 #define CPUID_EXT_DSCPL    (1 << 4)
@@ -401,14 +402,33 @@
 #define CPUID_EXT_MOVBE    (1 << 22)
 #define CPUID_EXT_POPCNT   (1 << 23)
 #define CPUID_EXT_TSC_DEADLINE_TIMER (1 << 24)
+#define CPUID_EXT_AES      (1 << 25)
 #define CPUID_EXT_XSAVE    (1 << 26)
 #define CPUID_EXT_OSXSAVE  (1 << 27)
+#define CPUID_EXT_AVX      (1 << 28)
 #define CPUID_EXT_HYPERVISOR  (1 << 31)
 
+#define CPUID_EXT2_FPU     (1 << 0)
+#define CPUID_EXT2_DE      (1 << 2)
+#define CPUID_EXT2_PSE     (1 << 3)
+#define CPUID_EXT2_TSC     (1 << 4)
+#define CPUID_EXT2_MSR     (1 << 5)
+#define CPUID_EXT2_PAE     (1 << 6)
+#define CPUID_EXT2_MCE     (1 << 7)
+#define CPUID_EXT2_CX8     (1 << 8)
+#define CPUID_EXT2_APIC    (1 << 9)
 #define CPUID_EXT2_SYSCALL (1 << 11)
+#define CPUID_EXT2_MTRR    (1 << 12)
+#define CPUID_EXT2_PGE     (1 << 13)
+#define CPUID_EXT2_MCA     (1 << 14)
+#define CPUID_EXT2_CMOV    (1 << 15)
+#define CPUID_EXT2_PAT     (1 << 16)
+#define CPUID_EXT2_PSE36   (1 << 17)
 #define CPUID_EXT2_MP      (1 << 19)
 #define CPUID_EXT2_NX      (1 << 20)
 #define CPUID_EXT2_MMXEXT  (1 << 22)
+#define CPUID_EXT2_MMX     (1 << 23)
+#define CPUID_EXT2_FXSR    (1 << 24)
 #define CPUID_EXT2_FFXSR   (1 << 25)
 #define CPUID_EXT2_PDPE1GB (1 << 26)
 #define CPUID_EXT2_RDTSCP  (1 << 27)
@@ -427,7 +447,9 @@
 #define CPUID_EXT3_3DNOWPREFETCH (1 << 8)
 #define CPUID_EXT3_OSVW    (1 << 9)
 #define CPUID_EXT3_IBS     (1 << 10)
+#define CPUID_EXT3_XOP     (1 << 11)
 #define CPUID_EXT3_SKINIT  (1 << 12)
+#define CPUID_EXT3_FMA4    (1 << 16)
 
 #define CPUID_SVM_NPT          (1 << 0)
 #define CPUID_SVM_LBRV         (1 << 1)
Signature · 1 line
1.7.11.4
Reviewed-by on v1 3/7
#6 lore raw

Re: [Qemu-devel] [PATCH 3/7] i386: add missing CPUID_* constants

Quoted 54 lines · On Wed, 5 Sep 2012 17:41:09 -0300 Eduardo Habkost <[email protected]> wrote:

Those constants will be used by new CPU model definitions.

---
 target-i386/cpu.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
target-i386/cpu.h +20 -0
index 49e0259..d7ea2f9 100644
@@ -382,6 +382,7 @@
 #define CPUID_PBE (1 << 31)
 
 #define CPUID_EXT_SSE3     (1 << 0)
+#define CPUID_EXT_PCLMULQDQ (1 << 1)
 #define CPUID_EXT_DTES64   (1 << 2)
 #define CPUID_EXT_MONITOR  (1 << 3)
 #define CPUID_EXT_DSCPL    (1 << 4)
@@ -401,14 +402,33 @@
 #define CPUID_EXT_MOVBE    (1 << 22)
 #define CPUID_EXT_POPCNT   (1 << 23)
 #define CPUID_EXT_TSC_DEADLINE_TIMER (1 << 24)
+#define CPUID_EXT_AES      (1 << 25)
 #define CPUID_EXT_XSAVE    (1 << 26)
 #define CPUID_EXT_OSXSAVE  (1 << 27)
+#define CPUID_EXT_AVX      (1 << 28)
 #define CPUID_EXT_HYPERVISOR  (1 << 31)
 
+#define CPUID_EXT2_FPU     (1 << 0)
+#define CPUID_EXT2_DE      (1 << 2)
+#define CPUID_EXT2_PSE     (1 << 3)
+#define CPUID_EXT2_TSC     (1 << 4)
+#define CPUID_EXT2_MSR     (1 << 5)
+#define CPUID_EXT2_PAE     (1 << 6)
+#define CPUID_EXT2_MCE     (1 << 7)
+#define CPUID_EXT2_CX8     (1 << 8)
+#define CPUID_EXT2_APIC    (1 << 9)
 #define CPUID_EXT2_SYSCALL (1 << 11)
+#define CPUID_EXT2_MTRR    (1 << 12)
+#define CPUID_EXT2_PGE     (1 << 13)
+#define CPUID_EXT2_MCA     (1 << 14)
+#define CPUID_EXT2_CMOV    (1 << 15)
+#define CPUID_EXT2_PAT     (1 << 16)
+#define CPUID_EXT2_PSE36   (1 << 17)
 #define CPUID_EXT2_MP      (1 << 19)
 #define CPUID_EXT2_NX      (1 << 20)
 #define CPUID_EXT2_MMXEXT  (1 << 22)
+#define CPUID_EXT2_MMX     (1 << 23)
+#define CPUID_EXT2_FXSR    (1 << 24)
 #define CPUID_EXT2_FFXSR   (1 << 25)
 #define CPUID_EXT2_PDPE1GB (1 << 26)
 #define CPUID_EXT2_RDTSCP  (1 << 27)

target-i386/cpu.h line 455

Quoted 9 lines
target-i386/cpu.h +2 -0
@@ -427,7 +447,9 @@
 #define CPUID_EXT3_3DNOWPREFETCH (1 << 8)
 #define CPUID_EXT3_OSVW    (1 << 9)
 #define CPUID_EXT3_IBS     (1 << 10)
+#define CPUID_EXT3_XOP     (1 << 11)
 #define CPUID_EXT3_SKINIT  (1 << 12)
+#define CPUID_EXT3_FMA4    (1 << 16)
 
 #define CPUID_SVM_NPT          (1 << 0)
 #define CPUID_SVM_LBRV         (1 << 1)
#7 lore raw

PATCH 4/7 move CPU models from cpus-x86_64.conf to C

In reply to Eduardo Habkost

Those models are maintained by QEMU and may require compatibility code to be added when making some changes. Keeping the data in the C source code should make it simpler to handle those details.

---
 sysconfigs/target/cpus-x86_64.conf | 129 +---------------------
 target-i386/cpu.c                  | 219 +++++++++++++++++++++++++++++++++++++
 2 files changed, 220 insertions(+), 128 deletions(-)
sysconfigs/target/cpus-x86_64.conf +1 -128
index cee0ea9..3902189 100644
@@ -1,128 +1 @@
-# x86 CPU MODELS
-
-[cpudef]
-   name = "Conroe"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)"
-
-[cpudef]
-   name = "Penryn"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)"
-
-[cpudef]
-   name = "Nehalem"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "popcnt sse4.2 sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 syscall xd"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Core i7 9xx (Nehalem Class Core i7)"
-
-[cpudef]
-   name = "Westmere"
-   level = "11"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "44"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "aes popcnt sse4.2 sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 syscall xd"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)"
-
-[cpudef]
-   name = "SandyBridge"
-   level = "0xd"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "42"
-   stepping = "1"
-   feature_edx = " sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "avx xsave aes tsc-deadline popcnt x2apic sse4.2 sse4.1 cx16 ssse3 pclmulqdq sse3"
-   extfeature_edx = "i64 rdtscp nx syscall "
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Xeon E312xx (Sandy Bridge)"
-
-[cpudef]
-   name = "Opteron_G1"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "sse3"
-   extfeature_edx = "lm fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
-   extfeature_ecx = " "
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 240 (Gen 1 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G2"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "cx16 sse3"
-   extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
-   extfeature_ecx = "svm lahf_lm"
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G3"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "popcnt cx16 monitor sse3"
-   extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
-   extfeature_ecx = "misalignsse sse4a abm svm lahf_lm"
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G4"
-   level = "0xd"
-   vendor = "AuthenticAMD"
-   family = "21"
-   model = "1"
-   stepping = "2"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de fpu"
-   feature_ecx = "avx xsave aes popcnt sse4.2 sse4.1 cx16 ssse3 pclmulqdq sse3"
-   extfeature_edx = "lm rdtscp pdpe1gb fxsr mmx nx pse36 pat cmov mca pge mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
-   extfeature_ecx = " fma4 xop 3dnowprefetch misalignsse sse4a abm svm lahf_lm"
-   xlevel = "0x8000001A"
-   model_id = "AMD Opteron 62xx class CPU"
-
+# The CPU models from this file are now built-in in the QEMU source code
target-i386/cpu.c +219 -0

225 lines not on this page · raw message

Signature · 1 line
1.7.11.4
#8 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

Quoted 29 lines · On Wed, 5 Sep 2012 17:41:10 -0300 Eduardo Habkost <[email protected]> wrote:

Those models are maintained by QEMU and may require compatibility code to be added when making some changes. Keeping the data in the C source code should make it simpler to handle those details.

---
 sysconfigs/target/cpus-x86_64.conf | 129 +---------------------
 target-i386/cpu.c                  | 219

+++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 128 deletions(-)

(quoted diff) +0 -0

b/sysconfigs/target/cpus-x86_64.conf index cee0ea9..3902189 100644

sysconfigs/target/cpus-x86_64.conf +0 -10
@@ -1,128 +1 @@
-# x86 CPU MODELS
-
-[cpudef]
-   name = "Conroe"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"

...

Quoted 2 lines

+ .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |
CPUID_EXT2_SYSCALL,

Silent fix, replacing i64 with CPUID_EXT2_LM
looks like "i64" is mistake and never worked. In Intel & AMD cpuid guides 01.EDX[30] is reserved and what was probably meant/intended here is to use 80000001h.EDX[29] /* CPUID_EXT2_LM */
Perhaps patch that fixes it ought to go before this one.

#9 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

Quoted 33 lines · On Mon, 10 Sep 2012 14:18:38 +0200 Igor Mammedov <[email protected]> wrote:
Quoted 29 lines · On Wed, 5 Sep 2012 17:41:10 -0300 Eduardo Habkost <[email protected]> wrote:

Those models are maintained by QEMU and may require compatibility code to be added when making some changes. Keeping the data in the C source code should make it simpler to handle those details.

---
 sysconfigs/target/cpus-x86_64.conf | 129 +---------------------
 target-i386/cpu.c                  | 219

+++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 128 deletions(-)

(quoted diff) +0 -0

b/sysconfigs/target/cpus-x86_64.conf index cee0ea9..3902189 100644

sysconfigs/target/cpus-x86_64.conf +0 -10
@@ -1,128 +1 @@
-# x86 CPU MODELS
-
-[cpudef]
-   name = "Conroe"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"

...

Quoted 4 lines
Quoted 2 lines

+ .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |
CPUID_EXT2_SYSCALL,

Silent fix, replacing i64 with CPUID_EXT2_LM
looks like "i64" is mistake and never worked. In Intel & AMD cpuid guides

Actually it works when setting feature fields because it uses setfeatures(), however setting i64 will set wrong bit if it's set using add_flagname_to_bitmaps()

Quoted 4 lines

01.EDX[30] is reserved and what was probably meant/intended here is to use 80000001h.EDX[29] /* CPUID_EXT2_LM */
Perhaps patch that fixes it ought to go before this one.

#10 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

Quoted 36 lines · On Mon, 10 Sep 2012 14:31:49 +0200 Igor Mammedov <[email protected]> wrote:
Quoted 33 lines · On Mon, 10 Sep 2012 14:18:38 +0200 Igor Mammedov <[email protected]> wrote:
Quoted 29 lines · On Wed, 5 Sep 2012 17:41:10 -0300 Eduardo Habkost <[email protected]> wrote:

Those models are maintained by QEMU and may require compatibility code to be added when making some changes. Keeping the data in the C source code should make it simpler to handle those details.

---
 sysconfigs/target/cpus-x86_64.conf | 129 +---------------------
 target-i386/cpu.c                  | 219

+++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 128 deletions(-)

(quoted diff) +0 -0

b/sysconfigs/target/cpus-x86_64.conf index cee0ea9..3902189 100644

sysconfigs/target/cpus-x86_64.conf +0 -10
@@ -1,128 +1 @@
-# x86 CPU MODELS
-
-[cpudef]
-   name = "Conroe"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"

...

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

+ .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |
CPUID_EXT2_SYSCALL,

Silent fix, replacing i64 with CPUID_EXT2_LM
looks like "i64" is mistake and never worked. In Intel & AMD cpuid guides

Actually it works when setting feature fields because it uses setfeatures(), however setting i64 will set wrong bit if it's set using add_flagname_to_bitmaps()

I'm wrong, and sorry for noise. I mixed up ia64 from feature_name with i64 from ext2_feature_name.

But question unrelated to this patch is still stand if ia64 is valid bit for 01.EDX[30]?

#11 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

Quoted 43 lines · Igor Mammedov
Quoted 40 lines · On Mon, 10 Sep 2012 14:31:49 +0200 Igor Mammedov <[email protected]> wrote:
Quoted 37 lines · On Mon, 10 Sep 2012 14:18:38 +0200 Igor Mammedov <[email protected]> wrote:
Quoted 29 lines · On Wed, 5 Sep 2012 17:41:10 -0300 Eduardo Habkost <[email protected]> wrote:

Those models are maintained by QEMU and may require compatibility code to be added when making some changes. Keeping the data in the C source code should make it simpler to handle those details.

---
  sysconfigs/target/cpus-x86_64.conf | 129 +---------------------
  target-i386/cpu.c                  | 219

+++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 128 deletions(-)

(quoted diff) +0 -0

b/sysconfigs/target/cpus-x86_64.conf index cee0ea9..3902189 100644

sysconfigs/target/cpus-x86_64.conf +0 -10
@@ -1,128 +1 @@
-# x86 CPU MODELS
-
-[cpudef]
-   name = "Conroe"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"

...

Quoted 2 lines

+ .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |
CPUID_EXT2_SYSCALL,

Silent fix, replacing i64 with CPUID_EXT2_LM
looks like "i64" is mistake and never worked. In Intel & AMD cpuid guides

Quoted 10 lines
Quoted 3 lines

Actually it works when setting feature fields because it uses setfeatures(), however setting i64 will set wrong bit if it's set using add_flagname_to_bitmaps()

I'm wrong, and sorry for noise. I mixed up ia64 from feature_name with i64 from ext2_feature_name.

But question unrelated to this patch is still stand if ia64 is valid bit for 01.EDX[30]?

Intel® Processor Identification
and the CPUID Instruction
Application Note 485
January 2006

Order Number: 241618-030

...

Updated Table 3-5 to include the feature flag definition (EDX[30]) for IA64 capabilities.
...
30 IA64 IA64 Capabilities The processor is a member of the Intel® Itanium® processor family
and currently operating in IA32 emulation mode.

---------------

Says that it is. Along with http://en.wikipedia.org/wiki/CPUID and http://www.sandpile.org/x86/cpuid.htm#level_0000_0001h (IA-64)

But the newest version I found (241618-037, January 2011) is back to Reserved.

-Don Slutz

#12 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

Am 10.09.2012 16:50, schrieb Don Slutz:

Quoted 22 lines · Igor Mammedov
Quoted 5 lines

But question unrelated to this patch is still stand if ia64 is valid bit for
01.EDX[30]?

Intel® Processor Identification
and the CPUID Instruction
Application Note 485
January 2006

Order Number: 241618-030

...

Updated Table 3-5 to include the feature flag definition (EDX[30]) for IA64 capabilities.
...
30 IA64 IA64 Capabilities The processor is a member of the Intel® Itanium® processor family
and currently operating in IA32 emulation mode.

Quoted 4 lines

---------------

Says that it is. Along with http://en.wikipedia.org/wiki/CPUID and
http://www.sandpile.org/x86/cpuid.htm#level_0000_0001h (IA-64)

Don't those semantics contradict the use in qemu-system-x86_64 or qemu-system-i386 rather than qemu-system-ia64 then? We don't model ia64 CPUs here (just like we don't model ppc64 CPUs in ppc) so the flag could never become 1 IIUC.

Andreas

Quoted 5 lines

But the newest version I found (241618-037, January 2011) is back to Reserved.

-Don Slutz

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#13 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

Quoted 25 lines · Andreas Färber

Am 10.09.2012 16:50, schrieb Don Slutz:

Quoted 24 lines · Igor Mammedov
Quoted 5 lines

But question unrelated to this patch is still stand if ia64 is valid bit for
01.EDX[30]?

Intel® Processor Identification
and the CPUID Instruction
Application Note 485
January 2006

Order Number: 241618-030

...

Updated Table 3-5 to include the feature flag definition (EDX[30]) for IA64 capabilities.
...
30 IA64 IA64 Capabilities The processor is a member of the Intel® Itanium® processor family
and currently operating in IA32 emulation mode.

---------------

Quoted 7 lines
Quoted 2 lines

Says that it is. Along with http://en.wikipedia.org/wiki/CPUID and
http://www.sandpile.org/x86/cpuid.htm#level_0000_0001h (IA-64)

Don't those semantics contradict the use in qemu-system-x86_64 or qemu-system-i386 rather than qemu-system-ia64 then? We don't model ia64 CPUs here (just like we don't model ppc64 CPUs in ppc) so the flag could never become 1 IIUC.

Correct, and the bit is always filtered out on both TCG and KVM modes. The name is in the table because we know the name/meaning of that feature bit, but it's impossible to enable it.

That said, I don't mind removing it from the table just to avoid confusion, but I also wouldn't mind keeping it (as it's harmless).

Signature · 1 line
Eduardo
#14 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

Am 10.09.2012 17:07, schrieb Eduardo Habkost:

Quoted 34 lines · Andreas Färber
Quoted 25 lines

Am 10.09.2012 16:50, schrieb Don Slutz:

Quoted 24 lines · Igor Mammedov
Quoted 5 lines

But question unrelated to this patch is still stand if ia64 is valid bit for
01.EDX[30]?

Intel® Processor Identification
and the CPUID Instruction
Application Note 485
January 2006

Order Number: 241618-030

...

Updated Table 3-5 to include the feature flag definition (EDX[30]) for IA64 capabilities.
...
30 IA64 IA64 Capabilities The processor is a member of the Intel® Itanium® processor family
and currently operating in IA32 emulation mode.

---------------

Quoted 7 lines
Quoted 2 lines

Says that it is. Along with http://en.wikipedia.org/wiki/CPUID and
http://www.sandpile.org/x86/cpuid.htm#level_0000_0001h (IA-64)

Don't those semantics contradict the use in qemu-system-x86_64 or qemu-system-i386 rather than qemu-system-ia64 then? We don't model ia64 CPUs here (just like we don't model ppc64 CPUs in ppc) so the flag could never become 1 IIUC.

Quoted 6 lines

Correct, and the bit is always filtered out on both TCG and KVM modes. The name is in the table because we know the name/meaning of that feature bit, but it's impossible to enable it.

That said, I don't mind removing it from the table just to avoid confusion, but I also wouldn't mind keeping it (as it's harmless).

No objections from my side against having it for informational purpose.

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#15 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

In reply to Igor Mammedov
Quoted 43 lines · Igor Mammedov
Quoted 40 lines · On Mon, 10 Sep 2012 14:31:49 +0200 Igor Mammedov <[email protected]> wrote:
Quoted 37 lines · On Mon, 10 Sep 2012 14:18:38 +0200 Igor Mammedov <[email protected]> wrote:
Quoted 29 lines · On Wed, 5 Sep 2012 17:41:10 -0300 Eduardo Habkost <[email protected]> wrote:

Those models are maintained by QEMU and may require compatibility code to be added when making some changes. Keeping the data in the C source code should make it simpler to handle those details.

---
 sysconfigs/target/cpus-x86_64.conf | 129 +---------------------
 target-i386/cpu.c                  | 219

+++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 128 deletions(-)

(quoted diff) +0 -0

b/sysconfigs/target/cpus-x86_64.conf index cee0ea9..3902189 100644

sysconfigs/target/cpus-x86_64.conf +0 -10
@@ -1,128 +1 @@
-# x86 CPU MODELS
-
-[cpudef]
-   name = "Conroe"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"

...

Quoted 2 lines

+ .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |
CPUID_EXT2_SYSCALL,

Silent fix, replacing i64 with CPUID_EXT2_LM
looks like "i64" is mistake and never worked. In Intel & AMD cpuid guides

Quoted 8 lines
Quoted 3 lines

Actually it works when setting feature fields because it uses setfeatures(), however setting i64 will set wrong bit if it's set using add_flagname_to_bitmaps()

I'm wrong, and sorry for noise. I mixed up ia64 from feature_name with i64 from ext2_feature_name.

But question unrelated to this patch is still stand if ia64 is valid bit for 01.EDX[30]?

It is reserved on IA-32 and Intel-64/AMD64, but it has a name/meaning, already[1]. The name of that bit is in the table, but it's harmless (and useless) because both KVM and TCG modes disable it automatically (and -cpu check/enforce should warn about it not being supported by the host).

[1] Linux recognizes it as X86_FEATURE_IA64/"ia64".
Itanium SDM documents it as:
"30 Processor based on the Intel Itanium architecture
"The processor is based on the Intel Itanium architecture and is capable of executing the Intel Itanium instruction set. IA-32 application level software MUST also check with the running operating system to see if the system can also support Itanium architecture-based code before switching to the Intel Itanium instruction set."

Signature · 1 line
Eduardo
Reviewed-by on v1 4/7
#16 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

In reply to Eduardo Habkost
Quoted 407 lines · On Wed, 5 Sep 2012 17:41:10 -0300 Eduardo Habkost <[email protected]> wrote:

Those models are maintained by QEMU and may require compatibility code to be added when making some changes. Keeping the data in the C source code should make it simpler to handle those details.

---
 sysconfigs/target/cpus-x86_64.conf | 129 +---------------------
 target-i386/cpu.c                  | 219

+++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 128 deletions(-)

(quoted diff) +0 -0

b/sysconfigs/target/cpus-x86_64.conf index cee0ea9..3902189 100644

sysconfigs/target/cpus-x86_64.conf +0 -10
@@ -1,128 +1 @@
-# x86 CPU MODELS
-
-[cpudef]
-   name = "Conroe"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -14
-   feature_ecx = "ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)"
-
-[cpudef]
-   name = "Penryn"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -14
-   feature_ecx = "sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)"
-
-[cpudef]
-   name = "Nehalem"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -14
-   feature_ecx = "popcnt sse4.2 sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 syscall xd"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Core i7 9xx (Nehalem Class Core i7)"
-
-[cpudef]
-   name = "Westmere"
-   level = "11"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "44"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -14
-   feature_ecx = "aes popcnt sse4.2 sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 syscall xd"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)"
-
-[cpudef]
-   name = "SandyBridge"
-   level = "0xd"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "42"
-   stepping = "1"
-   feature_edx = " sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"
- feature_ecx = "avx xsave aes tsc-deadline popcnt x2apic sse4.2 sse4.1
cx16 ssse3 pclmulqdq sse3"

sysconfigs/target/cpus-x86_64.conf +0 -13
-   extfeature_edx = "i64 rdtscp nx syscall "
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Xeon E312xx (Sandy Bridge)"
-
-[cpudef]
-   name = "Opteron_G1"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "sse3"
-   extfeature_edx = "lm fxsr mmx nx pse36 pat cmov mca pge mtrr syscall

apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -12
-   extfeature_ecx = " "
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 240 (Gen 1 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G2"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "cx16 sse3"
-   extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr

syscall apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -12
-   extfeature_ecx = "svm lahf_lm"
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G3"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "popcnt cx16 monitor sse3"
-   extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr

syscall apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -12
-   extfeature_ecx = "misalignsse sse4a abm svm lahf_lm"
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G4"
-   level = "0xd"
-   vendor = "AuthenticAMD"
-   family = "21"
-   model = "1"
-   stepping = "2"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"
- feature_ecx = "avx xsave aes popcnt sse4.2 sse4.1 cx16 ssse3 pclmulqdq
sse3"
- extfeature_edx = "lm rdtscp pdpe1gb fxsr mmx nx pse36 pat cmov mca pge
mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
- extfeature_ecx = " fma4 xop 3dnowprefetch misalignsse sse4a abm svm
lahf_lm"

sysconfigs/target/cpus-x86_64.conf +1 -3
-   xlevel = "0x8000001A"
-   model_id = "AMD Opteron 62xx class CPU"
-
+# The CPU models from this file are now built-in in the QEMU source code
target-i386/cpu.c +11 -0
index d2af0ff..73302d8 100644
@@ -490,6 +490,225 @@ static x86_def_t builtin_x86_defs[] = {
         .xlevel = 0x8000000A,
         .model_id = "Intel(R) Atom(TM) CPU N270   @ 1.60GHz",
     },
+    {
+        .name = "Conroe",
+        .level = 2,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 2,
+        .stepping = 3,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +5 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_SSSE3 | CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |

CPUID_EXT2_SYSCALL,

target-i386/cpu.c +15 -0
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)",
+    },
+    {
+        .name = "Penryn",
+        .level = 2,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 2,
+        .stepping = 3,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +4 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3

|

target-i386/cpu.c +2 -0
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |

CPUID_EXT2_SYSCALL,

target-i386/cpu.c +15 -0
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)",
+    },
+    {
+        .name = "Nehalem",
+        .level = 2,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 2,
+        .stepping = 3,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +4 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_POPCNT | CPUID_EXT_SSE42 |

CPUID_EXT_SSE41 |

target-i386/cpu.c +2 -0
+             CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_SYSCALL |

CPUID_EXT2_NX,

target-i386/cpu.c +15 -0
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Core i7 9xx (Nehalem Class Core i7)",
+    },
+    {
+        .name = "Westmere",
+        .level = 11,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 44,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +4 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_AES | CPUID_EXT_POPCNT | CPUID_EXT_SSE42

|

target-i386/cpu.c +3 -0
+             CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_SYSCALL |

CPUID_EXT2_NX,

target-i386/cpu.c +15 -0
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)",
+    },
+    {
+        .name = "SandyBridge",
+        .level = 0xd,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 42,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +9 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
+             CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_POPCNT |
+             CPUID_EXT_X2APIC | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 |
+             CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | CPUID_EXT_PCLMULQDQ |
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX

|

target-i386/cpu.c +16 -0
+             CPUID_EXT2_SYSCALL,
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Xeon E312xx (Sandy Bridge)",
+    },
+    {
+        .name = "Opteron_G1",
+        .level = 5,
+        .vendor1 = CPUID_VENDOR_AMD_1,
+        .vendor2 = CPUID_VENDOR_AMD_2,
+        .vendor3 = CPUID_VENDOR_AMD_3,
+        .family = 15,
+        .model = 6,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +9 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_FXSR | CPUID_EXT2_MMX |
+             CPUID_EXT2_NX | CPUID_EXT2_PSE36 | CPUID_EXT2_PAT |
+             CPUID_EXT2_CMOV | CPUID_EXT2_MCA | CPUID_EXT2_PGE |
+             CPUID_EXT2_MTRR | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC |
+             CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE |

CPUID_EXT2_MSR |
+ CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE |
CPUID_EXT2_FPU,

target-i386/cpu.c +14 -0
+        .xlevel = 0x80000008,
+        .model_id = "AMD Opteron 240 (Gen 1 Class Opteron)",
+    },
+    {
+        .name = "Opteron_G2",
+        .level = 5,
+        .vendor1 = CPUID_VENDOR_AMD_1,
+        .vendor2 = CPUID_VENDOR_AMD_2,
+        .vendor3 = CPUID_VENDOR_AMD_3,
+        .family = 15,
+        .model = 6,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +5 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_CX16 | CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP |

CPUID_EXT2_FXSR |

target-i386/cpu.c +5 -0
+             CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PSE36 |
+             CPUID_EXT2_PAT | CPUID_EXT2_CMOV | CPUID_EXT2_MCA |
+             CPUID_EXT2_PGE | CPUID_EXT2_MTRR | CPUID_EXT2_SYSCALL |
+             CPUID_EXT2_APIC | CPUID_EXT2_CX8 | CPUID_EXT2_MCE |
+             CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC |

CPUID_EXT2_PSE |

target-i386/cpu.c +16 -0
+             CPUID_EXT2_DE | CPUID_EXT2_FPU,
+        .ext3_features = CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x80000008,
+        .model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)",
+    },
+    {
+        .name = "Opteron_G3",
+        .level = 5,
+        .vendor1 = CPUID_VENDOR_AMD_1,
+        .vendor2 = CPUID_VENDOR_AMD_2,
+        .vendor3 = CPUID_VENDOR_AMD_3,
+        .family = 15,
+        .model = 6,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +4 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_POPCNT | CPUID_EXT_CX16 |

CPUID_EXT_MONITOR |

target-i386/cpu.c +2 -0
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP |

CPUID_EXT2_FXSR |

target-i386/cpu.c +5 -0
+             CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PSE36 |
+             CPUID_EXT2_PAT | CPUID_EXT2_CMOV | CPUID_EXT2_MCA |
+             CPUID_EXT2_PGE | CPUID_EXT2_MTRR | CPUID_EXT2_SYSCALL |
+             CPUID_EXT2_APIC | CPUID_EXT2_CX8 | CPUID_EXT2_MCE |
+             CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC |

CPUID_EXT2_PSE |

target-i386/cpu.c +17 -0
+             CPUID_EXT2_DE | CPUID_EXT2_FPU,
+        .ext3_features = CPUID_EXT3_MISALIGNSSE | CPUID_EXT3_SSE4A |
+             CPUID_EXT3_ABM | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x80000008,
+        .model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)",
+    },
+    {
+        .name = "Opteron_G4",
+        .level = 0xd,
+        .vendor1 = CPUID_VENDOR_AMD_1,
+        .vendor2 = CPUID_VENDOR_AMD_2,
+        .vendor3 = CPUID_VENDOR_AMD_3,
+        .family = 21,
+        .model = 1,
+        .stepping = 2,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +13 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
+             CPUID_EXT_POPCNT | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 |
+             CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | CPUID_EXT_PCLMULQDQ |
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP |
+             CPUID_EXT2_PDPE1GB | CPUID_EXT2_FXSR | CPUID_EXT2_MMX |
+             CPUID_EXT2_NX | CPUID_EXT2_PSE36 | CPUID_EXT2_PAT |
+             CPUID_EXT2_CMOV | CPUID_EXT2_MCA | CPUID_EXT2_PGE |
+             CPUID_EXT2_MTRR | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC |
+             CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE |

CPUID_EXT2_MSR |
+ CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE |
CPUID_EXT2_FPU,

target-i386/cpu.c static x86_def_t builtin_x86_defs[] = { · line 714

Quoted 10 lines
target-i386/cpu.c +7 -0
+        .ext3_features = CPUID_EXT3_FMA4 | CPUID_EXT3_XOP |
+             CPUID_EXT3_3DNOWPREFETCH | CPUID_EXT3_MISALIGNSSE |
+             CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | CPUID_EXT3_SVM |
+             CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000001A,
+        .model_id = "AMD Opteron 62xx class CPU",
+    },
 };
 
 static int cpu_x86_fill_model_id(char *str)
Reviewed-by
#17 lore raw

Re: [Qemu-devel] [PATCH 4/7] move CPU models from cpus-x86_64.conf to C

Quoted 419 lines · Igor Mammedov
Quoted 416 lines · On Wed, 5 Sep 2012 17:41:10 -0300 Eduardo Habkost <[email protected]> wrote:

Those models are maintained by QEMU and may require compatibility code to be added when making some changes. Keeping the data in the C source code should make it simpler to handle those details.

---
  sysconfigs/target/cpus-x86_64.conf | 129 +---------------------
  target-i386/cpu.c                  | 219

+++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+), 128 deletions(-)

(quoted diff) +0 -0

b/sysconfigs/target/cpus-x86_64.conf index cee0ea9..3902189 100644

sysconfigs/target/cpus-x86_64.conf +0 -10
@@ -1,128 +1 @@
-# x86 CPU MODELS
-
-[cpudef]
-   name = "Conroe"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -14
-   feature_ecx = "ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)"
-
-[cpudef]
-   name = "Penryn"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -14
-   feature_ecx = "sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 xd syscall"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)"
-
-[cpudef]
-   name = "Nehalem"
-   level = "2"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "2"
-   stepping = "3"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -14
-   feature_ecx = "popcnt sse4.2 sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 syscall xd"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Core i7 9xx (Nehalem Class Core i7)"
-
-[cpudef]
-   name = "Westmere"
-   level = "11"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "44"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -14
-   feature_ecx = "aes popcnt sse4.2 sse4.1 cx16 ssse3 sse3"
-   extfeature_edx = "i64 syscall xd"
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)"
-
-[cpudef]
-   name = "SandyBridge"
-   level = "0xd"
-   vendor = "GenuineIntel"
-   family = "6"
-   model = "42"
-   stepping = "1"
-   feature_edx = " sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"
- feature_ecx = "avx xsave aes tsc-deadline popcnt x2apic sse4.2 sse4.1
cx16 ssse3 pclmulqdq sse3"

sysconfigs/target/cpus-x86_64.conf +0 -13
-   extfeature_edx = "i64 rdtscp nx syscall "
-   extfeature_ecx = "lahf_lm"
-   xlevel = "0x8000000A"
-   model_id = "Intel Xeon E312xx (Sandy Bridge)"
-
-[cpudef]
-   name = "Opteron_G1"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "sse3"
-   extfeature_edx = "lm fxsr mmx nx pse36 pat cmov mca pge mtrr syscall

apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -12
-   extfeature_ecx = " "
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 240 (Gen 1 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G2"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "cx16 sse3"
-   extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr

syscall apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -12
-   extfeature_ecx = "svm lahf_lm"
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G3"
-   level = "5"
-   vendor = "AuthenticAMD"
-   family = "15"
-   model = "6"
-   stepping = "1"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -2
-   feature_ecx = "popcnt cx16 monitor sse3"
-   extfeature_edx = "lm rdtscp fxsr mmx nx pse36 pat cmov mca pge mtrr

syscall apic cx8 mce pae msr tsc pse de fpu"

sysconfigs/target/cpus-x86_64.conf +0 -12
-   extfeature_ecx = "misalignsse sse4a abm svm lahf_lm"
-   xlevel = "0x80000008"
-   model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)"
-
-[cpudef]
-   name = "Opteron_G4"
-   level = "0xd"
-   vendor = "AuthenticAMD"
-   family = "21"
-   model = "1"
-   stepping = "2"
-   feature_edx = "sse2 sse fxsr mmx clflush pse36 pat cmov mca pge mtrr

sep apic cx8 mce pae msr tsc pse de fpu"
- feature_ecx = "avx xsave aes popcnt sse4.2 sse4.1 cx16 ssse3 pclmulqdq
sse3"
- extfeature_edx = "lm rdtscp pdpe1gb fxsr mmx nx pse36 pat cmov mca pge
mtrr syscall apic cx8 mce pae msr tsc pse de fpu"
- extfeature_ecx = " fma4 xop 3dnowprefetch misalignsse sse4a abm svm
lahf_lm"

sysconfigs/target/cpus-x86_64.conf +1 -3
-   xlevel = "0x8000001A"
-   model_id = "AMD Opteron 62xx class CPU"
-
+# The CPU models from this file are now built-in in the QEMU source code
target-i386/cpu.c +11 -0
index d2af0ff..73302d8 100644
@@ -490,6 +490,225 @@ static x86_def_t builtin_x86_defs[] = {
          .xlevel = 0x8000000A,
          .model_id = "Intel(R) Atom(TM) CPU N270   @ 1.60GHz",
      },
+    {
+        .name = "Conroe",
+        .level = 2,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 2,
+        .stepping = 3,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +5 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_SSSE3 | CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |

CPUID_EXT2_SYSCALL,

target-i386/cpu.c +15 -0
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Celeron_4x0 (Conroe/Merom Class Core 2)",
+    },
+    {
+        .name = "Penryn",
+        .level = 2,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 2,
+        .stepping = 3,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +4 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3

|

target-i386/cpu.c +2 -0
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_NX |

CPUID_EXT2_SYSCALL,

target-i386/cpu.c +15 -0
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Core 2 Duo P9xxx (Penryn Class Core 2)",
+    },
+    {
+        .name = "Nehalem",
+        .level = 2,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 2,
+        .stepping = 3,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +4 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_POPCNT | CPUID_EXT_SSE42 |

CPUID_EXT_SSE41 |

target-i386/cpu.c +2 -0
+             CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_SYSCALL |

CPUID_EXT2_NX,

target-i386/cpu.c +15 -0
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Core i7 9xx (Nehalem Class Core i7)",
+    },
+    {
+        .name = "Westmere",
+        .level = 11,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 44,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +4 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_AES | CPUID_EXT_POPCNT | CPUID_EXT_SSE42

|

target-i386/cpu.c +3 -0
+             CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 |
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_SYSCALL |

CPUID_EXT2_NX,

target-i386/cpu.c +15 -0
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Westmere E56xx/L56xx/X56xx (Nehalem-C)",
+    },
+    {
+        .name = "SandyBridge",
+        .level = 0xd,
+        .vendor1 = CPUID_VENDOR_INTEL_1,
+        .vendor2 = CPUID_VENDOR_INTEL_2,
+        .vendor3 = CPUID_VENDOR_INTEL_3,
+        .family = 6,
+        .model = 42,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +9 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
+             CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_POPCNT |
+             CPUID_EXT_X2APIC | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 |
+             CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | CPUID_EXT_PCLMULQDQ |
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX

|

target-i386/cpu.c +16 -0
+             CPUID_EXT2_SYSCALL,
+        .ext3_features = CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000000A,
+        .model_id = "Intel Xeon E312xx (Sandy Bridge)",
+    },
+    {
+        .name = "Opteron_G1",
+        .level = 5,
+        .vendor1 = CPUID_VENDOR_AMD_1,
+        .vendor2 = CPUID_VENDOR_AMD_2,
+        .vendor3 = CPUID_VENDOR_AMD_3,
+        .family = 15,
+        .model = 6,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +9 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_FXSR | CPUID_EXT2_MMX |
+             CPUID_EXT2_NX | CPUID_EXT2_PSE36 | CPUID_EXT2_PAT |
+             CPUID_EXT2_CMOV | CPUID_EXT2_MCA | CPUID_EXT2_PGE |
+             CPUID_EXT2_MTRR | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC |
+             CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE |

CPUID_EXT2_MSR |
+ CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE |
CPUID_EXT2_FPU,

target-i386/cpu.c +14 -0
+        .xlevel = 0x80000008,
+        .model_id = "AMD Opteron 240 (Gen 1 Class Opteron)",
+    },
+    {
+        .name = "Opteron_G2",
+        .level = 5,
+        .vendor1 = CPUID_VENDOR_AMD_1,
+        .vendor2 = CPUID_VENDOR_AMD_2,
+        .vendor3 = CPUID_VENDOR_AMD_3,
+        .family = 15,
+        .model = 6,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +5 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_CX16 | CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP |

CPUID_EXT2_FXSR |

target-i386/cpu.c +5 -0
+             CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PSE36 |
+             CPUID_EXT2_PAT | CPUID_EXT2_CMOV | CPUID_EXT2_MCA |
+             CPUID_EXT2_PGE | CPUID_EXT2_MTRR | CPUID_EXT2_SYSCALL |
+             CPUID_EXT2_APIC | CPUID_EXT2_CX8 | CPUID_EXT2_MCE |
+             CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC |

CPUID_EXT2_PSE |

target-i386/cpu.c +16 -0
+             CPUID_EXT2_DE | CPUID_EXT2_FPU,
+        .ext3_features = CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x80000008,
+        .model_id = "AMD Opteron 22xx (Gen 2 Class Opteron)",
+    },
+    {
+        .name = "Opteron_G3",
+        .level = 5,
+        .vendor1 = CPUID_VENDOR_AMD_1,
+        .vendor2 = CPUID_VENDOR_AMD_2,
+        .vendor3 = CPUID_VENDOR_AMD_3,
+        .family = 15,
+        .model = 6,
+        .stepping = 1,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +4 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_POPCNT | CPUID_EXT_CX16 |

CPUID_EXT_MONITOR |

target-i386/cpu.c +2 -0
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP |

CPUID_EXT2_FXSR |

target-i386/cpu.c +5 -0
+             CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PSE36 |
+             CPUID_EXT2_PAT | CPUID_EXT2_CMOV | CPUID_EXT2_MCA |
+             CPUID_EXT2_PGE | CPUID_EXT2_MTRR | CPUID_EXT2_SYSCALL |
+             CPUID_EXT2_APIC | CPUID_EXT2_CX8 | CPUID_EXT2_MCE |
+             CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC |

CPUID_EXT2_PSE |

target-i386/cpu.c +17 -0
+             CPUID_EXT2_DE | CPUID_EXT2_FPU,
+        .ext3_features = CPUID_EXT3_MISALIGNSSE | CPUID_EXT3_SSE4A |
+             CPUID_EXT3_ABM | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x80000008,
+        .model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)",
+    },
+    {
+        .name = "Opteron_G4",
+        .level = 0xd,
+        .vendor1 = CPUID_VENDOR_AMD_1,
+        .vendor2 = CPUID_VENDOR_AMD_2,
+        .vendor3 = CPUID_VENDOR_AMD_3,
+        .family = 21,
+        .model = 1,
+        .stepping = 2,
+        .features = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX |
+             CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV |

CPUID_MCA |

target-i386/cpu.c +13 -0
+             CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 |
+             CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE |
+             CPUID_DE | CPUID_FP87,
+        .ext_features = CPUID_EXT_AVX | CPUID_EXT_XSAVE | CPUID_EXT_AES |
+             CPUID_EXT_POPCNT | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 |
+             CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | CPUID_EXT_PCLMULQDQ |
+             CPUID_EXT_SSE3,
+        .ext2_features = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP |
+             CPUID_EXT2_PDPE1GB | CPUID_EXT2_FXSR | CPUID_EXT2_MMX |
+             CPUID_EXT2_NX | CPUID_EXT2_PSE36 | CPUID_EXT2_PAT |
+             CPUID_EXT2_CMOV | CPUID_EXT2_MCA | CPUID_EXT2_PGE |
+             CPUID_EXT2_MTRR | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC |
+             CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE |

CPUID_EXT2_MSR |
+ CPUID_EXT2_TSC | CPUID_EXT2_PSE | CPUID_EXT2_DE |
CPUID_EXT2_FPU,

target-i386/cpu.c +7 -0
+        .ext3_features = CPUID_EXT3_FMA4 | CPUID_EXT3_XOP |
+             CPUID_EXT3_3DNOWPREFETCH | CPUID_EXT3_MISALIGNSSE |
+             CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | CPUID_EXT3_SVM |
+             CPUID_EXT3_LAHF_LM,
+        .xlevel = 0x8000001A,
+        .model_id = "AMD Opteron 62xx class CPU",
+    },
  };
Quoted 3 lines
Quoted 1 line

static int cpu_x86_fill_model_id(char *str)

#18 lore raw

PATCH 5/7 eliminate cpus-x86_64.conf file

In reply to Eduardo Habkost

This file is not needed anymore, as QEMU won't ship any config-based cpudefs out of the box, relying only on the builtin CPU models.

---
 Makefile                           | 1 -
 arch_init.c                        | 1 -
 sysconfigs/target/cpus-x86_64.conf | 1 -
 3 files changed, 3 deletions(-)
 delete mode 100644 sysconfigs/target/cpus-x86_64.conf
Makefile +0 -1
index 1cd5bc8..a8d9236 100644
@@ -297,7 +297,6 @@ install-confdir:
 
 install-sysconfig: install-datadir install-confdir
 	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
-	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/cpus-x86_64.conf "$(DESTDIR)$(qemu_datadir)"
 
 install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig install-datadir
 	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
arch_init.c +0 -1
index 5a1173e..510d3ef 100644
@@ -136,7 +136,6 @@ static struct defconfig_file {
     /* Indicates it is an user config file (disabled by -no-user-config) */
     bool userconfig;
 } default_config_files[] = {
-    { CONFIG_QEMU_DATADIR "/cpus-" TARGET_ARCH ".conf",  false },
     { CONFIG_QEMU_CONFDIR "/qemu.conf",                   true },
     { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", true },
     { NULL }, /* end of list */
sysconfigs/target/cpus-x86_64.conf deleted +0 -1
deleted file mode 100644
index 3902189..0000000
@@ -1 +0,0 @@
-# The CPU models from this file are now built-in in the QEMU source code
Signature · 1 line
1.7.11.4
Reviewed-by on v1 5/7
#19 lore raw

Re: [Qemu-devel] [PATCH 5/7] eliminate cpus-x86_64.conf file

Quoted 42 lines · On Wed, 5 Sep 2012 17:41:11 -0300 Eduardo Habkost <[email protected]> wrote:

This file is not needed anymore, as QEMU won't ship any config-based cpudefs out of the box, relying only on the builtin CPU models.

---
 Makefile                           | 1 -
 arch_init.c                        | 1 -
 sysconfigs/target/cpus-x86_64.conf | 1 -
 3 files changed, 3 deletions(-)
 delete mode 100644 sysconfigs/target/cpus-x86_64.conf
Makefile +0 -0
index 1cd5bc8..a8d9236 100644
@@ -297,7 +297,6 @@ install-confdir:
 
 install-sysconfig: install-datadir install-confdir
 	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf

"$(DESTDIR)$(qemu_confdir)"

Makefile +0 -1
-	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/cpus-x86_64.conf

"$(DESTDIR)$(qemu_datadir)"
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
install-datadir $(INSTALL_DIR) "$(DESTDIR)$(bindir)"

arch_init.c +0 -1
index 5a1173e..510d3ef 100644
@@ -136,7 +136,6 @@ static struct defconfig_file {
     /* Indicates it is an user config file (disabled by -no-user-config) */
     bool userconfig;
 } default_config_files[] = {
-    { CONFIG_QEMU_DATADIR "/cpus-" TARGET_ARCH ".conf",  false },
     { CONFIG_QEMU_CONFDIR "/qemu.conf",                   true },
     { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", true },
     { NULL }, /* end of list */
(quoted diff) +0 -0

b/sysconfigs/target/cpus-x86_64.conf deleted file mode 100644 index 3902189..0000000

sysconfigs/target/cpus-x86_64.conf line 1

Quoted 1 line
sysconfigs/target/cpus-x86_64.conf deleted +0 -1
@@ -1 +0,0 @@
-# The CPU models from this file are now built-in in the QEMU source code
#20 lore raw

PATCH 6/7 x86_cpudef_setup: coding style change

In reply to Eduardo Habkost

Make source code lines shorter.

---
 target-i386/cpu.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
target-i386/cpu.c +9 -6
index 73302d8..e13e6d5 100644
@@ -1513,20 +1513,23 @@ void x86_cpudef_setup(void)
     static const char *model_with_versions[] = { "qemu32", "qemu64", "athlon" };
 
     for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {
-        builtin_x86_defs[i].next = x86_defs;
-        builtin_x86_defs[i].flags = 1;
+        x86_def_t *def = &builtin_x86_defs[i];
+        def->next = x86_defs;
+        def->flags = 1;
 
         /* Look for specific "cpudef" models that */
         /* have the QEMU version in .model_id */
         for (j = 0; j < ARRAY_SIZE(model_with_versions); j++) {
-            if (strcmp(model_with_versions[j], builtin_x86_defs[i].name) == 0) {
-                pstrcpy(builtin_x86_defs[i].model_id, sizeof(builtin_x86_defs[i].model_id), "QEMU Virtual CPU version ");
-                pstrcat(builtin_x86_defs[i].model_id, sizeof(builtin_x86_defs[i].model_id), qemu_get_version());
+            if (strcmp(model_with_versions[j], def->name) == 0) {
+                pstrcpy(def->model_id, sizeof(def->model_id),
+                        "QEMU Virtual CPU version ");
+                pstrcat(def->model_id, sizeof(def->model_id),
+                        qemu_get_version());
                 break;
             }
         }
 
-        x86_defs = &builtin_x86_defs[i];
+        x86_defs = def;
     }
 #if !defined(CONFIG_USER_ONLY)
     qemu_opts_foreach(qemu_find_opts("cpudef"), cpudef_register, NULL, 0);
Signature · 1 line
1.7.11.4
Reviewed-by on v1 6/7
#21 lore raw

Re: [Qemu-devel] [PATCH 6/7] x86_cpudef_setup: coding style change

Quoted 31 lines · Eduardo Habkost

Make source code lines shorter.

---
  target-i386/cpu.c | 15 +++++++++------
  1 file changed, 9 insertions(+), 6 deletions(-)
target-i386/cpu.c +7 -5
index 73302d8..e13e6d5 100644
@@ -1513,20 +1513,23 @@ void x86_cpudef_setup(void)
      static const char *model_with_versions[] = { "qemu32", "qemu64", "athlon" };
 
      for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {
-        builtin_x86_defs[i].next = x86_defs;
-        builtin_x86_defs[i].flags = 1;
+        x86_def_t *def = &builtin_x86_defs[i];
+        def->next = x86_defs;
+        def->flags = 1;
 
          /* Look for specific "cpudef" models that */
          /* have the QEMU version in .model_id */
          for (j = 0; j < ARRAY_SIZE(model_with_versions); j++) {
-            if (strcmp(model_with_versions[j], builtin_x86_defs[i].name) == 0) {
-                pstrcpy(builtin_x86_defs[i].model_id, sizeof(builtin_x86_defs[i].model_id), "QEMU Virtual CPU version ");
-                pstrcat(builtin_x86_defs[i].model_id, sizeof(builtin_x86_defs[i].model_id), qemu_get_version());
+            if (strcmp(model_with_versions[j], def->name) == 0) {
+                pstrcpy(def->model_id, sizeof(def->model_id),
+                        "QEMU Virtual CPU version ");
+                pstrcat(def->model_id, sizeof(def->model_id),

target-i386/cpu.c void x86_cpudef_setup(void) · line 1535

Quoted 10 lines
target-i386/cpu.c +2 -1
+                        qemu_get_version());
                  break;
              }
          }
 
-        x86_defs = &builtin_x86_defs[i];
+        x86_defs = def;
      }
  #if !defined(CONFIG_USER_ONLY)
      qemu_opts_foreach(qemu_find_opts("cpudef"), cpudef_register, NULL, 0);
#22 lore raw

PATCH 7/7 i386: kill cpudef config section support

In reply to Eduardo Habkost

It's nice to have a flexible system to maintain CPU models as data, but this is holding us from making improvements in the CPU code because it's not using the common infra-structure, and because the machine-type data is still inside C code.

Users who want to configure CPU features directly may simply use the "-cpu" command-line option (and maybe an equivalent -device option in the future) to set CPU features.

---
 target-i386/cpu.c | 101 ++----------------------------------------------------
 1 file changed, 2 insertions(+), 99 deletions(-)
target-i386/cpu.c +2 -99
index e13e6d5..7c0953f 100644
@@ -240,7 +240,6 @@ typedef struct x86_def_t {
     uint32_t xlevel;
     char model_id[48];
     int vendor_override;
-    uint32_t flags;
     /* Store the results of Centaur's CPUID instructions */
     uint32_t ext4_features;
     uint32_t xlevel2;
@@ -1299,7 +1298,7 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
     char buf[256];
 
     for (def = x86_defs; def; def = def->next) {
-        snprintf(buf, sizeof (buf), def->flags ? "[%s]": "%s", def->name);
+        snprintf(buf, sizeof(buf), "%s", def->name);
         (*cpu_fprintf)(f, "x86 %16s  %-48s\n", buf, def->model_id);
     }
     if (kvm_enabled()) {
@@ -1393,16 +1392,6 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
 }
 
 #if !defined(CONFIG_USER_ONLY)
-/* copy vendor id string to 32 bit register, nul pad as needed
- */
-static void cpyid(const char *s, uint32_t *id)
-{
-    char *d = (char *)id;
-    char i;
-
-    for (i = sizeof (*id); i--; )
-        *d++ = *s ? *s++ : '\0';
-}
 
 /* interpret radix and convert from string to arbitrary scalar,
  * otherwise flag failure
@@ -1416,87 +1405,6 @@ static void cpyid(const char *s, uint32_t *id)
     *str && !*pend ? (*pval = ul) : (*perr = 1);        \
 }
 
-/* map cpuid options to feature bits, otherwise return failure
- * (option tags in *str are delimited by whitespace)
- */
-static void setfeatures(uint32_t *pval, const char *str,
-    const char **featureset, int *perr)
-{
-    const char *p, *q;
-
-    for (q = p = str; *p || *q; q = p) {
-        while (iswhite(*p))
-            q = ++p;
-        while (*p && !iswhite(*p))
-            ++p;
-        if (!*q && !*p)
-            return;
-        if (!lookup_feature(pval, q, p, featureset)) {
-            fprintf(stderr, "error: feature \"%.*s\" not available in set\n",
-                (int)(p - q), q);
-            *perr = 1;
-            return;
-        }
-    }
-}
-
-/* map config file options to x86_def_t form
- */
-static int cpudef_setfield(const char *name, const char *str, void *opaque)
-{
-    x86_def_t *def = opaque;
-    int err = 0;
-
-    if (!strcmp(name, "name")) {
-        g_free((void *)def->name);
-        def->name = g_strdup(str);
-    } else if (!strcmp(name, "model_id")) {
-        strncpy(def->model_id, str, sizeof (def->model_id));
-    } else if (!strcmp(name, "level")) {
-        setscalar(&def->level, str, &err)
-    } else if (!strcmp(name, "vendor")) {
-        cpyid(&str[0], &def->vendor1);
-        cpyid(&str[4], &def->vendor2);
-        cpyid(&str[8], &def->vendor3);
-    } else if (!strcmp(name, "family")) {
-        setscalar(&def->family, str, &err)
-    } else if (!strcmp(name, "model")) {
-        setscalar(&def->model, str, &err)
-    } else if (!strcmp(name, "stepping")) {
-        setscalar(&def->stepping, str, &err)
-    } else if (!strcmp(name, "feature_edx")) {
-        setfeatures(&def->features, str, feature_name, &err);
-    } else if (!strcmp(name, "feature_ecx")) {
-        setfeatures(&def->ext_features, str, ext_feature_name, &err);
-    } else if (!strcmp(name, "extfeature_edx")) {
-        setfeatures(&def->ext2_features, str, ext2_feature_name, &err);
-    } else if (!strcmp(name, "extfeature_ecx")) {
-        setfeatures(&def->ext3_features, str, ext3_feature_name, &err);
-    } else if (!strcmp(name, "xlevel")) {
-        setscalar(&def->xlevel, str, &err)
-    } else {
-        fprintf(stderr, "error: unknown option [%s = %s]\n", name, str);
-        return (1);
-    }
-    if (err) {
-        fprintf(stderr, "error: bad option value [%s = %s]\n", name, str);
-        return (1);
-    }
-    return (0);
-}
-
-/* register config file entry as x86_def_t
- */
-static int cpudef_register(QemuOpts *opts, void *opaque)
-{
-    x86_def_t *def = g_malloc0(sizeof (x86_def_t));
-
-    qemu_opt_foreach(opts, cpudef_setfield, def, 1);
-    def->next = x86_defs;
-    x86_defs = def;
-    return (0);
-}
-
 void cpu_clear_apic_feature(CPUX86State *env)
 {
     env->cpuid_features &= ~CPUID_APIC;
@@ -1504,8 +1412,7 @@ void cpu_clear_apic_feature(CPUX86State *env)
 
 #endif /* !CONFIG_USER_ONLY */
 
-/* register "cpudef" models defined in configuration file.  Here we first
- * preload any built-in definitions
+/* Initialize list of CPU models, filling some non-static fields if necessary
  */
 void x86_cpudef_setup(void)
 {
@@ -1515,7 +1422,6 @@ void x86_cpudef_setup(void)
     for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {
         x86_def_t *def = &builtin_x86_defs[i];
         def->next = x86_defs;
-        def->flags = 1;
 
         /* Look for specific "cpudef" models that */
         /* have the QEMU version in .model_id */
@@ -1531,9 +1437,6 @@ void x86_cpudef_setup(void)
 
         x86_defs = def;
     }
-#if !defined(CONFIG_USER_ONLY)
-    qemu_opts_foreach(qemu_find_opts("cpudef"), cpudef_register, NULL, 0);
-#endif
 }
 
 static void get_cpuid_vendor(CPUX86State *env, uint32_t *ebx,
Signature · 1 line
1.7.11.4
#23 lore raw

Re: [Qemu-devel] [PATCH 7/7] i386: kill cpudef config section support

Quoted 43 lines · On Wed, 5 Sep 2012 17:41:13 -0300 Eduardo Habkost <[email protected]> wrote:

It's nice to have a flexible system to maintain CPU models as data, but this is holding us from making improvements in the CPU code because it's not using the common infra-structure, and because the machine-type data is still inside C code.

Users who want to configure CPU features directly may simply use the "-cpu" command-line option (and maybe an equivalent -device option in the future) to set CPU features.

---
 target-i386/cpu.c | 101

++---------------------------------------------------- 1 file changed, 2 insertions(+), 99 deletions(-)

target-i386/cpu.c +1 -5
index e13e6d5..7c0953f 100644
@@ -240,7 +240,6 @@ typedef struct x86_def_t {
     uint32_t xlevel;
     char model_id[48];
     int vendor_override;
-    uint32_t flags;
     /* Store the results of Centaur's CPUID instructions */
     uint32_t ext4_features;
     uint32_t xlevel2;
@@ -1299,7 +1298,7 @@ void x86_cpu_list(FILE *f, fprintf_function
 cpu_fprintf) char buf[256];
 
     for (def = x86_defs; def; def = def->next) {
-        snprintf(buf, sizeof (buf), def->flags ? "[%s]": "%s", def->name);
+        snprintf(buf, sizeof(buf), "%s", def->name);
         (*cpu_fprintf)(f, "x86 %16s  %-48s\n", buf, def->model_id);
     }
     if (kvm_enabled()) {
@@ -1393,16 +1392,6 @@ int cpu_x86_register(X86CPU *cpu, const char
 *cpu_model) }
 
 #if !defined(CONFIG_USER_ONLY)
-/* copy vendor id string to 32 bit register, nul pad as needed
- */
-static void cpyid(const char *s, uint32_t *id)

target-i386/cpu.c int cpu_x86_register(X86CPU *cpu, const char · line 1397

Quoted 10 lines
target-i386/cpu.c +0 -7
-{
-    char *d = (char *)id;
-    char i;
-
-    for (i = sizeof (*id); i--; )
-        *d++ = *s ? *s++ : '\0';
-}
 
 /* interpret radix and convert from string to arbitrary scalar,
  * otherwise flag failure

*/
#define setscalar(pval, str, perr) \

is used only from to be removed setfeatures(), could you remove it as well.

Quoted 117 lines
target-i386/cpu.c +0 -81
@@ -1416,87 +1405,6 @@ static void cpyid(const char *s, uint32_t *id)
     *str && !*pend ? (*pval = ul) : (*perr = 1);        \
 }
 
-/* map cpuid options to feature bits, otherwise return failure
- * (option tags in *str are delimited by whitespace)
- */
-static void setfeatures(uint32_t *pval, const char *str,
-    const char **featureset, int *perr)
-{
-    const char *p, *q;
-
-    for (q = p = str; *p || *q; q = p) {
-        while (iswhite(*p))
-            q = ++p;
-        while (*p && !iswhite(*p))
-            ++p;
-        if (!*q && !*p)
-            return;
-        if (!lookup_feature(pval, q, p, featureset)) {
-            fprintf(stderr, "error: feature \"%.*s\" not available in
 set\n",
-                (int)(p - q), q);
-            *perr = 1;
-            return;
-        }
-    }
-}
-
-/* map config file options to x86_def_t form
- */
-static int cpudef_setfield(const char *name, const char *str, void *opaque)
-{
-    x86_def_t *def = opaque;
-    int err = 0;
-
-    if (!strcmp(name, "name")) {
-        g_free((void *)def->name);
-        def->name = g_strdup(str);
-    } else if (!strcmp(name, "model_id")) {
-        strncpy(def->model_id, str, sizeof (def->model_id));
-    } else if (!strcmp(name, "level")) {
-        setscalar(&def->level, str, &err)
-    } else if (!strcmp(name, "vendor")) {
-        cpyid(&str[0], &def->vendor1);
-        cpyid(&str[4], &def->vendor2);
-        cpyid(&str[8], &def->vendor3);
-    } else if (!strcmp(name, "family")) {
-        setscalar(&def->family, str, &err)
-    } else if (!strcmp(name, "model")) {
-        setscalar(&def->model, str, &err)
-    } else if (!strcmp(name, "stepping")) {
-        setscalar(&def->stepping, str, &err)
-    } else if (!strcmp(name, "feature_edx")) {
-        setfeatures(&def->features, str, feature_name, &err);
-    } else if (!strcmp(name, "feature_ecx")) {
-        setfeatures(&def->ext_features, str, ext_feature_name, &err);
-    } else if (!strcmp(name, "extfeature_edx")) {
-        setfeatures(&def->ext2_features, str, ext2_feature_name, &err);
-    } else if (!strcmp(name, "extfeature_ecx")) {
-        setfeatures(&def->ext3_features, str, ext3_feature_name, &err);
-    } else if (!strcmp(name, "xlevel")) {
-        setscalar(&def->xlevel, str, &err)
-    } else {
-        fprintf(stderr, "error: unknown option [%s = %s]\n", name, str);
-        return (1);
-    }
-    if (err) {
-        fprintf(stderr, "error: bad option value [%s = %s]\n", name, str);
-        return (1);
-    }
-    return (0);
-}
-
-/* register config file entry as x86_def_t
- */
-static int cpudef_register(QemuOpts *opts, void *opaque)
-{
-    x86_def_t *def = g_malloc0(sizeof (x86_def_t));
-
-    qemu_opt_foreach(opts, cpudef_setfield, def, 1);
-    def->next = x86_defs;
-    x86_defs = def;
-    return (0);
-}
-
 void cpu_clear_apic_feature(CPUX86State *env)
 {
     env->cpuid_features &= ~CPUID_APIC;
target-i386/cpu.c +1 -2
@@ -1504,8 +1412,7 @@ void cpu_clear_apic_feature(CPUX86State *env)
 
 #endif /* !CONFIG_USER_ONLY */
 
-/* register "cpudef" models defined in configuration file.  Here we first
- * preload any built-in definitions
+/* Initialize list of CPU models, filling some non-static fields if

necessary */
void x86_cpudef_setup(void)
{

target-i386/cpu.c +0 -4
@@ -1515,7 +1422,6 @@ void x86_cpudef_setup(void)
     for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {
         x86_def_t *def = &builtin_x86_defs[i];
         def->next = x86_defs;
-        def->flags = 1;
 
         /* Look for specific "cpudef" models that */
         /* have the QEMU version in .model_id */
@@ -1531,9 +1437,6 @@ void x86_cpudef_setup(void)
 
         x86_defs = def;
     }
-#if !defined(CONFIG_USER_ONLY)
-    qemu_opts_foreach(qemu_find_opts("cpudef"), cpudef_register, NULL, 0);
-#endif
 }
 
 static void get_cpuid_vendor(CPUX86State *env, uint32_t *ebx,
#24 lore raw
In reply to Eduardo Habkost

Hi Eduardo,

Am 05.09.2012 22:41, schrieb Eduardo Habkost:

Quoted 2 lines

This is a small queue of patches that I consider "ready to go", that didn't enter QEMU 1.2.

There's so many x86 CPU series on the list again... Am I understanding correctly that this is the start, applying directly to master? Or does it have further prerequisites?

Would be great to get one batch reviewed and applied, so that we can all test and review from the same base. ;)

Regards,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#25 lore raw
Quoted 9 lines · On Mon, 10 Sep 2012 17:17:03 +0200 Andreas Färber <[email protected]> wrote:

Hi Eduardo,

Am 05.09.2012 22:41, schrieb Eduardo Habkost:

Quoted 2 lines

This is a small queue of patches that I consider "ready to go", that didn't enter QEMU 1.2.

There's so many x86 CPU series on the list again... Am I understanding correctly that this is the start, applying directly to master? Or does it have further prerequisites?

Yes, it's the start without prerequisites.

then goes "[PATCH 0/5] i386: cpu: remove duplicate feature names" and then "[PATCH 00/22 v2] target-i386: convert CPU features into properties"

Quoted 6 lines

Would be great to get one batch reviewed and applied, so that we can all test and review from the same base. ;)

Regards,
Andreas

#26 lore raw

[Qemu-devel] CPU code roadmap (was Re: [PATCH 0/7] x86 CPU patches that didn't get into 1.2)

In reply to Andreas Färber
Quoted 9 lines · Andreas Färber

Hi Eduardo,

Am 05.09.2012 22:41, schrieb Eduardo Habkost:

Quoted 2 lines

This is a small queue of patches that I consider "ready to go", that didn't enter QEMU 1.2.

There's so many x86 CPU series on the list again... Am I understanding correctly that this is the start, applying directly to master? Or does it have further prerequisites?

Correct. This one does not have any prerequisites and used 'master' as base. But it is a prerequisite for many other series.

Quoted 3 lines

Would be great to get one batch reviewed and applied, so that we can all test and review from the same base. ;)

True. At the same time, I wouldn't like to hold from submitting patches for review because others are still pending.

Let's try to be very clear about dependencies on each series, though, to avoid confusion (I could have been more explicit and mentioned that this can be applied directly to master).

I am aware of three "properly ordered" series on the list, by now:

1) This one ("x86 CPU patches that didn't get into 1.2")
2) "unduplicate feature names" series, from myself, explicitly depending on (1)
3) "CPU properties" series, from Igor, explicitly depending on (1) and (2)

And I am aware of the following series, that still need to be rebased/resubmitted:

- "Allow changing of Hypervisor CPUIDs" from Don Slutz
- CPU model classes, from myself
- APIC ID / topology fixes, from myself (previously sent as RFC)
- Make X86CPU child of DeviceState (there are 3 proposals today, and I don't know which one will be adopted

Also, I have plans to submit series for the following:

- Call GET_SUPPORTED_CPUID only once and store the results
- General kvm_arch_get_supported_cpuid() refactor/cleanup
- General refactoring of feature flag handling, to use a generic "feature words" structure
- Fix -cpu check/enforce to properly use GET_SUPPORTED_CPUID
- Fix -cpu host to properly use GET_SUPPORTED_CPUID
- Addition of feature flag names for CPUID leaf 7

Anything else I am missing?

Signature · 1 line
Eduardo
#27 lore raw

Re: [Qemu-devel] CPU code roadmap (was Re: [PATCH 0/7] x86 CPU patches that didn't get into 1.2)

Quoted 26 lines · Eduardo Habkost
Quoted 9 lines · Andreas Färber

Hi Eduardo,

Am 05.09.2012 22:41, schrieb Eduardo Habkost:

Quoted 2 lines

This is a small queue of patches that I consider "ready to go", that didn't enter QEMU 1.2.

There's so many x86 CPU series on the list again... Am I understanding correctly that this is the start, applying directly to master? Or does it have further prerequisites?

Correct. This one does not have any prerequisites and used 'master' as base. But it is a prerequisite for many other series.

Quoted 3 lines

Would be great to get one batch reviewed and applied, so that we can all test and review from the same base. ;)

True. At the same time, I wouldn't like to hold from submitting patches for review because others are still pending.

Let's try to be very clear about dependencies on each series, though, to avoid confusion (I could have been more explicit and mentioned that this can be applied directly to master).

Quoted 6 lines

I am aware of three "properly ordered" series on the list, by now:

1) This one ("x86 CPU patches that didn't get into 1.2")
2) "unduplicate feature names" series, from myself, explicitly depending on (1)
3) "CPU properties" series, from Igor, explicitly depending on (1) and (2)

New item:

4) [PATCH v2 0/4] Allow changing of Hypervisor CPUIDs
http://article.gmane.org/gmane.comp.emulators.kvm.devel/97991

I am keeping the current queue at:
https://github.com/ehabkost/qemu/commits/cpu-queue

Note that "cpu-queue" is going to be a rebased-often branch (with frequent non-fast-forward updates), as it is just a place where I am storing the work in progress while it's being reviewed in the list.

Quoted 25 lines

And I am aware of the following series, that still need to be rebased/resubmitted:

- "Allow changing of Hypervisor CPUIDs" from Don Slutz
- CPU model classes, from myself
- APIC ID / topology fixes, from myself (previously sent as RFC)
- Make X86CPU child of DeviceState (there are 3 proposals today, and I don't know which one will be adopted

Also, I have plans to submit series for the following:

- Call GET_SUPPORTED_CPUID only once and store the results
- General kvm_arch_get_supported_cpuid() refactor/cleanup
- General refactoring of feature flag handling, to use a generic "feature words" structure
- Fix -cpu check/enforce to properly use GET_SUPPORTED_CPUID
- Fix -cpu host to properly use GET_SUPPORTED_CPUID
- Addition of feature flag names for CPUID leaf 7

Anything else I am missing?

Signature · 1 line
Eduardo
Signature · 1 line
Eduardo
#28 lore raw
In reply to Eduardo Habkost

Hi Eduardo,

Am 05.09.2012 22:41, schrieb Eduardo Habkost:

Quoted 10 lines

This is a small queue of patches that I consider "ready to go", that didn't enter QEMU 1.2.

Eduardo Habkost (5):
i386: add missing CPUID_* constants
move CPU models from cpus-x86_64.conf to C
eliminate cpus-x86_64.conf file
x86_cpudef_setup: coding style change
i386: kill cpudef config section support

Quoted 4 lines

Peter Maydell (2):
target-i386: Fold -cpu ?cpuid, ?model output into -cpu help, drop
?dump
Drop cpu_list_id macro

Finished walking through these now and concur that they are ready to go!

I've queued them on my qom-cpu branch (enforcing a consistent "target-i386" subject where applicable; dropping my pending field movements for now) and intend to send a pull shortly.

https://github.com/afaerber/qemu-cpu/commits/qom-cpu

To address Igor's setscalar() review comment, I appended this follow-up:

target-i386/cpu.c +0 -0
index 7c0953f..c2e65ea 100644
@@ -1393,18 +1393,6 @@ int cpu_x86_register(X86CPU *cpu, const char

*cpu_model)

#if !defined(CONFIG_USER_ONLY)

-/* interpret radix and convert from string to arbitrary scalar,
- * otherwise flag failure
- */

-#define setscalar(pval, str, perr)                      \
-{                                                       \
-    char *pend;                                         \
-    unsigned long ul;                                   \
-                                                        \
-    ul = strtoul(str, &pend, 0);                        \
-    *str && !*pend ? (*pval = ul) : (*perr = 1);        \
-}
-
 void cpu_clear_apic_feature(CPUX86State *env)
 {
     env->cpuid_features &= ~CPUID_APIC;

Thanks for helping sort these things out,

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg