conf: extend domain capabilities for max SEV guest count

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>
This commit is contained in:
Daniel P. Berrangé 2021-12-09 11:47:43 -05:00
parent 719bb0bf23
commit 34cb8f6fcd
10 changed files with 30 additions and 0 deletions

View File

@ -681,6 +681,12 @@
<dt><code>reducedPhysBits</code></dt> <dt><code>reducedPhysBits</code></dt>
<dd>When memory encryption is enabled, we lose certain bits in physical <dd>When memory encryption is enabled, we lose certain bits in physical
address space. The number of bits we lose is hypervisor dependent.</dd> 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> </dl>
</body> </body>

View File

@ -323,6 +323,12 @@
<element name="reducedPhysBits"> <element name="reducedPhysBits">
<data type="unsignedInt"/> <data type="unsignedInt"/>
</element> </element>
<element name="maxGuests">
<data type="unsignedInt"/>
</element>
<element name="maxESGuests">
<data type="unsignedInt"/>
</element>
</optional> </optional>
</element> </element>
</define> </define>

View File

@ -597,6 +597,10 @@ virDomainCapsFeatureSEVFormat(virBuffer *buf,
virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos); virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos);
virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n", virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n",
sev->reduced_phys_bits); 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); virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</sev>\n"); virBufferAddLit(buf, "</sev>\n");
} }

View File

@ -187,6 +187,8 @@ struct _virSEVCapability {
char *cert_chain; char *cert_chain;
unsigned int cbitpos; unsigned int cbitpos;
unsigned int reduced_phys_bits; unsigned int reduced_phys_bits;
unsigned int max_guests;
unsigned int max_es_guests;
}; };
typedef enum { typedef enum {

View File

@ -205,6 +205,8 @@
<sev supported='yes'> <sev supported='yes'>
<cbitpos>47</cbitpos> <cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits> <reducedPhysBits>1</reducedPhysBits>
<maxGuests>0</maxGuests>
<maxESGuests>0</maxESGuests>
</sev> </sev>
</features> </features>
</domainCapabilities> </domainCapabilities>

View File

@ -215,6 +215,8 @@
<sev supported='yes'> <sev supported='yes'>
<cbitpos>47</cbitpos> <cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits> <reducedPhysBits>1</reducedPhysBits>
<maxGuests>0</maxGuests>
<maxESGuests>0</maxESGuests>
</sev> </sev>
</features> </features>
</domainCapabilities> </domainCapabilities>

View File

@ -205,6 +205,8 @@
<sev supported='yes'> <sev supported='yes'>
<cbitpos>47</cbitpos> <cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits> <reducedPhysBits>1</reducedPhysBits>
<maxGuests>0</maxGuests>
<maxESGuests>0</maxESGuests>
</sev> </sev>
</features> </features>
</domainCapabilities> </domainCapabilities>

View File

@ -227,6 +227,8 @@
<sev supported='yes'> <sev supported='yes'>
<cbitpos>47</cbitpos> <cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits> <reducedPhysBits>1</reducedPhysBits>
<maxGuests>0</maxGuests>
<maxESGuests>0</maxESGuests>
</sev> </sev>
</features> </features>
</domainCapabilities> </domainCapabilities>

View File

@ -233,6 +233,8 @@
<sev supported='yes'> <sev supported='yes'>
<cbitpos>47</cbitpos> <cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits> <reducedPhysBits>1</reducedPhysBits>
<maxGuests>0</maxGuests>
<maxESGuests>0</maxESGuests>
</sev> </sev>
</features> </features>
</domainCapabilities> </domainCapabilities>

View File

@ -227,6 +227,8 @@
<sev supported='yes'> <sev supported='yes'>
<cbitpos>47</cbitpos> <cbitpos>47</cbitpos>
<reducedPhysBits>1</reducedPhysBits> <reducedPhysBits>1</reducedPhysBits>
<maxGuests>0</maxGuests>
<maxESGuests>0</maxESGuests>
</sev> </sev>
</features> </features>
</domainCapabilities> </domainCapabilities>