From: Julia Suvorova <jusual@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>, Ani Sinha <ani@anisinha.ca>,
Julia Suvorova <jusual@redhat.com>
Subject: [PATCH 1/5] hw/smbios: add core_count2 to smbios table type 4
Date: Fri, 27 May 2022 18:56:47 +0200 [thread overview]
Message-ID: <20220527165651.28092-2-jusual@redhat.com> (raw)
In-Reply-To: <20220527165651.28092-1-jusual@redhat.com>
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>
---
include/hw/firmware/smbios.h | 3 +++
hw/smbios/smbios.c | 11 +++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h
index 4b7ad77a44..c427ae5558 100644
--- a/include/hw/firmware/smbios.h
+++ b/include/hw/firmware/smbios.h
@@ -187,6 +187,9 @@ struct smbios_type_4 {
uint8_t thread_count;
uint16_t processor_characteristics;
uint16_t processor_family2;
+ uint16_t core_count2;
+ uint16_t core_enabled2;
+ uint16_t thread_count2;
} QEMU_PACKED;
/* SMBIOS type 11 - OEM strings */
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 60349ee402..45d7be6b30 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -709,8 +709,15 @@ static void smbios_build_type_4_table(MachineState *ms, unsigned instance)
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);
- t->core_count = t->core_enabled = ms->smp.cores;
- t->thread_count = ms->smp.threads;
+
+ t->core_count = (ms->smp.cores > 255) ? 0xFF : ms->smp.cores;
+ t->core_enabled = t->core_count;
+
+ t->core_count2 = t->core_enabled2 = cpu_to_le16(ms->smp.cores);
+
+ t->thread_count = (ms->smp.threads > 255) ? 0xFF : ms->smp.threads;
+ t->thread_count2 = cpu_to_le16(ms->smp.threads);
+
t->processor_characteristics = cpu_to_le16(0x02); /* Unknown */
t->processor_family2 = cpu_to_le16(0x01); /* Other */
--
2.35.1
next prev parent reply other threads:[~2022-05-27 17:11 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 16:56 [PATCH 0/5] hw/smbios: add core_count2 to smbios table type 4 Julia Suvorova
2022-05-27 16:56 ` Julia Suvorova [this message]
2022-05-28 4:34 ` [PATCH 1/5] " Ani Sinha
2022-05-31 12:40 ` Julia Suvorova
2022-06-02 14:31 ` Igor Mammedov
2022-06-02 14:35 ` Igor Mammedov
2022-06-06 11:11 ` Julia Suvorova
2022-06-07 9:51 ` Igor Mammedov
2022-05-27 16:56 ` [PATCH 2/5] bios-tables-test: teach test to use smbios 3.0 tables Julia Suvorova
2022-05-30 6:10 ` Ani Sinha
2022-05-31 12:39 ` Julia Suvorova
2022-06-02 15:04 ` Igor Mammedov
2022-06-06 10:52 ` Julia Suvorova
2022-06-07 9:55 ` Igor Mammedov
2022-05-27 16:56 ` [PATCH 3/5] tests/acpi: allow changes for core_count2 test Julia Suvorova
2022-05-28 5:28 ` Ani Sinha
2022-05-27 16:56 ` [PATCH 4/5] bios-tables-test: add test for number of cores > 255 Julia Suvorova
2022-05-28 5:22 ` Ani Sinha
2022-05-31 12:22 ` Julia Suvorova
2022-05-31 13:14 ` Ani Sinha
2022-05-31 15:05 ` Julia Suvorova
2022-06-01 5:09 ` Ani Sinha
2022-06-01 5:06 ` Ani Sinha
2022-06-02 15:20 ` Igor Mammedov
2022-06-02 16:31 ` Ani Sinha
2022-06-06 11:38 ` Julia Suvorova
2022-06-07 10:08 ` Igor Mammedov
2022-05-27 16:56 ` [PATCH 5/5] tests/acpi: update tables for new core count test Julia Suvorova
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220527165651.28092-2-jusual@redhat.com \
--to=jusual@redhat.com \
--cc=ani@anisinha.ca \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).