[libvirt PATCH 10/11] domain_capabilities: Add blockers attribute for CPU models

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

 



We already show whether a specific CPU model is usable on the current
host without modification via the 'usable' attribute of each CPU model.
But it may be useful to actually see what features are blocking each CPU
model from being usable. Especially when we already fetch the info from
QEMU and propagating it to domain capabilities XML is all we need to do.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 docs/formatdomaincaps.rst                     | 16 ++--
 src/conf/domain_capabilities.c                |  7 ++
 src/conf/schemas/domaincaps.rng               |  5 ++
 .../domaincapsdata/qemu_4.2.0-q35.x86_64.xml  | 36 ++++-----
 .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  | 72 +++++++++---------
 tests/domaincapsdata/qemu_4.2.0.s390x.xml     |  2 +-
 tests/domaincapsdata/qemu_4.2.0.x86_64.xml    | 36 ++++-----
 .../domaincapsdata/qemu_5.0.0-q35.x86_64.xml  | 40 +++++-----
 .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  | 72 +++++++++---------
 tests/domaincapsdata/qemu_5.0.0.x86_64.xml    | 40 +++++-----
 .../domaincapsdata/qemu_5.1.0-q35.x86_64.xml  | 68 ++++++++---------
 .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  | 72 +++++++++---------
 tests/domaincapsdata/qemu_5.1.0.x86_64.xml    | 68 ++++++++---------
 .../domaincapsdata/qemu_5.2.0-q35.x86_64.xml  | 68 ++++++++---------
 .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  | 72 +++++++++---------
 tests/domaincapsdata/qemu_5.2.0.x86_64.xml    | 68 ++++++++---------
 .../domaincapsdata/qemu_6.0.0-q35.x86_64.xml  | 70 +++++++++---------
 .../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml  | 74 +++++++++----------
 tests/domaincapsdata/qemu_6.0.0.x86_64.xml    | 70 +++++++++---------
 .../domaincapsdata/qemu_6.1.0-q35.x86_64.xml  | 70 +++++++++---------
 .../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml  | 74 +++++++++----------
 tests/domaincapsdata/qemu_6.1.0.x86_64.xml    | 70 +++++++++---------
 .../domaincapsdata/qemu_6.2.0-q35.x86_64.xml  | 70 +++++++++---------
 .../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml  | 74 +++++++++----------
 tests/domaincapsdata/qemu_6.2.0.x86_64.xml    | 70 +++++++++---------
 .../domaincapsdata/qemu_7.0.0-q35.x86_64.xml  | 70 +++++++++---------
 .../domaincapsdata/qemu_7.0.0-tcg.x86_64.xml  | 74 +++++++++----------
 tests/domaincapsdata/qemu_7.0.0.x86_64.xml    | 70 +++++++++---------
 .../domaincapsdata/qemu_7.1.0-q35.x86_64.xml  | 66 ++++++++---------
 .../domaincapsdata/qemu_7.1.0-tcg.x86_64.xml  | 70 +++++++++---------
 tests/domaincapsdata/qemu_7.1.0.x86_64.xml    | 66 ++++++++---------
 31 files changed, 907 insertions(+), 893 deletions(-)

diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst
index 6ce780fb69..81211a3fe6 100644
--- a/docs/formatdomaincaps.rst
+++ b/docs/formatdomaincaps.rst
@@ -191,10 +191,10 @@ CPUs <formatdomain.html#cpu-model-and-topology>`__.
          <feature policy='require' name='vmx'/>
        </mode>
        <mode name='custom' supported='yes'>
-         <model usable='no' deprecated='no' vendor='Intel'>Broadwell</model>
+         <model usable='no' deprecated='no' vendor='Intel' blockers='hle,rtm'>Broadwell</model>
          <model usable='yes' deprecated='no' vendor='Intel'>Broadwell-noTSX</model>
-         <model usable='no' deprecated='yes' vendor='Intel'>Haswell</model>
-         <model usable='no' deprecated='no' vendor='AMD'>EPYC-Milan</model>
+         <model usable='no' deprecated='yes' vendor='Intel' blockers='hle,rtm'>Haswell</model>
+         <model usable='no' deprecated='no' vendor='AMD' blockers='pcid,erms,invpcid,pku,fsrm,ibrs,pku'>EPYC-Milan</model>
          ...
        </mode>
      </cpu>
@@ -224,10 +224,12 @@ more details about it:
    by a dedicated ``model`` element. The ``usable`` attribute specifies whether
    the model can be used directly on the host. When usable='no' the
    corresponding model cannot be used without disabling some features that the
-   CPU of such model is expected to have. A special value ``unknown`` indicates
-   libvirt does not have enough information to provide the usability data. The
-   ``deprecated`` attribute reflects the hypervisor's policy on usage of this
-   model :since:`(since 7.1.0)`. The ``vendor`` attribute :since:`(since 8.9.0)`
+   CPU of such model is expected to have. :since:`Since 8.9.0` the ``blockers``
+   attribute contains a comma separated list of these features. A special value
+   ``unknown`` of the attribute ``usable`` indicates libvirt does not have
+   enough information to provide the usability data. The ``deprecated``
+   attribute reflects the hypervisor's policy on usage of this model
+   :since:`(since 7.1.0)`. The ``vendor`` attribute :since:`(since 8.9.0)`
    contains the vendor of the CPU model for users who want to use CPU models
    with specific vendors only. CPU models with undefined vendor will be listed
    with ``vendor='unkwnown'``.
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index b5d8288982..4a6418ca37 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -386,6 +386,13 @@ virDomainCapsCPUCustomFormat(virBuffer *buf,
         else
             virBufferAddLit(buf, " vendor='unknown'");
 
+        if (model->usable == VIR_DOMCAPS_CPU_USABLE_NO &&
+            model->blockers &&
+            *model->blockers) {
+            virBufferAsprintf(buf, " blockers='%s'",
+                              g_strjoinv(",", model->blockers));
+        }
+
         virBufferAsprintf(buf, ">%s</model>\n", model->name);
     }
 
diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng
index c4cb9afeba..7783b49585 100644
--- a/src/conf/schemas/domaincaps.rng
+++ b/src/conf/schemas/domaincaps.rng
@@ -162,6 +162,11 @@
           <attribute name='vendor'>
             <text/>
           </attribute>
+          <optional>
+            <attribute name='blockers'>
+              <text/>
+            </attribute>
+          </optional>
           <text/>
         </element>
       </zeroOrMore>
diff --git a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
index dab12e5888..8ca9e8d2b2 100644
--- a/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
+++ b/tests/domaincapsdata/qemu_4.2.0-q35.x86_64.xml
@@ -63,7 +63,7 @@
     <mode name='custom' supported='yes'>
       <model usable='yes' vendor='unknown'>qemu64</model>
       <model usable='yes' vendor='unknown'>qemu32</model>
-      <model usable='no' vendor='AMD'>phenom</model>
+      <model usable='no' vendor='AMD' blockers='mmxext,fxsr_opt,3dnowext,3dnow,sse4a,npt'>phenom</model>
       <model usable='yes' vendor='unknown'>pentium3</model>
       <model usable='yes' vendor='unknown'>pentium2</model>
       <model usable='yes' vendor='unknown'>pentium</model>
@@ -72,42 +72,42 @@
       <model usable='yes' vendor='unknown'>kvm32</model>
       <model usable='yes' vendor='Intel'>coreduo</model>
       <model usable='yes' vendor='Intel'>core2duo</model>
-      <model usable='no' vendor='AMD'>athlon</model>
+      <model usable='no' vendor='AMD' blockers='mmxext,3dnowext,3dnow'>athlon</model>
       <model usable='yes' vendor='Intel'>Westmere-IBRS</model>
       <model usable='yes' vendor='Intel'>Westmere</model>
-      <model usable='no' vendor='Intel'>Snowridge</model>
-      <model usable='no' vendor='Intel'>Skylake-Server-noTSX-IBRS</model>
-      <model usable='no' vendor='Intel'>Skylake-Server-IBRS</model>
-      <model usable='no' vendor='Intel'>Skylake-Server</model>
+      <model usable='no' vendor='Intel' blockers='clwb,sha-ni,gfni,cldemote,movdiri,movdir64b,core-capability,split-lock-detect'>Snowridge</model>
+      <model usable='no' vendor='Intel' blockers='avx512f,avx512dq,clwb,avx512cd,avx512bw,avx512vl,pku,avx512f,avx512f,avx512f,pku'>Skylake-Server-noTSX-IBRS</model>
+      <model usable='no' vendor='Intel' blockers='avx512f,avx512dq,clwb,avx512cd,avx512bw,avx512vl,pku,avx512f,avx512f,avx512f,pku'>Skylake-Server-IBRS</model>
+      <model usable='no' vendor='Intel' blockers='avx512f,avx512dq,clwb,avx512cd,avx512bw,avx512vl,pku,avx512f,avx512f,avx512f,pku'>Skylake-Server</model>
       <model usable='yes' vendor='Intel'>Skylake-Client-noTSX-IBRS</model>
       <model usable='yes' vendor='Intel'>Skylake-Client-IBRS</model>
       <model usable='yes' vendor='Intel'>Skylake-Client</model>
       <model usable='yes' vendor='Intel'>SandyBridge-IBRS</model>
       <model usable='yes' vendor='Intel'>SandyBridge</model>
       <model usable='yes' vendor='Intel'>Penryn</model>
-      <model usable='no' vendor='AMD'>Opteron_G5</model>
-      <model usable='no' vendor='AMD'>Opteron_G4</model>
-      <model usable='no' vendor='AMD'>Opteron_G3</model>
+      <model usable='no' vendor='AMD' blockers='sse4a,misalignsse,xop,fma4,tbm,npt,nrip-save'>Opteron_G5</model>
+      <model usable='no' vendor='AMD' blockers='sse4a,misalignsse,xop,fma4,npt,nrip-save'>Opteron_G4</model>
+      <model usable='no' vendor='AMD' blockers='sse4a,misalignsse'>Opteron_G3</model>
       <model usable='yes' vendor='AMD'>Opteron_G2</model>
       <model usable='yes' vendor='AMD'>Opteron_G1</model>
       <model usable='yes' vendor='Intel'>Nehalem-IBRS</model>
       <model usable='yes' vendor='Intel'>Nehalem</model>
       <model usable='yes' vendor='Intel'>IvyBridge-IBRS</model>
       <model usable='yes' vendor='Intel'>IvyBridge</model>
-      <model usable='no' vendor='Intel'>Icelake-Server-noTSX</model>
-      <model usable='no' vendor='Intel'>Icelake-Server</model>
-      <model usable='no' vendor='Intel'>Icelake-Client-noTSX</model>
-      <model usable='no' vendor='Intel'>Icelake-Client</model>
+      <model usable='no' vendor='Intel' blockers='avx512f,avx512dq,clwb,avx512cd,avx512bw,avx512vl,avx512vbmi,pku,avx512vbmi2,gfni,vaes,vpclmulqdq,avx512vnni,avx512bitalg,avx512-vpopcntdq,la57,wbnoinvd,avx512f,avx512f,avx512f,pku'>Icelake-Server-noTSX</model>
+      <model usable='no' vendor='Intel' blockers='avx512f,avx512dq,clwb,avx512cd,avx512bw,avx512vl,avx512vbmi,pku,avx512vbmi2,gfni,vaes,vpclmulqdq,avx512vnni,avx512bitalg,avx512-vpopcntdq,la57,wbnoinvd,avx512f,avx512f,avx512f,pku'>Icelake-Server</model>
+      <model usable='no' vendor='Intel' blockers='avx512vbmi,pku,avx512vbmi2,gfni,vaes,vpclmulqdq,avx512vnni,avx512bitalg,avx512-vpopcntdq,wbnoinvd,pku'>Icelake-Client-noTSX</model>
+      <model usable='no' vendor='Intel' blockers='avx512vbmi,pku,avx512vbmi2,gfni,vaes,vpclmulqdq,avx512vnni,avx512bitalg,avx512-vpopcntdq,wbnoinvd,pku'>Icelake-Client</model>
       <model usable='yes' vendor='Intel'>Haswell-noTSX-IBRS</model>
       <model usable='yes' vendor='Intel'>Haswell-noTSX</model>
       <model usable='yes' vendor='Intel'>Haswell-IBRS</model>
       <model usable='yes' vendor='Intel'>Haswell</model>
-      <model usable='no' vendor='AMD'>EPYC-IBPB</model>
-      <model usable='no' vendor='AMD'>EPYC</model>
-      <model usable='no' vendor='Hygon'>Dhyana</model>
+      <model usable='no' vendor='AMD' blockers='sha-ni,mmxext,fxsr_opt,cr8legacy,sse4a,misalignsse,osvw,ibpb,npt,nrip-save'>EPYC-IBPB</model>
+      <model usable='no' vendor='AMD' blockers='sha-ni,mmxext,fxsr_opt,cr8legacy,sse4a,misalignsse,osvw,ibpb,npt,nrip-save'>EPYC</model>
+      <model usable='no' vendor='Hygon' blockers='mmxext,fxsr_opt,cr8legacy,sse4a,misalignsse,osvw,ibpb,npt,nrip-save'>Dhyana</model>
       <model usable='yes' vendor='Intel'>Conroe</model>
-      <model usable='no' vendor='Intel'>Cascadelake-Server-noTSX</model>
-      <model usable='no' vendor='Intel'>Cascadelake-Server</model>
+      <model usable='no' vendor='Intel' blockers='avx512f,avx512dq,clwb,avx512cd,avx512bw,avx512vl,pku,avx512vnni,avx512f,avx512f,avx512f,pku,rdctl-no,ibrs-all,mds-no'>Cascadelake-Server-noTSX</model>
+      <model usable='no' vendor='Intel' blockers='avx512f,avx512dq,clwb,avx512cd,avx512bw,avx512vl,pku,avx512vnni,avx512f,avx512f,avx512f,pku,rdctl-no,ibrs-all,mds-no'>Cascadelake-Server</model>
       <model usable='yes' vendor='Intel'>Broadwell-noTSX-IBRS</model>
       <model usable='yes' vendor='Intel'>Broadwell-noTSX</model>
       <model usable='yes' vendor='Intel'>Broadwell-IBRS</model>
...
-- 
2.37.3




[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