From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: "Igor Mammedov" <imammedo@redhat.com>, kvm <kvm@vger.kernel.org>,
qemu-devel <qemu-devel@nongnu.org>,
"Andreas Färber" <afaerber@suse.de>,
"Eduardo Habkost" <ehabkost@redhat.com>
Subject: [PATCH v2] target-i386: Improve x86_cpu_list output
Date: Wed, 27 Feb 2013 10:15:51 +0100 [thread overview]
Message-ID: <512DCEC7.3030902@siemens.com> (raw)
Several issues fixed:
- We were missing a bunch of feature lists. Fix this by simply dumping
the meta list feature_word_info.
- kvm_enabled() cannot be true at this point because accelerators are
initialized much later during init. Also, hiding this makes it very
hard to discover for users. Simply dump unconditionally if CONFIG_KVM
is set.
- Add explanation for "host" CPU type.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Changes in v2:
- Do not dump "host" type if CONFIG_KVM is not set
- Explain that "host" depends on KVM mode
target-i386/cpu.c | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 5582e5f..b4189c3 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1463,18 +1463,19 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
snprintf(buf, sizeof(buf), "%s", def->name);
(*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id);
}
- if (kvm_enabled()) {
- (*cpu_fprintf)(f, "x86 %16s\n", "[host]");
- }
+#ifdef CONFIG_KVM
+ (*cpu_fprintf)(f, "x86 %16s %-48s\n", "host",
+ "KVM processor with all supported host features "
+ "(only available in KVM mode)");
+#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)
--
1.7.3.4
next reply other threads:[~2013-02-27 9:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 9:15 Jan Kiszka [this message]
2013-02-27 9:30 ` [PATCH v2] target-i386: Improve x86_cpu_list output Igor Mammedov
2013-02-27 9:33 ` Andreas Färber
2013-02-27 9:37 ` Jan Kiszka
2013-03-24 17:38 ` [Qemu-devel] " Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=512DCEC7.3030902@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox