From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 48E151FF0AF for ; Thu, 24 Sep 2026 16:23:24 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9374A21708; Thu, 24 Sep 2026 16:23:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=genua.de; s=202307; t=1790259244; bh=FV4I/Fz0P/0URX7zYbYN0Y5O+NDQdC6Uzpn7eoVgC7o=; h=Date:From:To:Subject:References:In-Reply-To:From; b=gKl2qkv7sWKXaAbz3TvMj/felFsAtopLuyse+tEkdID5ENOtz4Hh/3C80QbIyXP+e hh486T/oFpQFP+TaekUXohF+EU7wX+gtHKX1rUZTKcvCm5n62j3Nb0eQP5Htn95YX+ 3AQNX/XjXE6ChERzMacDoHL9983aDcecWnQBttM1ohhJMKbR65keSFVBiJHfSu8+ei NfvadsmTVAMfT1tSJ4chPbI6bfJJJU0EQECZQ/Ze2S3otlduJM+xsnG2EDUu2yTFxO Kbuwj6SQ4y3ypE2YJwE2SLAdf5BzyaSB4VlgOcpXMPwlg3RLndbJPiCBopGLrEvLX/ P+dPg65SrQbDA== Date: Thu, 24 Sep 2026 16:14:02 +0200 From: Christian Ludwig To: Subject: [PATCH pve-common 1/7] procfs: read CPU model and stepping from cpuinfo Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [192.168.217.185] X-ClientProxiedBy: kch1-mta09.win.genua.de (10.208.16.109) To kch1-mta07.win.genua.de (10.208.16.107) Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="----A2B6D1408EEE72546B2D4CE01CB178D3" X-SPAM-LEVEL: Spam detection results: 0 AWL 0.066 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record UNPARSEABLE_RELAY 0.001 Informational: message has unparseable relay lines Message-ID-Hash: K4XFMCAJ2SF3RW5NAOJUP3YJ5KSGSVZL X-Message-ID-Hash: K4XFMCAJ2SF3RW5NAOJUP3YJ5KSGSVZL X-MailFrom: christian_ludwig@genua.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Content-Filtered-By: Mailman/MimeDel 3.3.10 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: ------A2B6D1408EEE72546B2D4CE01CB178D3 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline 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 --- 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 ------A2B6D1408EEE72546B2D4CE01CB178D3--