hvmloader: add fields for SMBIOS 2.4 compliance
PATCH v2 1/1 hvmloader: add fields for SMBIOS 2.4 compliance
The version of SMBIOS set in the entry point is 2.4, however several structures are missing fields required by 2.4. Fix this by adding the missing fields, this is based on the documents found at the DMTF site [0].
Most fields are set to 0 (undefined/not specified), except for the cache related handlers that need to be initialized to 0xffff in order to signal that the information is not provided.
[0] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.1.1.pdf
Reported by: Chris Gilbert <[email protected]>
---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Chris Gilbert <[email protected]>
---
It seems like the code in smbios likes to initialize everything to 0, but I don't see the value in that since the struct is already memset to 0.
---
Changes since v1:
- Add the contained elements array.
--- tools/firmware/hvmloader/smbios.c | 3 +++ tools/firmware/hvmloader/smbios_types.h | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+)
tools/firmware/hvmloader/smbios.c +3 -0
@@ -608,6 +608,9 @@ smbios_type_4_init( p->status =0x41 ;/* socket populated, CPU enabled */ p->upgrade =0x01 ;/* other */ + p->l1_cache_handle =0xffff ;/* No cache information structure provided. */ + p->l2_cache_handle =0xffff ;/* No cache information structure provided. */ + p->l3_cache_handle =0xffff ;/* No cache information structure provided. */ start +=sizeof (struct smbios_type_4 );
tools/firmware/hvmloader/smbios_types.h +24 -0
@@ -92,6 +92,13 @@ struct smbios_type_2 {uint8_t serial_number_str; } __attribute__ ((packed)); +/* System Enclosure - Contained Elements */ +struct smbios_contained_element { +uint8_t type; +uint8_t minimum; +uint8_t maximum; +} __attribute__ ((packed)); +/* SMBIOS type 3 - System Enclosure */ struct smbios_type_3 {struct smbios_structure_header header;
@@ -104,6 +111,12 @@ struct smbios_type_3 {uint8_t power_supply_state;uint8_t thermal_state;uint8_t security_status; +uint32_t oem_specific; +uint8_t height; +uint8_t number_of_power_cords; +uint8_t contained_element_count; +uint8_t contained_element_length; +struct smbios_contained_element contained_elements[]; } __attribute__ ((packed));/* SMBIOS type 4 - Processor Information */
@@ -121,6 +134,12 @@ struct smbios_type_4 {uint16_t current_speed;uint8_t status;uint8_t upgrade; +uint16_t l1_cache_handle; +uint16_t l2_cache_handle; +uint16_t l3_cache_handle; +uint8_t serial_number_str; +uint8_t asset_tag_str; +uint8_t part_number_str; } __attribute__ ((packed));/* SMBIOS type 11 - OEM Strings */
@@ -158,6 +177,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_str; +uint8_t part_number_str; } __attribute__ ((packed));/* SMBIOS type 19 - Memory Array Mapped Address */
Signature · 7 lines
2.11.0 (Apple Git-81) _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 5 lines · Roger Pau Monne
The version of SMBIOS set in the entry point is 2.4, however several structures are missing fields required by 2.4. Fix this by adding the missing fields, this is based on the documents found at the DMTF site [0].
Quoted 8 lines
Most fields are set to 0 (undefined/not specified), except for the cache related handlers that need to be initialized to
0xffffin order to signal that the information is not provided.[0] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.1.1.pdf
Signed-off-by Roger Pau Monné <[email protected]>Reported by: Chris Gilbert <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel