From 3e68482224129c3ddc061af7c9d438b882ecfdd1 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 3 Nov 2015 17:18:50 -0200 Subject: target-i386: Set "check=off" by default on pc-*-2.4 and older The default CPU model (qemu64) have some issues today: it enables some features (ABM and SSE4a) that are not present in many host CPUs. That means many hosts (but not all of them) had those features silently disabled in the default configuration in QEMU 2.4 and older. With the new "check=on" default, this causes warnings to be printed in the default configuration, because of the lack of SSE4A on all Intel hosts, and the lack of ABM on Sandy Bridge and older hosts: $ qemu-system-x86_64 -machine pc,accel=kvm warning: host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5] warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6] Those issues will be fixed in pc-*-2.5 and newer. But as we can't change the guest ABI in pc-*-2.4, disable "check" mode by default in pc-*-2.4 and older so we don't print spurious warnings. Reviewed-by: Paolo Bonzini Signed-off-by: Eduardo Habkost --- include/hw/i386/pc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 606dbc2..8be4520 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -322,6 +322,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "host" "-" TYPE_X86_CPU,\ .property = "host-cache-info",\ .value = "on",\ + },\ + {\ + .driver = TYPE_X86_CPU,\ + .property = "check",\ + .value = "off",\ }, #define PC_COMPAT_2_3 \ -- cgit v1.1 From 0909ad24b2769368716c85f79fbb995dbb7041a9 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 3 Nov 2015 17:17:33 -0200 Subject: target-i386: Remove SSE4a from qemu64 CPU model SSE4a is not available in any Intel CPU, and we want to make the default CPU runnable in most hosts, so it doesn't make sense to enable it by default in KVM mode. We should eventually have all features supported by TCG enabled by default in TCG mode, but as we don't have a good mechanism today to ensure we have different defaults in KVM and TCG mode, disable SSE4a in the qemu64 CPU model entirely. Reviewed-by: Paolo Bonzini Signed-off-by: Eduardo Habkost --- include/hw/i386/pc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8be4520..bc82c14 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -327,6 +327,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = TYPE_X86_CPU,\ .property = "check",\ .value = "off",\ + },\ + {\ + .driver = "qemu64" "-" TYPE_X86_CPU,\ + .property = "sse4a",\ + .value = "on",\ }, #define PC_COMPAT_2_3 \ -- cgit v1.1 From 711956722c6764336f8b78a2106e57c55f02f36d Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 3 Nov 2015 17:24:18 -0200 Subject: target-i386: Remove ABM from qemu64 CPU model ABM is not available on Sandy Bridge and older, and we want to make the default CPU runnable in most hosts, so it won't be enabled by default in KVM mode. We should eventually have all features supported by TCG enabled by default in TCG mode, but as we don't have a good mechanism today to ensure we have different defaults in KVM and TCG mode, disable ABM in the qemu64 CPU model entirely. Reviewed-by: Paolo Bonzini Signed-off-by: Eduardo Habkost --- include/hw/i386/pc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index bc82c14..8b54863 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -332,6 +332,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "qemu64" "-" TYPE_X86_CPU,\ .property = "sse4a",\ .value = "on",\ + },\ + {\ + .driver = "qemu64" "-" TYPE_X86_CPU,\ + .property = "abm",\ + .value = "on",\ }, #define PC_COMPAT_2_3 \ -- cgit v1.1 From 6aa91e4a0237ddcebb85e3a95e166f3b3cfa42ae Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Tue, 3 Nov 2015 17:24:18 -0200 Subject: target-i386: Remove POPCNT from qemu64 and qemu32 CPU models POPCNT is not available on Penryn and older and on Opteron_G2 and older, and we want to make the default CPU runnable in most hosts, so it won't be enabled by default in KVM mode. We should eventually have all features supported by TCG enabled by default in TCG mode, but as we don't have a good mechanism today to ensure we have different defaults in KVM and TCG mode, disable POPCNT in the qemu64 and qemu32 CPU models entirely. Reviewed-by: Paolo Bonzini Signed-off-by: Eduardo Habkost --- include/hw/i386/pc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 8b54863..4bbc0ff 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -337,6 +337,16 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "qemu64" "-" TYPE_X86_CPU,\ .property = "abm",\ .value = "on",\ + },\ + {\ + .driver = "qemu64" "-" TYPE_X86_CPU,\ + .property = "popcnt",\ + .value = "on",\ + },\ + {\ + .driver = "qemu32" "-" TYPE_X86_CPU,\ + .property = "popcnt",\ + .value = "on",\ }, #define PC_COMPAT_2_3 \ -- cgit v1.1