public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH qemu-server v1 1/2] query-machine-capabilities: amd-sev: add max-asid and min-asid-std-sev
@ 2026-08-31 16:34 Markus Frank
  2026-08-31 16:34 ` [PATCH qemu-server v1 2/2] query-machine-capabilities: update CPUID Wikipedia anchor link Markus Frank
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Frank @ 2026-08-31 16:34 UTC (permalink / raw)
  To: pve-devel

Read two more AMD SEV values with CPUID that are currently only visible
in the BIOS and dmesg.

max-asid: maximum number of Address Space Identifiers (ASID) for all AMD
SEV VMs = maximum number of SEV guests that can run at the same time

min-asid-std-sev: minimum ASID value for standard SEV guests

AMD SEV ASID Ranges:
* 1 .. (min-asid-std-sev - 1): SEV-ES, SEV-SNP guests
* min-asid-std-sev .. max-asid: standard SEV guests

This could be used to prevent SEV VMs from starting and to display a
more informative error message if all ASIDs are already in use by other
SEV VMs.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 .../query-machine-capabilities.c                          | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/query-machine-capabilities/query-machine-capabilities.c b/src/query-machine-capabilities/query-machine-capabilities.c
index 0a9ab805..cf5f5252 100644
--- a/src/query-machine-capabilities/query-machine-capabilities.c
+++ b/src/query-machine-capabilities/query-machine-capabilities.c
@@ -31,6 +31,8 @@ typedef struct {
 
     uint8_t cbitpos;
     uint8_t reduced_phys_bits;
+    uint32_t max_asid;
+    uint32_t min_asid_std_sev;
 } cpu_caps_amd_sev_t;
 
 typedef struct {
@@ -138,6 +140,8 @@ void query_cpu_capabilities_sev(cpu_caps_amd_sev_t *res) {
 
     res->cbitpos = ebx & 0x3f;
     res->reduced_phys_bits = (ebx >> 6) & 0x3f;
+    res->max_asid = ecx;
+    res->min_asid_std_sev = edx;
 #else
     memset(res, 0, sizeof(*res));
 #endif
@@ -213,12 +217,16 @@ int main() {
             " \"amd-sev\": {"
             " \"cbitpos\": %u,"
             " \"reduced-phys-bits\": %u,"
+            " \"max-asid\": %u,"
+            " \"min-asid-std-sev\": %u,"
             " \"sev-support\": %s,"
             " \"sev-support-es\": %s,"
             " \"sev-support-snp\": %s"
             " }",
             caps_sev.cbitpos,
             caps_sev.reduced_phys_bits,
+            caps_sev.max_asid,
+            caps_sev.min_asid_std_sev,
             caps_sev.sev_support ? "true" : "false",
             caps_sev.sev_es_support ? "true" : "false",
             caps_sev.sev_snp_support ? "true" : "false"
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH qemu-server v1 2/2] query-machine-capabilities: update CPUID Wikipedia anchor link
  2026-08-31 16:34 [PATCH qemu-server v1 1/2] query-machine-capabilities: amd-sev: add max-asid and min-asid-std-sev Markus Frank
@ 2026-08-31 16:34 ` Markus Frank
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Frank @ 2026-08-31 16:34 UTC (permalink / raw)
  To: pve-devel

The Wikipedia page for CPUID updated its section header format, breaking
the previous link. Update the anchor tag to match the new URL.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
---
 src/query-machine-capabilities/query-machine-capabilities.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/query-machine-capabilities/query-machine-capabilities.c b/src/query-machine-capabilities/query-machine-capabilities.c
index cf5f5252..d7dae53f 100644
--- a/src/query-machine-capabilities/query-machine-capabilities.c
+++ b/src/query-machine-capabilities/query-machine-capabilities.c
@@ -127,7 +127,7 @@ void query_cpu_capabilities_sev(cpu_caps_amd_sev_t *res) {
     uint32_t eax, ebx, ecx, edx;
 
     // query Encrypted Memory Capabilities, see:
-    // https://en.wikipedia.org/wiki/CPUID#EAX=8000001Fh:_Encrypted_Memory_Capabilities
+    // https://en.wikipedia.org/wiki/CPUID#EAX=8000'001Fh:_Encrypted_Memory_Capabilities
     uint32_t query_function = 0x8000001F;
     asm volatile("cpuid"
         : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-31 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 16:34 [PATCH qemu-server v1 1/2] query-machine-capabilities: amd-sev: add max-asid and min-asid-std-sev Markus Frank
2026-08-31 16:34 ` [PATCH qemu-server v1 2/2] query-machine-capabilities: update CPUID Wikipedia anchor link Markus Frank

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal