mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
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=1749672 Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
6b4cc15730
commit
9cd03f7957
@ -54,7 +54,6 @@
|
||||
<feature name='pat'/>
|
||||
<feature name='pcid'/>
|
||||
<feature name='pclmuldq'/>
|
||||
<feature name='pconfig'/>
|
||||
<feature name='pdpe1gb'/>
|
||||
<feature name='pge'/>
|
||||
<feature name='pku'/>
|
||||
|
@ -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
|
||||
qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
@ -9092,6 +9112,9 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
|
||||
if (!(def->cpu = virCPUDefCopy(origCPU)))
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainMakeCPUMigratable(def->cpu) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
format:
|
||||
|
@ -1225,3 +1225,6 @@ qemuDomainValidateActualNetDef(const virDomainNetDef *net,
|
||||
int
|
||||
qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm)
|
||||
G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
int
|
||||
qemuDomainMakeCPUMigratable(virCPUDefPtr cpu);
|
||||
|
@ -535,6 +535,9 @@ qemuMigrationCookieAddCPU(qemuMigrationCookiePtr mig,
|
||||
if (!(mig->cpu = virCPUDefCopy(vm->def->cpu)))
|
||||
return -1;
|
||||
|
||||
if (qemuDomainMakeCPUMigratable(mig->cpu) < 0)
|
||||
return -1;
|
||||
|
||||
mig->flags |= QEMU_MIGRATION_COOKIE_CPU;
|
||||
|
||||
return 0;
|
||||
|
@ -32,5 +32,4 @@
|
||||
<feature policy='require' name='rdctl-no'/>
|
||||
<feature policy='require' name='ibrs-all'/>
|
||||
<feature policy='require' name='skip-l1dfl-vmentry'/>
|
||||
<feature policy='disable' name='pconfig'/>
|
||||
</cpu>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<cpu>
|
||||
<arch>x86_64</arch>
|
||||
<model>Icelake-Client</model>
|
||||
<model>Icelake-Server</model>
|
||||
<vendor>Intel</vendor>
|
||||
<feature name='ds'/>
|
||||
<feature name='acpi'/>
|
||||
@ -21,23 +21,14 @@
|
||||
<feature name='osxsave'/>
|
||||
<feature name='tsc_adjust'/>
|
||||
<feature name='cmt'/>
|
||||
<feature name='avx512f'/>
|
||||
<feature name='avx512dq'/>
|
||||
<feature name='avx512ifma'/>
|
||||
<feature name='clflushopt'/>
|
||||
<feature name='clwb'/>
|
||||
<feature name='avx512cd'/>
|
||||
<feature name='sha-ni'/>
|
||||
<feature name='avx512bw'/>
|
||||
<feature name='avx512vl'/>
|
||||
<feature name='ospke'/>
|
||||
<feature name='la57'/>
|
||||
<feature name='stibp'/>
|
||||
<feature name='arch-capabilities'/>
|
||||
<feature name='xsaves'/>
|
||||
<feature name='mbm_total'/>
|
||||
<feature name='mbm_local'/>
|
||||
<feature name='pdpe1gb'/>
|
||||
<feature name='invtsc'/>
|
||||
<feature name='rdctl-no'/>
|
||||
<feature name='ibrs-all'/>
|
||||
|
@ -13,5 +13,4 @@
|
||||
<feature policy='require' name='ibrs-all'/>
|
||||
<feature policy='require' name='skip-l1dfl-vmentry'/>
|
||||
<feature policy='disable' name='intel-pt'/>
|
||||
<feature policy='disable' name='pconfig'/>
|
||||
</cpu>
|
||||
|
Loading…
x
Reference in New Issue
Block a user