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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---

Notes:
   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@xxxxxxxxxx>

Jano




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux