From: Christian Ludwig <christian_ludwig@genua.de>
To: <pve-devel@lists.proxmox.com>
Subject: [PATCH pve-common 1/7] procfs: read CPU model and stepping from cpuinfo
Date: Thu, 24 Sep 2026 16:14:02 +0200 [thread overview]
Message-ID: <f872f2e59ebdd1cfdb0b3596367df734cded9ec4.1790235902.git@genua.de> (raw)
In-Reply-To: <chipid.1790235905.git@genua.de>
[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]
Report the numeric CPUID model and stepping alongside the already
existing family. Together they identify the processor generation.
That information is useful for an AMD SEV-SNP attestation client that
needs to pick the right AMD KDS endpoint, when the attestation report
itself carries no CPUID fields (report version 2).
All three values are captured from \d+ patterns, so coerce them to be
serialized as JSON numbers rather than strings. Note that this changes
how the undocumented 'family' member of the cpuinfo object in
/nodes/{node}/status is represented on the wire now.
Signed-off-by: Christian Ludwig <christian_ludwig@genua.de>
---
src/PVE/ProcFSTools.pm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index bb8d276..ede5990 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -81,6 +81,8 @@ sub read_cpuinfo {
vendor => 'unknown',
family => 0,
model => 'unknown',
+ model_id => 0,
+ stepping => 0,
mhz => 0,
cpus => 1,
sockets => 1,
@@ -102,7 +104,11 @@ sub read_cpuinfo {
} elsif ($line =~ m/^vendor_id\s*:\s*(\S*)\s*$/i) {
$res->{vendor} = $1 if $res->{vendor} eq 'unknown';
} elsif ($line =~ m/^cpu family\s*:\s*(\d+)\s*$/i) {
- $res->{family} = $1 if !$res->{family};
+ $res->{family} = $1 + 0 if !$res->{family};
+ } elsif ($line =~ m/^model\s*:\s*(\d+)\s*$/i) {
+ $res->{model_id} = $1 + 0 if !$res->{model_id};
+ } elsif ($line =~ m/^stepping\s*:\s*(\d+)\s*$/i) {
+ $res->{stepping} = $1 + 0 if !$res->{stepping};
} elsif ($line =~ m/^cpu\s+MHz\s*:\s*(\d+\.\d+)\s*$/i) {
$res->{mhz} = $1 if !$res->{mhz};
} elsif ($line =~ m/^flags\s*:\s*(.*)$/) {
--
2.34.1
next prev parent reply other threads:[~2026-09-24 14:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 14:14 [PATCH 0/7] SEV: Expose chip ID and reported TCB versions Christian Ludwig
2026-09-24 14:14 ` Christian Ludwig [this message]
2026-09-24 14:14 ` [PATCH qemu-server 2/7] sev: Detect SEV- Christian Ludwig
2026-09-24 14:14 ` [PATCH qemu-server 3/7] sev: Expose chip ID and reported TCB versions Christian Ludwig
2026-09-24 14:14 ` [PATCH qemu-server 4/7] api: add endpoint for SEV attestation data Christian Ludwig
2026-09-24 14:14 ` [PATCH pve-manager 5/7] api: register SEV capabilities endpoint Christian Ludwig
2026-09-24 14:14 ` [PATCH pve-docs 6/7] qm: Describe ASIDs for SEV Christian Ludwig
2026-09-24 14:14 ` [PATCH pve-docs 7/7] sev: Describe VCEK retieval Christian Ludwig
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=f872f2e59ebdd1cfdb0b3596367df734cded9ec4.1790235902.git@genua.de \
--to=christian_ludwig@genua.de \
--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