From: Laszlo Ersek <lersek@redhat.com>
To: "Gabriel L. Somlo" <gsomlo@gmail.com>
Cc: seabios@seabios.org, agraf@suse.de, qemu-devel@nongnu.org,
Kevin O'Connor <kevin@koconnor.net>,
Gerd Hoffmann <kraxel@redhat.com>,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2, Ping] SMBIOS: Upgrade Type17 to v2.3, add Type2
Date: Tue, 18 Feb 2014 22:08:40 +0100 [thread overview]
Message-ID: <5303CBD8.5090901@redhat.com> (raw)
In-Reply-To: <20140218191728.GS29329@ERROL.INI.CMU.EDU>
On 02/18/14 20:17, Gabriel L. Somlo wrote:
> On Tue, Feb 18, 2014 at 11:21:33AM +0100, Gerd Hoffmann wrote:
> Using Fedora 20 live, I collected the SMBIOS table from the guest
> using "dmidecode --dump-bin", with the unpatched SeaBIOS
> (dmidecode_pc.bin), SeaBIOS with my patch applied (dmidecode_mac.bin),
> and again with unpatched SeaBIOS but with "-smbios file=dmidecode_mac.bin"
> on the QEMU command line (dmidecode_cmdline.bin).
[...]
> However, when I compare unmodified SMBIOS against what I get when
> supplying the patched binary table via command line, I get this:
>
> $ diff dmi_pc.txt dmi_cmdline.txt
> 2c2
> < Reading SMBIOS/DMI data from file dmidecode_pc.bin.
> ---
> > Reading SMBIOS/DMI data from file dmidecode_cmdline.bin.
> 4c4
> < 10 structures occupying 298 bytes.
> ---
> > 11 structures occupying 657 bytes.
> 108,109c108,120
> < Handle 0x7F00, DMI type 127, 4 bytes
> < End Of Table
> ---
> > Handle 0x5F4D, DMI type 95, 83 bytes
> > Unknown Type
> > Header and Data:
> > 5F 53 4D 5F 32 1F 02 04 4B 00 00 00 00 00 00 00
> > 5F 44 4D 49 5F D2 46 01 20 00 00 00 0B 00 24 00
> > 00 18 00 00 01 02 00 E8 03 00 08 00 00 00 00 00
> > 00 00 00 04 01 00 FF FF 42 6F 63 68 73 00 42 6F
> > 63 68 73 00 30 31 2F 30 31 2F 32 30 31 31 00 00
> > 01 1B 00
> > Strings:
> > ....
> >
> > Invalid entry length (0). DMI table is broken! Stop.
>
> No Type 2, no extra fields for Type 17, and a corrupt table to boot.
I had tested this qemu interface with my OVMF SMBIOS patches. It works.
(I used a Type 3 table.)
The problem in this case is that you can't just pass in a raw dump from
dmidecode. You need to prefix it with "smbios_header":
struct smbios_table {
struct smbios_header header;
uint8_t data[];
} QEMU_PACKED;
struct smbios_header {
uint16_t length;
uint8_t type;
} QEMU_PACKED;
You need to set "type" to 1 (SMBIOS_TABLE_ENTRY), and set "length" so
that it covers the entire "smbios_table" struct (ie. both header and
payload, where payload is your SMBIOS table). "length" is little endian.
Laszlo
next prev parent reply other threads:[~2014-02-18 21:09 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 16:09 [Qemu-devel] [PATCH v2, Ping] SMBIOS: Upgrade Type17 to v2.3, add Type2 Gabriel L. Somlo
2014-02-17 20:33 ` Kevin O'Connor
2014-02-18 10:21 ` Gerd Hoffmann
2014-02-18 19:17 ` Gabriel L. Somlo
2014-02-18 20:02 ` Kevin O'Connor
2014-02-19 9:46 ` Gerd Hoffmann
2014-02-19 22:03 ` [Qemu-devel] [PATCH v3] SMBIOS: Update Type 4, 17 structs to v2.3 of the spec Gabriel L. Somlo
2014-02-18 21:08 ` Laszlo Ersek [this message]
2014-02-18 21:28 ` [Qemu-devel] [PATCH v2, Ping] SMBIOS: Upgrade Type17 to v2.3, add Type2 Laszlo Ersek
2014-02-19 9:59 ` Gerd Hoffmann
2014-02-19 20:40 ` Gabriel L. Somlo
2014-02-19 22:20 ` Laszlo Ersek
2014-02-20 15:27 ` Gerd Hoffmann
2014-02-20 15:38 ` Gabriel L. Somlo
2014-02-20 15:42 ` Gabriel L. Somlo
2014-02-20 16:32 ` Gabriel L. Somlo
2014-02-20 18:07 ` Laszlo Ersek
2014-03-04 19:19 ` [Qemu-devel] [PATCH 1/2] QEMU: SMBIOS: Update all structs to v2.3; Add type 2 struct Gabriel L. Somlo
2014-03-04 19:20 ` [Qemu-devel] [PATCH 2/2 (RFC)] QEMU: SMBIOS: Build full smbios tables Gabriel L. Somlo
2014-03-04 20:34 ` Kevin O'Connor
2014-03-05 10:59 ` Gerd Hoffmann
2014-03-05 14:48 ` Gabriel L. Somlo
2014-03-06 9:03 ` Gerd Hoffmann
2014-03-06 16:09 ` Gabriel L. Somlo
2014-03-06 17:04 ` Laszlo Ersek
2014-03-09 2:57 ` [Qemu-devel] " Gabriel L. Somlo
2014-03-09 19:18 ` Laszlo Ersek
2014-03-09 23:40 ` Gabriel L. Somlo
2014-03-09 3:01 ` [Qemu-devel] [PATCH 1/7] SMBIOS: Update all table definitions to smbios spec v2.3 Gabriel L. Somlo
2014-03-09 3:01 ` [Qemu-devel] [PATCH 2/7] SMBIOS: Rename smbios_set_type1_defaults() for more general use Gabriel L. Somlo
2014-03-09 3:02 ` [Qemu-devel] [PATCH 3/7] SMBIOS: Streamline setting smbios defaults with macro Gabriel L. Somlo
2014-03-09 3:03 ` [Qemu-devel] [PATCH 4/7] SMBIOS: Replace type collision check mechanism with bitmaps Gabriel L. Somlo
2014-03-09 3:04 ` [Qemu-devel] [PATCH 5/7] SMBIOS: Add code to build full smbios tables Gabriel L. Somlo
2014-03-09 3:05 ` [Qemu-devel] [PATCH 6/7] SMBIOS: Build full tables for types 0 and 1 Gabriel L. Somlo
2014-03-09 3:05 ` [Qemu-devel] [PATCH 7/7] SMBIOS: Remove unused code for passing individual fields to bios Gabriel L. Somlo
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=5303CBD8.5090901@redhat.com \
--to=lersek@redhat.com \
--cc=agraf@suse.de \
--cc=gsomlo@gmail.com \
--cc=kevin@koconnor.net \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.