git: 04f55b5b0e8f - main - bhyve smbios type 3 structure is incorrect

From: Toomas Soome <tsoome_at_FreeBSD.org>
Date: Wed, 29 Dec 2021 22:31:40 UTC
The branch main has been updated by tsoome:

URL: https://cgit.FreeBSD.org/src/commit/?id=04f55b5b0e8f561aac100083f07df3f570880d69

commit 04f55b5b0e8f561aac100083f07df3f570880d69
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2021-12-26 09:01:16 +0000
Commit:     Toomas Soome <tsoome@FreeBSD.org>
CommitDate: 2021-12-27 18:06:33 +0000

    bhyve smbios type 3 structure is incorrect
    
    If you look at the SMBIOS specification, we'll find something is
    missing. In particular at offset 0Dh is supposed to be the OEM-defined
    field. This should go between security and height. It is not legal to
    actually skip this and will lead to other folks not properly
    interpreting later parts of the table.
    
    https://www.illumos.org/issues/14312
    
    Reviewed by:    jhb
    Submitted by:   Robert Mustacchi <rm@fingolfin.org>
    Obtained from:  ilumos
    MFC after:      1 week
    Differential Revision: https://reviews.freebsd.org/D33682
---
 usr.sbin/bhyve/smbiostbl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usr.sbin/bhyve/smbiostbl.c b/usr.sbin/bhyve/smbiostbl.c
index ada3177105a9..2dc50e6e6f01 100644
--- a/usr.sbin/bhyve/smbiostbl.c
+++ b/usr.sbin/bhyve/smbiostbl.c
@@ -199,6 +199,7 @@ struct smbios_table_type3 {
 	uint8_t			psstate;	/* power supply state */
 	uint8_t			tstate;		/* thermal state */
 	uint8_t			security;	/* security status */
+	uint32_t		oemdata;	/* OEM-specific data */
 	uint8_t			uheight;	/* height in 'u's */
 	uint8_t			cords;		/* number of power cords */
 	uint8_t			elems;		/* number of element records */
@@ -417,6 +418,7 @@ struct smbios_table_type3 smbios_type3_template = {
 	SMBIOS_CHST_SAFE,
 	SMBIOS_CHST_SAFE,
 	SMBIOS_CHSC_NONE,
+	0,		/* OEM specific data, we have none */
 	0,		/* height in 'u's (0=enclosure height unspecified) */
 	0,		/* number of power cords (0=number unspecified) */
 	0,		/* number of contained element records */