From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Richard Henderson <rth@twiddle.net>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH 3/3] target-i386: Don't enable SSE4A by default with KVM
Date: Fri, 30 Oct 2015 17:01:00 -0200 [thread overview]
Message-ID: <1446231660-24394-4-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1446231660-24394-1-git-send-email-ehabkost@redhat.com>
The x86 change to make "check" mode be enabled by default made QEMU print a
warning in the default case if running in an Intel host:
$ qemu-system-x86_64 -machine pc,accel=kvm
warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]
Fix this by not enabling sse4a in qemu64 when in KVM mode.
The long term solution will probably involve creating separate "tcg64" and
"kvm64" CPU models as defaults, so we can finally choose completely diffferent
defaults in the KVM- and TCG-specific models without making the
kvm_default_props list grow too much.
Instead of using X86_CPU_TYPE_NAME("qemu64") on kvm_default_props, the
table will contain both -x86_64-cpu and -i386 entries to make it easier
to move the table to accelerator-specific (and arch-independent) code
later.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
hw/i386/pc_piix.c | 2 ++
hw/i386/pc_q35.c | 2 ++
target-i386/cpu.c | 5 +++++
3 files changed, 9 insertions(+)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index d6616c4..a4cf6b9 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -296,6 +296,8 @@ static void pc_init1(MachineState *machine,
static void pc_compat_2_4(MachineState *machine)
{
+ x86_cpu_change_kvm_default("qemu64-x86_64-cpu", "sse4a", NULL);
+ x86_cpu_change_kvm_default("qemu64-i386-cpu", "sse4a", NULL);
}
static void pc_compat_2_3(MachineState *machine)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index b33fcdc..da0ed8a 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -279,6 +279,8 @@ static void pc_q35_init(MachineState *machine)
static void pc_compat_2_4(MachineState *machine)
{
+ x86_cpu_change_kvm_default("qemu64-x86_64-cpu", "sse4a", NULL);
+ x86_cpu_change_kvm_default("qemu64-i386-cpu", "sse4a", NULL);
}
static void pc_compat_2_3(MachineState *machine)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index b699a2c..c4d6985 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1377,6 +1377,11 @@ static PropValue kvm_default_props[] = {
{ NULL, "acpi", "off" },
{ NULL, "monitor", "off" },
{ NULL, "svm", "off" },
+ /* sse4a is not available on Intel hosts, so don't enable it
+ * in the default CPU model for KVM.
+ */
+ { "qemu64-x86_64-cpu", "sse4a", "off", },
+ { "qemu64-i386-cpu", "sse4a", "off", },
{ NULL, NULL },
};
--
2.1.0
next prev parent reply other threads:[~2015-10-30 19:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 19:00 [Qemu-devel] [PATCH 0/3] target-i386: Don't trigger "check" warnings by default in KVM mode Eduardo Habkost
2015-10-30 19:00 ` [Qemu-devel] [PATCH 1/3] target-i386: Add optional class name to kvm_default_props Eduardo Habkost
2015-10-30 19:00 ` [Qemu-devel] [PATCH 2/3] pc: Create pc_compat_2_4() function Eduardo Habkost
2015-10-30 19:01 ` Eduardo Habkost [this message]
2015-10-30 19:13 ` [Qemu-devel] [PATCH 0/3] target-i386: Don't trigger "check" warnings by default in KVM mode Eduardo Habkost
2015-11-02 11:37 ` Paolo Bonzini
2015-11-03 16:41 ` Eduardo Habkost
2015-11-03 17:21 ` Paolo Bonzini
2015-11-03 17:54 ` Eduardo Habkost
2015-11-03 17:41 ` Eduardo Habkost
2015-11-03 17:49 ` Paolo Bonzini
2015-11-03 17:56 ` Eduardo Habkost
2015-11-03 19:53 ` Paolo Bonzini
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=1446231660-24394-4-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).