[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [QEMU v5 PATCH 11/18] SMBIOS: Update all table definitions
From: |
Gabriel L. Somlo |
Subject: |
[Qemu-devel] [QEMU v5 PATCH 11/18] SMBIOS: Update all table definitions to smbios spec v2.3 |
Date: |
Fri, 11 Apr 2014 12:11:51 -0400 |
Table definitions for types 4 and 17 are only up to v2.0,
so add fields specified in smbios v2.3, as expected (and
advertised) by the SeaBIOS smbios entry point structure.
In particular, OS X guests insist on type 17 being v2.3
compliant, to avoid GUI crashes when "about this mac" is
chosen in the Finder menu.
Signed-off-by: Gabriel Somlo <address@hidden>
---
hw/i386/smbios.c | 9 +++++++++
include/hw/i386/smbios.h | 13 +++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index b1f1d46..f7a9a92 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -499,6 +499,9 @@ static void smbios_build_type_4_table(unsigned instance)
t->l1_cache_handle = 0xFFFF; /* N/A */
t->l2_cache_handle = 0xFFFF; /* N/A */
t->l3_cache_handle = 0xFFFF; /* N/A */
+ SMBIOS_TABLE_SET_STR(4, serial_number_str, type4.serial);
+ SMBIOS_TABLE_SET_STR(4, asset_tag_number_str, type4.asset);
+ SMBIOS_TABLE_SET_STR(4, part_number_str, type4.part);
SMBIOS_BUILD_TABLE_POST;
smbios_type4_count++;
@@ -557,6 +560,11 @@ static void smbios_build_type_17_table(unsigned instance,
ram_addr_t size)
SMBIOS_TABLE_SET_STR(17, bank_locator_str, type17.bank);
t->memory_type = 0x07; /* RAM */
t->type_detail = 0; /* hardcoded in SeaBIOS */
+ t->speed = 0; /* Unknown */
+ SMBIOS_TABLE_SET_STR(17, manufacturer_str, type17.manufacturer);
+ SMBIOS_TABLE_SET_STR(17, serial_number_str, type17.serial);
+ SMBIOS_TABLE_SET_STR(17, asset_tag_number_str, type17.asset);
+ SMBIOS_TABLE_SET_STR(17, part_number_str, type17.part);
SMBIOS_BUILD_TABLE_POST;
}
@@ -673,6 +681,7 @@ void smbios_set_defaults(const char *manufacturer,
SMBIOS_SET_DEFAULT(type4.version, version);
*/
SMBIOS_SET_DEFAULT(type17.loc_pfx, "DIMM");
+ SMBIOS_SET_DEFAULT(type17.manufacturer, manufacturer);
}
uint8_t *smbios_get_table(size_t *length)
diff --git a/include/hw/i386/smbios.h b/include/hw/i386/smbios.h
index 2a0d384..6bde151 100644
--- a/include/hw/i386/smbios.h
+++ b/include/hw/i386/smbios.h
@@ -100,7 +100,7 @@ struct smbios_type_3 {
/* contained elements follow */
} QEMU_PACKED;
-/* SMBIOS type 4 - Processor Information (v2.0) */
+/* SMBIOS type 4 - Processor Information (v2.3) */
struct smbios_type_4 {
struct smbios_structure_header header;
uint8_t socket_designation_str;
@@ -118,6 +118,10 @@ struct smbios_type_4 {
uint16_t l1_cache_handle;
uint16_t l2_cache_handle;
uint16_t l3_cache_handle;
+ uint8_t serial_number_str;
+ uint8_t asset_tag_number_str;
+ uint8_t part_number_str;
+
} QEMU_PACKED;
/* SMBIOS type 16 - Physical Memory Array */
@@ -131,7 +135,7 @@ struct smbios_type_16 {
uint16_t number_of_memory_devices;
} QEMU_PACKED;
-/* SMBIOS type 17 - Memory Device */
+/* SMBIOS type 17 - Memory Device (v2.3) */
struct smbios_type_17 {
struct smbios_structure_header header;
uint16_t physical_memory_array_handle;
@@ -145,6 +149,11 @@ struct smbios_type_17 {
uint8_t bank_locator_str;
uint8_t memory_type;
uint16_t type_detail;
+ uint16_t speed;
+ uint8_t manufacturer_str;
+ uint8_t serial_number_str;
+ uint8_t asset_tag_number_str;
+ uint8_t part_number_str;
} QEMU_PACKED;
/* SMBIOS type 19 - Memory Array Mapped Address */
--
1.9.0
- [Qemu-devel] [QEMU v5 PATCH 01/18] SMBIOS: Rename smbios_set_type1_defaults() for more general use, (continued)
- [Qemu-devel] [QEMU v5 PATCH 01/18] SMBIOS: Rename smbios_set_type1_defaults() for more general use, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 02/18] SMBIOS: Use macro to set smbios defaults, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 03/18] SMBIOS: Use bitmaps to check for smbios table collisions, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 04/18] SMBIOS: Add code to build full smbios tables; build type 2 table, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 05/18] SMBIOS: Build full tables for types 0 and 1, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 06/18] SMBIOS: Remove unused code for passing individual fields to bios, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 07/18] SMBIOS: Build full type 3 table, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 09/18] SMBIOS: Build full smbios memory tables (type 16, 17, 19, and 20), Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 10/18] SMBIOS: Build full tables for type 32 and 127, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 08/18] SMBIOS: Build full type 4 tables, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 11/18] SMBIOS: Update all table definitions to smbios spec v2.3,
Gabriel L. Somlo <=
- [Qemu-devel] [QEMU v5 PATCH 13/18] SMBIOS: Stop including type 20 tables, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 12/18] SMBIOS: Remove SeaBIOS compatibility quirks, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 14/18] SMBIOS: Use e820 memory map to generate type 19 tables, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 15/18] SMBIOS: Update type 3 definition to smbios spec v2.7, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 18/18] SMBIOS: Generate complete smbios tables, including entry point, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 16/18] SMBIOS: Update type 4 definition to smbios spec v2.6, Gabriel L. Somlo, 2014/04/11
- [Qemu-devel] [QEMU v5 PATCH 17/18] SMBIOS: Update memory table types (16, 17, and 19) to smbios spec v2.8, Gabriel L. Somlo, 2014/04/11
- Re: [Qemu-devel] [QEMU v5 PATCH 00/18] SMBIOS: build full tables in QEMU, Kevin O'Connor, 2014/04/12