Received: from eggs.gnu.org ([2001:4830:134:3::10]:45949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGFGN-0002ap-BH for qemu-devel@nongnu.org; Wed, 19 Feb 2014 17:05:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGFGH-0005xP-P5 for qemu-devel@nongnu.org; Wed, 19 Feb 2014 17:05:07 -0500 Received: from mail-qa0-x230.google.com ([2607:f8b0:400d:c00::230]:40242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGFGH-0005x3-H7 for qemu-devel@nongnu.org; Wed, 19 Feb 2014 17:05:01 -0500 Received: by mail-qa0-f48.google.com with SMTP id f11so1634476qae.7 for ; Wed, 19 Feb 2014 14:05:00 -0800 (PST) Date: Wed, 19 Feb 2014 17:03:04 -0500 From: "Gabriel L. Somlo" Message-ID: <20140219220303.GB25087@ERROL.INI.CMU.EDU> References: <20140217160947.GO29329@ERROL.INI.CMU.EDU> <20140217203333.GB30268@morn.localdomain> <1392718893.4724.12.camel@nilsson.home.kraxel.org> <20140218191728.GS29329@ERROL.INI.CMU.EDU> <20140218200216.GA3259@morn.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140218200216.GA3259@morn.localdomain> Subject: [Qemu-devel] [PATCH v3] SMBIOS: Update Type 4, 17 structs to v2.3 of the spec List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: pbonzini@redhat.com, agraf@suse.de, seabios@seabios.org, Gerd Hoffmann , qemu-devel@nongnu.org Add v2.3 fields to Type 4 and 17 structures, to comply with the major/minor smbios spec version (2.4) advertised in the smbios entry point structure. Signed-off-by: Gabriel Somlo --- On Tue, Feb 18, 2014 at 03:02:16PM -0500, Kevin O'Connor wrote: > Thanks for running tests. One thing that has bitten us in the past is > OSes re-running license checks and/or popping up "new hardware" > notifications on bios table changes. Completely orthogonal to Type 2 (Base Board) and to the QEMU/smbios conversation: Since SeaBIOS sets up the SMBIOS entry point structure like this: ep->smbios_major_version = 2; ep->smbios_minor_version = 4; shouldn't all type structures contain all fields required by v2.4 of the spec, which means the type 17 struct missing v2.3 fields is actually a bug ? I had a feeling I should have kept the patches separate :) Along these lines, we're also missing the following fields for Type 4: serial_number_str, asset_tag_number_str, part_number_str I get that a new Type 2 suddenly showing up *might* confuse some guest OSs, but what do you think about the type 4 and type 17 v2.3 fields ? Thanks, Gabriel src/fw/smbios.c | 10 ++++++++++ src/std/smbios.h | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/fw/smbios.c b/src/fw/smbios.c index 55c662a..f0cdd5c 100644 --- a/src/fw/smbios.c +++ b/src/fw/smbios.c @@ -344,6 +344,10 @@ smbios_init_type_4(void *start, unsigned int cpu_number) p->l2_cache_handle = 0xffff; p->l3_cache_handle = 0xffff; + load_str_field_or_skip(4, serial_number_str); + load_str_field_or_skip(4, asset_tag_number_str); + load_str_field_or_skip(4, part_number_str); + *end = 0; end++; if (!str_index) { @@ -417,6 +421,12 @@ smbios_init_type_17(void *start, u32 size_mb, int instance) set_field_with_default(17, memory_type, 0x07); /* RAM */ set_field_with_default(17, type_detail, 0); + set_field_with_default(17, speed, 0); /* unknown */ + load_str_field_or_skip(17, manufacturer_str); + load_str_field_or_skip(17, serial_number_str); + load_str_field_or_skip(17, asset_tag_number_str); + load_str_field_or_skip(17, part_number_str); + *end = 0; end++; if (!str_index) { diff --git a/src/std/smbios.h b/src/std/smbios.h index 0513716..7ae3968 100644 --- a/src/std/smbios.h +++ b/src/std/smbios.h @@ -96,6 +96,10 @@ struct smbios_type_4 { u16 l1_cache_handle; u16 l2_cache_handle; u16 l3_cache_handle; + /* v2.3 fields: */ + u8 serial_number_str; + u8 asset_tag_number_str; + u8 part_number_str; } PACKED; /* SMBIOS type 16 - Physical Memory Array @@ -127,6 +131,12 @@ struct smbios_type_17 { u8 bank_locator_str; u8 memory_type; u16 type_detail; + /* v2.3 fields: */ + u16 speed; + u8 manufacturer_str; + u8 serial_number_str; + u8 asset_tag_number_str; + u8 part_number_str; } PACKED; /* SMBIOS type 19 - Memory Array Mapped Address */ -- 1.8.1.4