diff options
author | Gabriel L. Somlo <gsomlo@gmail.com> | 2014-05-19 10:09:54 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-05-21 15:47:50 +0300 |
commit | 84351843eba330022e245a742899cf71fc817ec5 (patch) | |
tree | 18828a991bb2da82108bbc65e21f3de9f49d09d7 /hw/i386 | |
parent | fb5be2e833669dd95be1950ea7b1da4cf7f9556c (diff) |
SMBIOS: Update Type 0 struct generator for machines >= 2.1
Update how type 0 (bios info) structures are generated, as follows:
- convert bios_characteristics field to uin64_t (instead of
uint8_t[8]), as described in the current smbios spec (v2.8)
- enable "virtual machine" bit in bios_characteristics_extension_bits
- add command line option to enable "uefi supported" bit in
bios_characteristics_extension_bits
These updates should make this optional structure more useful when
used with edk2/ovmf. Only pc machines >= 2.1 are affected, and only
when a type 0 structure is explicitly specified on the command line.
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | hw/i386/smbios.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c index aeb94bc671..17938215f6 100644 --- a/hw/i386/smbios.c +++ b/hw/i386/smbios.c @@ -67,7 +67,7 @@ static DECLARE_BITMAP(have_fields_bitmap, SMBIOS_MAX_TYPE+1); static struct { const char *vendor, *version, *date; - bool have_major_minor; + bool have_major_minor, uefi; uint8_t major, minor; } type0; @@ -134,6 +134,10 @@ static const QemuOptDesc qemu_smbios_type0_opts[] = { .name = "release", .type = QEMU_OPT_STRING, .help = "revision number", + },{ + .name = "uefi", + .type = QEMU_OPT_BOOL, + .help = "uefi support", }, { /* end of list */ } }; @@ -497,13 +501,12 @@ static void smbios_build_type_0_table(void) t->bios_rom_size = 0; /* hardcoded in SeaBIOS with FIXME comment */ - /* BIOS characteristics not supported */ - memset(t->bios_characteristics, 0, 8); - t->bios_characteristics[0] = 0x08; - - /* Enable targeted content distribution (needed for SVVP, per SeaBIOS) */ + t->bios_characteristics = cpu_to_le64(0x08); /* Not supported */ t->bios_characteristics_extension_bytes[0] = 0; - t->bios_characteristics_extension_bytes[1] = 4; + t->bios_characteristics_extension_bytes[1] = 0x14; /* TCD/SVVP | VM */ + if (type0.uefi) { + t->bios_characteristics_extension_bytes[1] |= 0x08; /* |= UEFI */ + } if (type0.have_major_minor) { t->system_bios_major_release = type0.major; @@ -979,6 +982,7 @@ void smbios_entry_add(QemuOpts *opts) save_opt(&type0.vendor, opts, "vendor"); save_opt(&type0.version, opts, "version"); save_opt(&type0.date, opts, "date"); + type0.uefi = qemu_opt_get_bool(opts, "uefi", false); val = qemu_opt_get(opts, "release"); if (val) { |