Glauber Costa 230a700
From d01f3fea76975026f4308bdd214004b9312cd9ea Mon Sep 17 00:00:00 2001
Glauber Costa 230a700
From: Avi Kivity <avi@redhat.com>
Glauber Costa 230a700
Date: Sun, 3 May 2009 17:04:02 +0300
Glauber Costa 230a700
Subject: [PATCH STABLE 1/3] Make x86 cpuid feature names available in file scope
Glauber Costa 230a700
Glauber Costa 230a700
To be used later.
Glauber Costa 230a700
Glauber Costa 230a700
Signed-off-by: Avi Kivity <avi@redhat.com>
Glauber Costa 230a700
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Glauber Costa 230a700
Signed-off-by: Glauber Costa <glommer@redhat.com>
Glauber Costa 230a700
---
Glauber Costa 230a700
 target-i386/helper.c |   55 +++++++++++++++++++++++++------------------------
Glauber Costa 230a700
 1 files changed, 28 insertions(+), 27 deletions(-)
Glauber Costa 230a700
Glauber Costa 230a700
diff --git a/target-i386/helper.c b/target-i386/helper.c
Glauber Costa 230a700
index 8213703..3eb9697 100644
Glauber Costa 230a700
--- a/target-i386/helper.c
Glauber Costa 230a700
+++ b/target-i386/helper.c
Glauber Costa 230a700
@@ -32,39 +32,40 @@
Glauber Costa 230a700
 
Glauber Costa 230a700
 //#define DEBUG_MMU
Glauber Costa 230a700
 
Glauber Costa 230a700
+/* feature flags taken from "Intel Processor Identification and the CPUID
Glauber Costa 230a700
+ * Instruction" and AMD's "CPUID Specification". In cases of disagreement
Glauber Costa 230a700
+ * about feature names, the Linux name is used. */
Glauber Costa 230a700
+static const char *feature_name[] = {
Glauber Costa 230a700
+    "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
Glauber Costa 230a700
+    "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
Glauber Costa 230a700
+    "pat", "pse36", "pn" /* Intel psn */, "clflush" /* Intel clfsh */, NULL, "ds" /* Intel dts */, "acpi", "mmx",
Glauber Costa 230a700
+    "fxsr", "sse", "sse2", "ss", "ht" /* Intel htt */, "tm", "ia64", "pbe",
Glauber Costa 230a700
+};
Glauber Costa 230a700
+static const char *ext_feature_name[] = {
Glauber Costa 230a700
+    "pni" /* Intel,AMD sse3 */, NULL, NULL, "monitor", "ds_cpl", "vmx", NULL /* Linux smx */, "est",
Glauber Costa 230a700
+    "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL,
Glauber Costa 230a700
+    NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt",
Glauber Costa 230a700
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Glauber Costa 230a700
+};
Glauber Costa 230a700
+static const char *ext2_feature_name[] = {
Glauber Costa 230a700
+    "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
Glauber Costa 230a700
+    "cx8" /* AMD CMPXCHG8B */, "apic", NULL, "syscall", "mtrr", "pge", "mca", "cmov",
Glauber Costa 230a700
+    "pat", "pse36", NULL, NULL /* Linux mp */, "nx" /* Intel xd */, NULL, "mmxext", "mmx",
Glauber Costa 230a700
+    "fxsr", "fxsr_opt" /* AMD ffxsr */, "pdpe1gb" /* AMD Page1GB */, "rdtscp", NULL, "lm" /* Intel 64 */, "3dnowext", "3dnow",
Glauber Costa 230a700
+};
Glauber Costa 230a700
+static const char *ext3_feature_name[] = {
Glauber Costa 230a700
+    "lahf_lm" /* AMD LahfSahf */, "cmp_legacy", "svm", "extapic" /* AMD ExtApicSpace */, "cr8legacy" /* AMD AltMovCr8 */, "abm", "sse4a", "misalignsse",
Glauber Costa 230a700
+    "3dnowprefetch", "osvw", NULL /* Linux ibs */, NULL, "skinit", "wdt", NULL, NULL,
Glauber Costa 230a700
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Glauber Costa 230a700
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Glauber Costa 230a700
+};
Glauber Costa 230a700
+
Glauber Costa 230a700
 static void add_flagname_to_bitmaps(char *flagname, uint32_t *features, 
Glauber Costa 230a700
                                     uint32_t *ext_features, 
Glauber Costa 230a700
                                     uint32_t *ext2_features, 
Glauber Costa 230a700
                                     uint32_t *ext3_features)
Glauber Costa 230a700
 {
Glauber Costa 230a700
     int i;
Glauber Costa 230a700
-    /* feature flags taken from "Intel Processor Identification and the CPUID
Glauber Costa 230a700
-     * Instruction" and AMD's "CPUID Specification". In cases of disagreement 
Glauber Costa 230a700
-     * about feature names, the Linux name is used. */
Glauber Costa 230a700
-    static const char *feature_name[] = {
Glauber Costa 230a700
-        "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
Glauber Costa 230a700
-        "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov",
Glauber Costa 230a700
-        "pat", "pse36", "pn" /* Intel psn */, "clflush" /* Intel clfsh */, NULL, "ds" /* Intel dts */, "acpi", "mmx",
Glauber Costa 230a700
-        "fxsr", "sse", "sse2", "ss", "ht" /* Intel htt */, "tm", "ia64", "pbe",
Glauber Costa 230a700
-    };
Glauber Costa 230a700
-    static const char *ext_feature_name[] = {
Glauber Costa 230a700
-       "pni" /* Intel,AMD sse3 */, NULL, NULL, "monitor", "ds_cpl", "vmx", NULL /* Linux smx */, "est",
Glauber Costa 230a700
-       "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL,
Glauber Costa 230a700
-       NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt",
Glauber Costa 230a700
-       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Glauber Costa 230a700
-    };
Glauber Costa 230a700
-    static const char *ext2_feature_name[] = {
Glauber Costa 230a700
-       "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
Glauber Costa 230a700
-       "cx8" /* AMD CMPXCHG8B */, "apic", NULL, "syscall", "mtrr", "pge", "mca", "cmov",
Glauber Costa 230a700
-       "pat", "pse36", NULL, NULL /* Linux mp */, "nx" /* Intel xd */, NULL, "mmxext", "mmx",
Glauber Costa 230a700
-       "fxsr", "fxsr_opt" /* AMD ffxsr */, "pdpe1gb" /* AMD Page1GB */, "rdtscp", NULL, "lm" /* Intel 64 */, "3dnowext", "3dnow",
Glauber Costa 230a700
-    };
Glauber Costa 230a700
-    static const char *ext3_feature_name[] = {
Glauber Costa 230a700
-       "lahf_lm" /* AMD LahfSahf */, "cmp_legacy", "svm", "extapic" /* AMD ExtApicSpace */, "cr8legacy" /* AMD AltMovCr8 */, "abm", "sse4a", "misalignsse",
Glauber Costa 230a700
-       "3dnowprefetch", "osvw", NULL /* Linux ibs */, NULL, "skinit", "wdt", NULL, NULL,
Glauber Costa 230a700
-       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Glauber Costa 230a700
-       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
Glauber Costa 230a700
-    };
Glauber Costa 230a700
 
Glauber Costa 230a700
     for ( i = 0 ; i < 32 ; i++ ) 
Glauber Costa 230a700
         if (feature_name[i] && !strcmp (flagname, feature_name[i])) {
Glauber Costa 230a700
-- 
Glauber Costa 230a700
1.5.6.6
Glauber Costa 230a700