From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
To: Sunil V L <sunilvl@ventanamicro.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alistair Francis <alistair.francis@wdc.com>,
Bin Meng <bin.meng@windriver.com>,
Weiwei Li <liwei1518@gmail.com>,
Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/1] target/riscv: SMBIOS support for RISC-V virt machine
Date: Mon, 18 Dec 2023 10:23:40 +0100 [thread overview]
Message-ID: <9183a3fb-b9f7-470c-b9a6-8d8cc6dce7c3@canonical.com> (raw)
In-Reply-To: <ZYAHtq1HozBOZZrJ@sunil-laptop>
On 12/18/23 09:49, Sunil V L wrote:
> Hi Heinrich,
>
> Thanks for the patch!.
>
> On Mon, Dec 18, 2023 at 08:40:18AM +0100, Heinrich Schuchardt wrote:
>> Generate SMBIOS tables for the RISC-V mach-virt.
>> Add CONFIG_SMBIOS=y to the RISC-V default config.
>>
>> The implementation is based on the corresponding ARM and Loongson code.
>>
>> With the patch the following firmware tables are provided:
>>
>> etc/smbios/smbios-anchor
>> etc/smbios/smbios-tables
>>
>> Booting Ubuntu 23.10 via EDK II allowed displaying the SMBIOS table using
>> the dmidecode command:
>>
>> Handle 0x0100, DMI type 1, 27 bytes
>> System Information
>> Manufacturer: QEMU
>> Product Name: QEMU Virtual Machine
>> Version: virt
>> ...
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>> ---
>> hw/riscv/Kconfig | 1 +
>> hw/riscv/virt.c | 36 ++++++++++++++++++++++++++++++++++++
>> 2 files changed, 37 insertions(+)
>>
>> diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig
>> index b6a5eb4452..1e11ac9432 100644
>> --- a/hw/riscv/Kconfig
>> +++ b/hw/riscv/Kconfig
>> @@ -41,6 +41,7 @@ config RISCV_VIRT
>> select RISCV_IMSIC
>> select SIFIVE_PLIC
>> select SIFIVE_TEST
>> + select SMBIOS
>> select VIRTIO_MMIO
>> select FW_CFG_DMA
>> select PLATFORM_BUS
>> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
>> index d2eac24156..6c27cb5330 100644
>> --- a/hw/riscv/virt.c
>> +++ b/hw/riscv/virt.c
>> @@ -36,6 +36,7 @@
>> #include "hw/riscv/boot.h"
>> #include "hw/riscv/numa.h"
>> #include "kvm/kvm_riscv.h"
>> +#include "hw/firmware/smbios.h"
>> #include "hw/intc/riscv_aclint.h"
>> #include "hw/intc/riscv_aplic.h"
>> #include "hw/intc/riscv_imsic.h"
>> @@ -1249,6 +1250,39 @@ static void create_platform_bus(RISCVVirtState *s, DeviceState *irqchip)
>> sysbus_mmio_get_region(sysbus, 0));
>> }
>>
>> +static void virt_build_smbios(RISCVVirtState *s)
>> +{
> Can we avoid duplicating this function which exists in other
> architectures?
>
Every architecture uses it own structures (e.g. RISCVVirtState) and
constants (e.g VIRT_DRAM). As long as this is not addressed we will have
to live with this piece of code duplication.
After this patch is accepted we will have to work on improving SMBIOS
3.7.0 compliance:
* Table 22
* * field Processor Family should contain a RISC-V specfic value. Maybe
derived from TARGET_RISCV##.
* * field Processor ID should contain the value of mvendorid of hart 0
(i.e. cpu->cfg.mvendorid).
* Table 44
The required contents of this table are provided in
https://github.com/riscv/riscv-smbios .
Best regards
Heinrich
prev parent reply other threads:[~2023-12-18 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 7:40 [PATCH 1/1] target/riscv: SMBIOS support for RISC-V virt machine Heinrich Schuchardt
2023-12-18 8:49 ` Sunil V L
2023-12-18 9:23 ` Heinrich Schuchardt [this message]
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=9183a3fb-b9f7-470c-b9a6-8d8cc6dce7c3@canonical.com \
--to=heinrich.schuchardt@canonical.com \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=dbarboza@ventanamicro.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=sunilvl@ventanamicro.com \
--cc=zhiwei_liu@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).