提交 9cd03f79 编写于 作者: J Jiri Denemark

cpu_map: Drop pconfig from Icelake-Server CPU model

The pconfig feature was enabled in QEMU by accident in 3.1.0. All other
newer versions do not support it and it was removed from the
Icelake-Server CPU model in QEMU.

We don't normally change our CPU models even when QEMU does so to avoid
breaking migrations between different versions of libvirt. But we can
safely do so in this specific case. QEMU never supported enabling
pconfig so any domain which was able to start has pconfig disabled.

With a small compatibility hack which explicitly disables pconfig when
CPU model equals Icelake-Server in migratable domain definition, only
one migration scenario stays broken (and there's nothing we can do about
it): from any host to a host with libvirt < 5.10.0 and QEMU > 3.1.0.

https://bugzilla.redhat.com/show_bug.cgi?id=1749672Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 6b4cc157
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
<feature name='pat'/> <feature name='pat'/>
<feature name='pcid'/> <feature name='pcid'/>
<feature name='pclmuldq'/> <feature name='pclmuldq'/>
<feature name='pconfig'/>
<feature name='pdpe1gb'/> <feature name='pdpe1gb'/>
<feature name='pge'/> <feature name='pge'/>
<feature name='pku'/> <feature name='pku'/>
......
...@@ -8910,6 +8910,26 @@ qemuDomainDefCopy(virQEMUDriverPtr driver, ...@@ -8910,6 +8910,26 @@ qemuDomainDefCopy(virQEMUDriverPtr driver,
} }
int
qemuDomainMakeCPUMigratable(virCPUDefPtr cpu)
{
if (cpu->mode == VIR_CPU_MODE_CUSTOM &&
STREQ_NULLABLE(cpu->model, "Icelake-Server")) {
/* Originally Icelake-Server CPU model contained pconfig CPU feature.
* It was never actually enabled and thus it was removed. To enable
* migration to QEMU 3.1.0 (with both new and old libvirt), we
* explicitly disable pconfig in migration XML (otherwise old libvirt
* would think it was implicitly enabled on the source). New libvirt
* will drop it from the XML before starting the domain on new QEMU.
*/
if (virCPUDefUpdateFeature(cpu, "pconfig", VIR_CPU_FEATURE_DISABLE) < 0)
return -1;
}
return 0;
}
static int static int
qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
virQEMUCapsPtr qemuCaps, virQEMUCapsPtr qemuCaps,
...@@ -9092,6 +9112,9 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, ...@@ -9092,6 +9112,9 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
if (!(def->cpu = virCPUDefCopy(origCPU))) if (!(def->cpu = virCPUDefCopy(origCPU)))
goto cleanup; goto cleanup;
} }
if (qemuDomainMakeCPUMigratable(def->cpu) < 0)
goto cleanup;
} }
format: format:
......
...@@ -1225,3 +1225,6 @@ qemuDomainValidateActualNetDef(const virDomainNetDef *net, ...@@ -1225,3 +1225,6 @@ qemuDomainValidateActualNetDef(const virDomainNetDef *net,
int int
qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm)
G_GNUC_WARN_UNUSED_RESULT; G_GNUC_WARN_UNUSED_RESULT;
int
qemuDomainMakeCPUMigratable(virCPUDefPtr cpu);
...@@ -535,6 +535,9 @@ qemuMigrationCookieAddCPU(qemuMigrationCookiePtr mig, ...@@ -535,6 +535,9 @@ qemuMigrationCookieAddCPU(qemuMigrationCookiePtr mig,
if (!(mig->cpu = virCPUDefCopy(vm->def->cpu))) if (!(mig->cpu = virCPUDefCopy(vm->def->cpu)))
return -1; return -1;
if (qemuDomainMakeCPUMigratable(mig->cpu) < 0)
return -1;
mig->flags |= QEMU_MIGRATION_COOKIE_CPU; mig->flags |= QEMU_MIGRATION_COOKIE_CPU;
return 0; return 0;
......
...@@ -32,5 +32,4 @@ ...@@ -32,5 +32,4 @@
<feature policy='require' name='rdctl-no'/> <feature policy='require' name='rdctl-no'/>
<feature policy='require' name='ibrs-all'/> <feature policy='require' name='ibrs-all'/>
<feature policy='require' name='skip-l1dfl-vmentry'/> <feature policy='require' name='skip-l1dfl-vmentry'/>
<feature policy='disable' name='pconfig'/>
</cpu> </cpu>
<cpu> <cpu>
<arch>x86_64</arch> <arch>x86_64</arch>
<model>Icelake-Client</model> <model>Icelake-Server</model>
<vendor>Intel</vendor> <vendor>Intel</vendor>
<feature name='ds'/> <feature name='ds'/>
<feature name='acpi'/> <feature name='acpi'/>
...@@ -21,23 +21,14 @@ ...@@ -21,23 +21,14 @@
<feature name='osxsave'/> <feature name='osxsave'/>
<feature name='tsc_adjust'/> <feature name='tsc_adjust'/>
<feature name='cmt'/> <feature name='cmt'/>
<feature name='avx512f'/>
<feature name='avx512dq'/>
<feature name='avx512ifma'/> <feature name='avx512ifma'/>
<feature name='clflushopt'/>
<feature name='clwb'/>
<feature name='avx512cd'/>
<feature name='sha-ni'/> <feature name='sha-ni'/>
<feature name='avx512bw'/>
<feature name='avx512vl'/>
<feature name='ospke'/> <feature name='ospke'/>
<feature name='la57'/>
<feature name='stibp'/> <feature name='stibp'/>
<feature name='arch-capabilities'/> <feature name='arch-capabilities'/>
<feature name='xsaves'/> <feature name='xsaves'/>
<feature name='mbm_total'/> <feature name='mbm_total'/>
<feature name='mbm_local'/> <feature name='mbm_local'/>
<feature name='pdpe1gb'/>
<feature name='invtsc'/> <feature name='invtsc'/>
<feature name='rdctl-no'/> <feature name='rdctl-no'/>
<feature name='ibrs-all'/> <feature name='ibrs-all'/>
......
...@@ -13,5 +13,4 @@ ...@@ -13,5 +13,4 @@
<feature policy='require' name='ibrs-all'/> <feature policy='require' name='ibrs-all'/>
<feature policy='require' name='skip-l1dfl-vmentry'/> <feature policy='require' name='skip-l1dfl-vmentry'/>
<feature policy='disable' name='intel-pt'/> <feature policy='disable' name='intel-pt'/>
<feature policy='disable' name='pconfig'/>
</cpu> </cpu>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册