提交 84527790 编写于 作者: J Jiri Denemark

cpu_x86: Drop noTSX hint for incompatible CPUs

The hint was introduced a long time ago when broken TSX implementation
was found in Haswell and Broadwell CPUs. Since then many more CPUs with
TSX were introduced and and disabled due to TAA vulnerability.

Thus the hint is not very useful and I think removing it is a better
choice then updating it to cover all current noTSX models.

This partially reverts:
commit 7f127ded
    cpu: Rework cpuCompare* APIs
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 d9a48d76
...@@ -1937,8 +1937,6 @@ virCPUx86Compare(virCPUDefPtr host, ...@@ -1937,8 +1937,6 @@ virCPUx86Compare(virCPUDefPtr host,
bool failIncompatible) bool failIncompatible)
{ {
virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR; virCPUCompareResult ret = VIR_CPU_COMPARE_ERROR;
virCPUx86MapPtr map;
virCPUx86ModelPtr model = NULL;
char *message = NULL; char *message = NULL;
if (!host || !host->model) { if (!host || !host->model) {
...@@ -1954,46 +1952,16 @@ virCPUx86Compare(virCPUDefPtr host, ...@@ -1954,46 +1952,16 @@ virCPUx86Compare(virCPUDefPtr host,
ret = x86Compute(host, cpu, NULL, &message); ret = x86Compute(host, cpu, NULL, &message);
if (ret == VIR_CPU_COMPARE_INCOMPATIBLE) { if (ret == VIR_CPU_COMPARE_INCOMPATIBLE && failIncompatible) {
bool noTSX = false; ret = VIR_CPU_COMPARE_ERROR;
if (message)
if (STREQ_NULLABLE(cpu->model, "Haswell") || virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", message);
STREQ_NULLABLE(cpu->model, "Broadwell")) { else
if (!(map = virCPUx86GetMap())) virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL);
goto cleanup;
if (!(model = x86ModelFromCPU(cpu, map, -1)))
goto cleanup;
noTSX = !x86FeatureInData("hle", &model->data, map) ||
!x86FeatureInData("rtm", &model->data, map);
}
if (failIncompatible) {
ret = VIR_CPU_COMPARE_ERROR;
if (message) {
if (noTSX) {
virReportError(VIR_ERR_CPU_INCOMPATIBLE,
_("%s; try using '%s-noTSX' CPU model"),
message, cpu->model);
} else {
virReportError(VIR_ERR_CPU_INCOMPATIBLE, "%s", message);
}
} else {
if (noTSX) {
virReportError(VIR_ERR_CPU_INCOMPATIBLE,
_("try using '%s-noTSX' CPU model"),
cpu->model);
} else {
virReportError(VIR_ERR_CPU_INCOMPATIBLE, NULL);
}
}
}
} }
cleanup: cleanup:
VIR_FREE(message); VIR_FREE(message);
x86ModelFree(model);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册