Patchwork [02/12] target-i386: Improve -cpu ? features output

login
register
mail settings
Submitter Andreas Färber
Date April 16, 2013, 12:46 a.m.
Message ID <1366073209-27119-3-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/236800/
State New
Headers show

Comments

Andreas Färber - April 16, 2013, 12:46 a.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

We were missing a bunch of feature lists. Fix this by simply dumping
the meta list feature_word_info.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 target-i386/cpu.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index b8690d2..0a4e5ae 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1470,14 +1470,12 @@  void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
 #endif
 
     (*cpu_fprintf)(f, "\nRecognized CPUID flags:\n");
-    listflags(buf, sizeof(buf), (uint32_t)~0, feature_name, 1);
-    (*cpu_fprintf)(f, "  %s\n", buf);
-    listflags(buf, sizeof(buf), (uint32_t)~0, ext_feature_name, 1);
-    (*cpu_fprintf)(f, "  %s\n", buf);
-    listflags(buf, sizeof(buf), (uint32_t)~0, ext2_feature_name, 1);
-    (*cpu_fprintf)(f, "  %s\n", buf);
-    listflags(buf, sizeof(buf), (uint32_t)~0, ext3_feature_name, 1);
-    (*cpu_fprintf)(f, "  %s\n", buf);
+    for (i = 0; i < ARRAY_SIZE(feature_word_info); i++) {
+        FeatureWordInfo *fw = &feature_word_info[i];
+
+        listflags(buf, sizeof(buf), (uint32_t)~0, fw->feat_names, 1);
+        (*cpu_fprintf)(f, "  %s\n", buf);
+    }
 }
 
 CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)