aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJulia Suvorova <jusual@redhat.com>2022-10-11 13:17:27 +0200
committerMichael S. Tsirkin <mst@redhat.com>2022-11-07 14:08:17 -0500
commit05e27d74c7dc5318367521f020bf0d4a32228dcc (patch)
tree61751de8d24f9085d663597e62a1242740031a70 /include
parent923b8921d210763359e96246a58658ac0db6c645 (diff)
downloadqemu-05e27d74c7dc5318367521f020bf0d4a32228dcc.zip
qemu-05e27d74c7dc5318367521f020bf0d4a32228dcc.tar.gz
qemu-05e27d74c7dc5318367521f020bf0d4a32228dcc.tar.bz2
hw/smbios: add core_count2 to smbios table type 4
In order to use the increased number of cpus, we need to bring smbios tables in line with the SMBIOS 3.0 specification. This allows us to introduce core_count2 which acts as a duplicate of core_count if we have fewer cores than 256, and contains the actual core number per socket if we have more. core_enabled2 and thread_count2 fields work the same way. Signed-off-by: Julia Suvorova <jusual@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20220731162141.178443-2-jusual@redhat.com> Message-Id: <20221011111731.101412-2-jusual@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/firmware/smbios.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h
index e7d386f..7f3259a 100644
--- a/include/hw/firmware/smbios.h
+++ b/include/hw/firmware/smbios.h
@@ -18,6 +18,8 @@
#define SMBIOS_MAX_TYPE 127
+#define offsetofend(TYPE, MEMBER) \
+ (offsetof(TYPE, MEMBER) + sizeof_field(TYPE, MEMBER))
/* memory area description, used by type 19 table */
struct smbios_phys_mem_area {
@@ -187,8 +189,18 @@ struct smbios_type_4 {
uint8_t thread_count;
uint16_t processor_characteristics;
uint16_t processor_family2;
+ /* SMBIOS spec 3.0.0, Table 21 */
+ uint16_t core_count2;
+ uint16_t core_enabled2;
+ uint16_t thread_count2;
} QEMU_PACKED;
+typedef enum smbios_type_4_len_ver {
+ SMBIOS_TYPE_4_LEN_V28 = offsetofend(struct smbios_type_4,
+ processor_family2),
+ SMBIOS_TYPE_4_LEN_V30 = offsetofend(struct smbios_type_4, thread_count2),
+} smbios_type_4_len_ver;
+
/* SMBIOS type 8 - Port Connector Information */
struct smbios_type_8 {
struct smbios_structure_header header;