[RFC] virsysinfo: Try reading DMI table

This patch intends to add DMI support to libvirt for RISC-V and mips. This change is based on commit ec6ce6363, which added ARM support. This is not tested on the target arches, as I've been unable to find hardware to test this on. src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+) Cheers, Brett Holman PS: This is my first post on this mailing list. I believe that I've followed the documented steps, but if I've missed anything please let me know.

From: Brett Holman <brett.holman@canonical.com> The SMBIOS specification[1] includes RISC-V and mips, and some systems have SMBIOS info. Attempt to read dmidecode and fall back to old behavior if that fails. [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0.p... Signed-off-by: Brett Holman <brett.holman@canonical.com> --- src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 36a861c53f..d8d660d694 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1248,6 +1248,8 @@ virSysinfoRead(void) #elif !defined(WIN32) && \ (defined(__x86_64__) || \ defined(__i386__) || \ + defined(__mips__) || \ + defined(__riscv__) || \ defined(__amd64__)) return virSysinfoReadDMI(); #else /* WIN32 || not supported arch */ -- 2.43.0

Hello, On Mon, Mar 18, 2024 at 11:30 PM <brett.holman@canonical.com> wrote:
From: Brett Holman <brett.holman@canonical.com>
The SMBIOS specification[1] includes RISC-V and mips, and some systems have SMBIOS info. Attempt to read dmidecode and fall back to old behavior if that fails.
[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0.p...
thank you for the patch, but I do not fully understand one thing - in the pdf you included there is only risc-v as a supported processor architecture (section 1.1, page 15) and not mips. As I do not have knowledge in this - did you possibly include mips, because the newest specification also includes LoongArch? If yes - could you amend the commit message to include the link to the newest version [2] and to explain the relationship between mips x LoongArch? [2] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.p...
Signed-off-by: Brett Holman <brett.holman@canonical.com> --- src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 36a861c53f..d8d660d694 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1248,6 +1248,8 @@ virSysinfoRead(void) #elif !defined(WIN32) && \ (defined(__x86_64__) || \ defined(__i386__) || \ + defined(__mips__) || \ + defined(__riscv__) || \ defined(__amd64__)) return virSysinfoReadDMI(); #else /* WIN32 || not supported arch */ -- 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org
Regards, Kristina

As I do not have knowledge in this - did you possibly include mips, because the newest specification also includes LoongArch? If yes - could you amend the commit message to include the link to the newest version [2] and to explain the relationship between mips x LoongArch?
Thanks for the review. Correct, the spec doesn't support mips, but I added it because I noticed the SMBIOS table definition under hw/mips/ in qemu's source which, as you pointed out, is for LoongArch. I'll resubmit with an updated commit message.

This patch intends to add DMI support to libvirt for RISC-V and mips. This change is based on commit ec6ce6363, which added ARM support. This is not tested on the target arches, as I've been unable to find hardware to test this on. src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+) V1->V2: 1. Clarify commit message 2. Rebase onto recent LoongArch merge. Cheers, Brett Holman

From: Brett Holman <brett.holman@canonical.com> Add DMI support for risc-v and mips. Attempt to read dmidecode and fall back to old behavior if that fails. The SMBIOS specification[1] officially supports both RISC-V and LoongArch. Some mips-based Loongson-3 processors also have SMBIOS. [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.p... Signed-off-by: Brett Holman <brett.holman@canonical.com> --- src/util/virsysinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 4a03fc3246..0d9083c891 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1249,6 +1249,8 @@ virSysinfoRead(void) (defined(__x86_64__) || \ defined(__i386__) || \ defined(__amd64__) || \ + defined(__riscv__) || \ + defined(__mips__) || \ defined(__loongarch__)) return virSysinfoReadDMI(); #else /* WIN32 || not supported arch */ -- 2.43.0
participants (2)
-
brett.holman@canonical.com
-
Kristina Hanicova