From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common v2 1/1] procfs: cpuinfo: expose x86_phys_bits and x86_virt_bits values
Date: Tue, 2 Sep 2025 13:21:57 +0200 [thread overview]
Message-ID: <20250902112307.124706-2-d.kral@proxmox.com> (raw)
In-Reply-To: <20250902112307.124706-1-d.kral@proxmox.com>
The address sizes line is taken from the kernel's implementation of
/proc/cpuinfo in arch/x86/kernel/cpu/proc.c.
Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
src/PVE/ProcFSTools.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index 9bfac2c..41efd1f 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -32,6 +32,8 @@ sub read_cpuinfo {
cpus => 1,
sockets => 1,
flags => '',
+ phys_bits => 0,
+ virt_bits => 0,
};
my $fh = IO::File->new($fn, "r");
@@ -54,6 +56,9 @@ sub read_cpuinfo {
$idhash->{$1} = 1 if not defined($idhash->{$1});
} elsif ($line =~ m/^cpu cores\s*:\s*(\d+)\s*$/i) {
$idhash->{$cpuid} = $1 if defined($idhash->{$cpuid});
+ } elsif ($line =~ m/^address sizes\t: (\d+) bits physical, (\d+) bits virtual$/i) {
+ $res->{phys_bits} = $1 if !$res->{phys_bits};
+ $res->{virt_bits} = $2 if !$res->{virt_bits};
}
}
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-09-02 11:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 11:21 [pve-devel] [PATCH common/qemu-server v2 0/5] fix issues with viommu+vfio passthrough in #6608, #6378 Daniel Kral
2025-09-02 11:21 ` Daniel Kral [this message]
2025-09-05 9:10 ` [pve-devel] [PATCH common v2 1/1] procfs: cpuinfo: expose x86_phys_bits and x86_virt_bits values Fiona Ebner
2025-09-05 11:47 ` Daniel Kral
2025-09-02 11:21 ` [pve-devel] [PATCH qemu-server v2 1/4] fix #6608: expose viommu driver aw-bits option Daniel Kral
2025-09-05 10:07 ` Fiona Ebner
2025-09-05 11:45 ` Daniel Kral
2025-09-05 12:00 ` Fiona Ebner
2025-09-05 14:18 ` Daniel Kral
2025-09-02 11:21 ` [pve-devel] [PATCH qemu-server v2 2/4] cpu config: factor out gathering common cpu properties Daniel Kral
2025-09-05 10:32 ` Fiona Ebner
2025-09-02 11:22 ` [pve-devel] [RFC qemu-server v2 3/4] fix #6378 (continued): warn intel-iommu users about iommu and host aw bits mismatch Daniel Kral
2025-09-02 11:26 ` Daniel Kral
2025-09-05 10:50 ` Fiona Ebner
2025-09-05 11:38 ` Daniel Kral
2025-09-05 12:52 ` Fiona Ebner
2025-09-02 11:22 ` [pve-devel] [RFC qemu-server v2 4/4] machine: warn intel-iommu users about too large address width Daniel Kral
2025-09-05 10:55 ` Fiona Ebner
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=20250902112307.124706-2-d.kral@proxmox.com \
--to=d.kral@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