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 <ehabk...@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