[libvirt PATCH v2 11/14] qemu_capabilities: Translate CPU blockers

Ján Tomko jtomko at redhat.com
Mon Oct 10 11:25:56 UTC 2022

On a Friday in 2022, Jiri Denemark wrote:
>Since commit "cpu_x86: Disable blockers from unusable CPU models"
>(v3.8.0-99-g9c9620af1d) we explicitly disable CPU features reported by
>QEMU as usability blockers for a particular CPU model when creating
>baseline or host-model CPU definition. When QEMU changed canonical names
>for some features (mostly those with '_' in their names), we forgot to
>translate the blocker lists to names used by libvirt and the renamed
>features would no longer be explicitly disabled in the created CPU model
>even if they were reported as blockers by QEMU.
>For example, on a host where EPYC CPU model has the following blockers
>    <blocker name='sha-ni'/>
>    <blocker name='mmxext'/>
>    <blocker name='fxsr-opt'/>
>    <blocker name='cr8legacy'/>
>    <blocker name='sse4a'/>
>    <blocker name='misalignsse'/>
>    <blocker name='osvw'/>
>we would fail to disable 'fxsr-opt':
>    <cpu mode='custom' match='exact'>
>      <model fallback='forbid'>EPYC</model>
>      <feature policy='disable' name='sha-ni'/>
>      <feature policy='disable' name='mmxext'/>
>      <feature policy='disable' name='cr8legacy'/>
>      <feature policy='disable' name='sse4a'/>
>      <feature policy='disable' name='misalignsse'/>
>      <feature policy='disable' name='osvw'/>
>      <feature policy='disable' name='monitor'/>
>    </cpu>
>The 'monitor' feature is disabled even though it is not reported as a
>blocker by QEMU because libvirt's definition of EPYC includes the
>feature while it is missing in EPYC definition in QEMU.
>Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
>    Version 2:
>    - also translate blockers when fetching them from QEMU (in
>      virQEMUCapsFetchCPUDefinitions)
>    - rewritten commit message
> src/qemu/qemu_capabilities.c | 42 ++++++++++++++++++++++++++++++------
> src/qemu/qemu_capabilities.h |  4 ++++
> 2 files changed, 40 insertions(+), 6 deletions(-)

Reviewed-by: Ján Tomko <jtomko at redhat.com>


More information about the libvir-list mailing list