Because of the microcode update to Haswell/Broadwell CPUs, existing
domains using these CPUs may fail to start even though they used to run
just fine. To help users solve this issue we try to suggest switching to
-noTSX variant of the CPU model:
virsh # start cd
error: Failed to start domain cd
error: unsupported configuration: guest and host CPU are not
compatible: Host CPU does not provide required features: rtm, hle;
try using 'Haswell-noTSX' CPU model
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
This patch depends on the previous patch which introduces the new
*-noTSX models.
src/qemu/qemu_command.c | 38 +++++++++++++++++++++++++++++++++-----
1 file changed, 33 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7e6b95c..cabb8b2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6807,6 +6807,7 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
size_t ncpus = 0;
char **cpus = NULL;
virCPUDataPtr data = NULL;
+ virCPUDataPtr hostData = NULL;
char *compare_msg = NULL;
virCPUCompareResult cmp;
const char *preferred;
@@ -6838,16 +6839,42 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
/* For non-KVM, CPU features are emulated, so host compat doesn't matter */
if (compareAgainstHost) {
+ bool noTSX = false;
+
cmp = cpuGuestData(host, cpu, &data, &compare_msg);
switch (cmp) {
case VIR_CPU_COMPARE_INCOMPATIBLE:
+ if (cpuEncode(host->arch, host, NULL, &hostData,
+ NULL, NULL, NULL, NULL) == 0 &&
+ (!cpuHasFeature(hostData, "hle") ||
+ !cpuHasFeature(hostData, "rtm")) &&
+ (STREQ_NULLABLE(cpu->model, "Haswell") ||
+ STREQ_NULLABLE(cpu->model, "Broadwell")))
+ noTSX = true;
+
if (compare_msg) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("guest and host CPU are not compatible: %s"),
- compare_msg);
+ if (noTSX) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("guest and host CPU are not compatible: "
+ "%s; try using '%s-noTSX' CPU
model"),
+ compare_msg, cpu->model);
+ } else {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("guest and host CPU are not compatible: "
+ "%s"),
+ compare_msg);
+ }
} else {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("guest CPU is not compatible with host
CPU"));
+ if (noTSX) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("guest CPU is not compatible with host "
+ "CPU; try using '%s-noTSX' CPU
model"),
+ cpu->model);
+ } else {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("guest CPU is not compatible with host "
+ "CPU"));
+ }
}
/* fall through */
case VIR_CPU_COMPARE_ERROR:
@@ -6941,6 +6968,7 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
virObjectUnref(caps);
VIR_FREE(compare_msg);
cpuDataFree(data);
+ cpuDataFree(hostData);
virCPUDefFree(guest);
virCPUDefFree(cpu);
return ret;
--
2.3.3
Show replies by date
On 03/24/2015 07:20 AM, Jiri Denemark wrote:
Because of the microcode update to Haswell/Broadwell CPUs, existing
domains using these CPUs may fail to start even though they used to run
just fine. To help users solve this issue we try to suggest switching to
-noTSX variant of the CPU model:
virsh # start cd
error: Failed to start domain cd
error: unsupported configuration: guest and host CPU are not
compatible: Host CPU does not provide required features: rtm, hle;
try using 'Haswell-noTSX' CPU model
Definitely worth this hint, as a lot of people are being bitten by it
according to bugzilla traffic.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
This patch depends on the previous patch which introduces the new
*-noTSX models.
src/qemu/qemu_command.c | 38 +++++++++++++++++++++++++++++++++-----
1 file changed, 33 insertions(+), 5 deletions(-)
ACK.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org
On Wed, Mar 25, 2015 at 10:37:46 -0600, Eric Blake wrote:
On 03/24/2015 07:20 AM, Jiri Denemark wrote:
> Because of the microcode update to Haswell/Broadwell CPUs, existing
> domains using these CPUs may fail to start even though they used to run
> just fine. To help users solve this issue we try to suggest switching to
> -noTSX variant of the CPU model:
>
> virsh # start cd
> error: Failed to start domain cd
> error: unsupported configuration: guest and host CPU are not
> compatible: Host CPU does not provide required features: rtm, hle;
> try using 'Haswell-noTSX' CPU model
Definitely worth this hint, as a lot of people are being bitten by it
according to bugzilla traffic.
>
> Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
> ---
>
> This patch depends on the previous patch which introduces the new
> *-noTSX models.
>
> src/qemu/qemu_command.c | 38 +++++++++++++++++++++++++++++++++-----
> 1 file changed, 33 insertions(+), 5 deletions(-)
ACK.
Thanks, I pushed this and the previous patch.
Jirka