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