From: Wei Huang <wei@redhat.com>
To: qemu-devel@nongnu.org
Cc: wei@redhat.com, peter.maydell@linaro.org, drjones@redhat.com,
ard.biesheuvel@linaro.org, ehabkost@redhat.com,
ivan.khoronzhuk@linaro.org, mst@redhat.com, somlo@cmu.edu,
zhaoshenglong@huawei.com, leif.lindholm@linaro.org,
roy.franz@linaro.org, pbonzini@redhat.com, imammedo@redhat.com,
lersek@redhat.com, jdelvare@suse.de, rth@twiddle.net
Subject: [Qemu-devel] [ARM SMBIOS V5 PATCH 2/2] smbios: implement smbios support for mach-virt
Date: Wed, 26 Aug 2015 15:04:30 -0400 [thread overview]
Message-ID: <1440615870-9518-3-git-send-email-wei@redhat.com> (raw)
In-Reply-To: <1440615870-9518-1-git-send-email-wei@redhat.com>
This patch generates smbios tables for ARM mach-virt. Also add
CONFIG_SMBIOS=y for ARM default config.
Acked-by: Gabriel Somlo <somlo@cmu.edu>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Wei Huang <wei@redhat.com>
---
default-configs/arm-softmmu.mak | 1 +
hw/arm/virt.c | 25 +++++++++++++++++++++++++
qemu-options.hx | 2 +-
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 74f1db3..99b41e9 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -102,3 +102,4 @@ CONFIG_XIO3130=y
CONFIG_IOH3420=y
CONFIG_I82801B11=y
CONFIG_ACPI=y
+CONFIG_SMBIOS=y
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index d5a8417..e3a8f36 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -50,6 +50,7 @@
#include "hw/arm/fdt.h"
#include "hw/intc/arm_gic_common.h"
#include "kvm_arm.h"
+#include "hw/smbios/smbios.h"
/* Number of external interrupt lines to configure the GIC with */
#define NUM_IRQS 256
@@ -788,12 +789,36 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size)
return board->fdt;
}
+static void virt_build_smbios(VirtGuestInfo *guest_info)
+{
+ FWCfgState *fw_cfg = guest_info->fw_cfg;
+ uint8_t *smbios_tables, *smbios_anchor;
+ size_t smbios_tables_len, smbios_anchor_len;
+
+ if (!fw_cfg)
+ return;
+
+ smbios_set_defaults("QEMU", "QEMU Virtual Machine",
+ "1.0", false, true, SMBIOS_ENTRY_POINT_30);
+
+ smbios_get_tables(NULL, 0, &smbios_tables, &smbios_tables_len,
+ &smbios_anchor, &smbios_anchor_len);
+
+ if (smbios_anchor) {
+ fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables",
+ smbios_tables, smbios_tables_len);
+ fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor",
+ smbios_anchor, smbios_anchor_len);
+ }
+}
+
static
void virt_guest_info_machine_done(Notifier *notifier, void *data)
{
VirtGuestInfoState *guest_info_state = container_of(notifier,
VirtGuestInfoState, machine_done);
virt_acpi_setup(&guest_info_state->info);
+ virt_build_smbios(&guest_info_state->info);
}
static void machvirt_init(MachineState *machine)
diff --git a/qemu-options.hx b/qemu-options.hx
index 77f5853..efce775 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1412,7 +1412,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
"-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
" [,asset=str][,part=str][,speed=%d]\n"
" specify SMBIOS type 17 fields\n",
- QEMU_ARCH_I386)
+ QEMU_ARCH_I386 | QEMU_ARCH_ARM)
STEXI
@item -smbios file=@var{binary}
@findex -smbios
--
1.8.3.1
next prev parent reply other threads:[~2015-08-26 19:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 19:04 [Qemu-devel] [ARM SMBIOS V5 PATCH 0/2]SMBIOS Support for ARM Wei Huang
2015-08-26 19:04 ` [Qemu-devel] [ARM SMBIOS V5 PATCH 1/2] smbios: add smbios 3.0 support Wei Huang
2015-08-27 6:15 ` Laszlo Ersek
2015-09-01 15:56 ` Peter Maydell
2015-08-26 19:04 ` Wei Huang [this message]
2015-09-01 15:58 ` [Qemu-devel] [ARM SMBIOS V5 PATCH 2/2] smbios: implement smbios support for mach-virt Peter Maydell
2015-08-27 6:18 ` [Qemu-devel] [ARM SMBIOS V5 PATCH 0/2]SMBIOS Support for ARM Laszlo Ersek
2015-09-01 16:15 ` Peter Maydell
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=1440615870-9518-3-git-send-email-wei@redhat.com \
--to=wei@redhat.com \
--cc=ard.biesheuvel@linaro.org \
--cc=drjones@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=ivan.khoronzhuk@linaro.org \
--cc=jdelvare@suse.de \
--cc=leif.lindholm@linaro.org \
--cc=lersek@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=roy.franz@linaro.org \
--cc=rth@twiddle.net \
--cc=somlo@cmu.edu \
--cc=zhaoshenglong@huawei.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).