From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>
Subject: [Qemu-devel] [PULL 4/8] i386: fix '-cpu ?' output for host cpu type
Date: Fri, 6 Jul 2018 19:14:24 +0200 [thread overview]
Message-ID: <1530897268-22932-5-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1530897268-22932-1-git-send-email-pbonzini@redhat.com>
From: Greg Kurz <groug@kaod.org>
Since commit d6dcc5583e7, '-cpu ?' shows the description of the
X86_CPU_TYPE_NAME("max") for the host CPU model:
Enables all features supported by the accelerator in the current host
instead of the expected:
KVM processor with all supported host features
or
HVF processor with all supported host features
This is caused by the early use of kvm_enabled() and hvf_enabled() in
a class_init function. Since the accelerator isn't configured yet, both
helpers return false unconditionally.
A QEMU binary will only be compiled with one of these accelerators, not
both. The appropriate description can thus be decided at build time.
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <153055056654.212317.4697363278304826913.stgit@bahia.lan>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index b0b87c3..e0e2f2e 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2836,13 +2836,13 @@ static void host_x86_cpu_class_init(ObjectClass *oc, void *data)
xcc->host_cpuid_required = true;
xcc->ordering = 8;
- if (kvm_enabled()) {
- xcc->model_description =
- "KVM processor with all supported host features ";
- } else if (hvf_enabled()) {
- xcc->model_description =
- "HVF processor with all supported host features ";
- }
+#if defined(CONFIG_KVM)
+ xcc->model_description =
+ "KVM processor with all supported host features ";
+#elif defined(CONFIG_HVF)
+ xcc->model_description =
+ "HVF processor with all supported host features ";
+#endif
}
static const TypeInfo host_x86_cpu_type_info = {
--
1.8.3.1
next prev parent reply other threads:[~2018-07-06 17:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-06 17:14 [Qemu-devel] [PULL 0/8] Bug fixes for 2018-07-06 Paolo Bonzini
2018-07-06 17:14 ` [Qemu-devel] [PULL 1/8] pr-helper: avoid error on PR IN command with zero request size Paolo Bonzini
2018-07-06 17:14 ` [Qemu-devel] [PULL 2/8] pr-helper: Rework socket path handling Paolo Bonzini
2018-07-06 17:14 ` [Qemu-devel] [PULL 3/8] qtest: Use cpu address space instead of system memory Paolo Bonzini
2018-07-06 17:14 ` Paolo Bonzini [this message]
2018-07-06 17:14 ` [Qemu-devel] [PULL 5/8] qemu-char: check errno together with ret < 0 Paolo Bonzini
2018-07-06 17:14 ` [Qemu-devel] [PULL 6/8] pr-manager-helper: fix memory leak on event Paolo Bonzini
2018-07-06 17:14 ` [Qemu-devel] [PULL 7/8] ioapic: remove useless lower bounds check Paolo Bonzini
2018-07-06 17:14 ` [Qemu-devel] [PULL 8/8] checkpatch: handle token pasting better Paolo Bonzini
2018-07-06 18:05 ` [Qemu-devel] [PULL 0/8] Bug fixes for 2018-07-06 Peter Maydell
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=1530897268-22932-5-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=groug@kaod.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;
as well as URLs for NNTP newsgroup(s).