]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: extend domain capabilities for max SEV guest count
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 9 Dec 2021 16:47:43 +0000 (11:47 -0500)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 14 Dec 2021 16:04:17 +0000 (16:04 +0000)
There are limits on the number of SEV/SEV-ES guests that can
be run on machines, which may be influenced by firmware
settings. This is important to expose to users.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
docs/formatdomaincaps.html.in
docs/schemas/domaincaps.rng
src/conf/domain_capabilities.c
src/conf/domain_capabilities.h
tests/domaincapsdata/qemu_2.12.0-q35.x86_64.xml
tests/domaincapsdata/qemu_2.12.0-tcg.x86_64.xml
tests/domaincapsdata/qemu_2.12.0.x86_64.xml
tests/domaincapsdata/qemu_6.0.0-q35.x86_64.xml
tests/domaincapsdata/qemu_6.0.0-tcg.x86_64.xml
tests/domaincapsdata/qemu_6.0.0.x86_64.xml

index 915ece8e3e9741fb4158c960767c228ebbf2d9ec..35b8bf3defa8b3da73754dc5cc6fb7395b3e60c0 100644 (file)
       <dt><code>reducedPhysBits</code></dt>
       <dd>When memory encryption is enabled, we lose certain bits in physical
       address space. The number of bits we lose is hypervisor dependent.</dd>
+      <dt><code>maxGuests</code></dt>
+      <dd>The maximum number of SEV guests that can be launched on the host.
+      This value may be configurable in the firmware for some hosts.</dd>
+      <dt><code>maxESGuests</code></dt>
+      <dd>The maximum number of SEV-ES guests that can be launched on the host.
+      This value may be configurable in the firmware for some hosts.</dd>
     </dl>
 
   </body>
index 1b6122507feba76fa3a229e9ba9b89f334a750cb..b40ee0f35a2470c9d388777beeb52193f7e55b83 100644 (file)
         <element name="reducedPhysBits">
           <data type="unsignedInt"/>
         </element>
+        <element name="maxGuests">
+          <data type="unsignedInt"/>
+        </element>
+        <element name="maxESGuests">
+          <data type="unsignedInt"/>
+        </element>
       </optional>
     </element>
   </define>
index fef1326190a3f3ff6793d49110e30dd20e84f4c1..c394a7a39057709080c8f23dc34bd6b24d454295 100644 (file)
@@ -597,6 +597,10 @@ virDomainCapsFeatureSEVFormat(virBuffer *buf,
         virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos);
         virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n",
                           sev->reduced_phys_bits);
+        virBufferAsprintf(buf, "<maxGuests>%d</maxGuests>\n",
+                          sev->max_guests);
+        virBufferAsprintf(buf, "<maxESGuests>%d</maxESGuests>\n",
+                          sev->max_es_guests);
         virBufferAdjustIndent(buf, -2);
         virBufferAddLit(buf, "</sev>\n");
     }
index 2fcad87fd8a58def33e130f6fc6b2dfd22fafd9f..1d2f4ac7a5d2fd5ae53f5ca996c780faf2951f74 100644 (file)
@@ -187,6 +187,8 @@ struct _virSEVCapability {
     char *cert_chain;
     unsigned int cbitpos;
     unsigned int reduced_phys_bits;
+    unsigned int max_guests;
+    unsigned int max_es_guests;
 };
 
 typedef enum {
index 9f41dfaf2bc9df99a24bedd750246d7482be4a21..26816ff06669e1c32e7c8c600f8efec8c8204897 100644 (file)
     <sev supported='yes'>
       <cbitpos>47</cbitpos>
       <reducedPhysBits>1</reducedPhysBits>
+      <maxGuests>0</maxGuests>
+      <maxESGuests>0</maxESGuests>
     </sev>
   </features>
 </domainCapabilities>
index d5f9d8ebe33d5c0609a7ba72434e0d76f0fec55f..5840a8b921abb4856c0cafe5f026b77d9af0e49c 100644 (file)
     <sev supported='yes'>
       <cbitpos>47</cbitpos>
       <reducedPhysBits>1</reducedPhysBits>
+      <maxGuests>0</maxGuests>
+      <maxESGuests>0</maxESGuests>
     </sev>
   </features>
 </domainCapabilities>
index dc2c3ec4dde79d7a28eb3df0e94ca0570423eec5..21d1b6946e5298ee9bd69801fcb95b96c7bcc5db 100644 (file)
     <sev supported='yes'>
       <cbitpos>47</cbitpos>
       <reducedPhysBits>1</reducedPhysBits>
+      <maxGuests>0</maxGuests>
+      <maxESGuests>0</maxESGuests>
     </sev>
   </features>
 </domainCapabilities>
index 90acb2977568e9d082bb734b703409e8f5e6f797..3415d44019dde99ae96abbfd601522fea90a3477 100644 (file)
     <sev supported='yes'>
       <cbitpos>47</cbitpos>
       <reducedPhysBits>1</reducedPhysBits>
+      <maxGuests>0</maxGuests>
+      <maxESGuests>0</maxESGuests>
     </sev>
   </features>
 </domainCapabilities>
index 768cba5a41c091d97f8ab91f03162166402cedc7..f58be3af6ce2dd71bd72906aa6cd8a81cd7bf704 100644 (file)
     <sev supported='yes'>
       <cbitpos>47</cbitpos>
       <reducedPhysBits>1</reducedPhysBits>
+      <maxGuests>0</maxGuests>
+      <maxESGuests>0</maxESGuests>
     </sev>
   </features>
 </domainCapabilities>
index 7a95c530f90f615a563b9c2d29979ae43259f11c..0a2615c519420efab660111c94886878929c33df 100644 (file)
     <sev supported='yes'>
       <cbitpos>47</cbitpos>
       <reducedPhysBits>1</reducedPhysBits>
+      <maxGuests>0</maxGuests>
+      <maxESGuests>0</maxESGuests>
     </sev>
   </features>
 </domainCapabilities>