public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Markus Frank <m.frank@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server v1 1/2] query-machine-capabilities: amd-sev: add max-asid and min-asid-std-sev
Date: Mon, 31 Aug 2026 18:34:14 +0200	[thread overview]
Message-ID: <20260831163526.462323-1-m.frank@proxmox.com> (raw)

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





             reply	other threads:[~2026-08-31 16:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 16:34 Markus Frank [this message]
2026-08-31 16:34 ` [PATCH qemu-server v1 2/2] query-machine-capabilities: update CPUID Wikipedia anchor link Markus Frank

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260831163526.462323-1-m.frank@proxmox.com \
    --to=m.frank@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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