From: Igor Mammedov <imammedo@redhat.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: <qemu-devel@nongnu.org>, <pbonzini@redhat.com>,
<richard.henderson@linaro.org>, <eduardo@habkost.net>,
<mst@redhat.com>, <marcel.apfelbaum@gmail.com>,
<berrange@redhat.com>, <jusual@redhat.com>, <dfaggioli@suse.com>,
<joao.m.martins@oracle.com>, <jon.grimm@amd.com>,
<santosh.Shukla@amd.com>
Subject: Re: [PATCH v4 2/3] hw/i386/pc: Default to use SMBIOS 3.0 for newer machine models
Date: Tue, 6 Jun 2023 09:35:41 +0200 [thread overview]
Message-ID: <20230606093541.5a2e6b87@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <20230605213906.644883-3-suravee.suthikulpanit@amd.com>
On Mon, 5 Jun 2023 16:39:05 -0500
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> wrote:
> Currently, pc-q35 and pc-i44fx machine models are default to use SMBIOS 2.8
> (32-bit entry point). Since SMBIOS 3.0 (64-bit entry point) is now fully
> supported since QEMU 7.0, default to use SMBIOS 3.0 for newer machine
> models. This is necessary to avoid the following message when launching
> a VM with large number of vcpus.
>
> "SMBIOS 2.1 table length 66822 exceeds 65535"
>
> Note that user can still override the entry point tyme w/ QEMU option
> "-M ..., smbios-entry-point-type=[32|64].
>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> hw/i386/pc.c | 14 +++++++++++++-
> hw/i386/pc_piix.c | 5 +++++
> hw/i386/pc_q35.c | 5 +++++
> include/hw/i386/pc.h | 2 ++
> 4 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 8fc34f5454..5a87b82185 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -786,6 +786,14 @@ void pc_machine_done(Notifier *notifier, void *data)
> if (pcmc->smbios_defaults) {
> MachineClass *mc = MACHINE_GET_CLASS(pcms);
>
> + /*
> + * Check if user has specified a command line option
> + * to override the SMBIOS default entry point type.
> + */
> + if (!pcms->smbios_use_cmdline_ep_type) {
> + pcms->smbios_entry_point_type = pcmc->default_smbios_ep_type;
> + }
why pcms->smbios_entry_point_type that we already have is not enough
we need to add extra pcms->smbios_use_cmdline_ep_type field?
> +
> /* These values are guest ABI, do not change */
> smbios_set_defaults("QEMU", mc->desc,
> mc->name, pcmc->smbios_legacy_mode,
> @@ -1782,7 +1790,10 @@ static void pc_machine_set_smbios_ep(Object *obj, Visitor *v, const char *name,
> {
> PCMachineState *pcms = PC_MACHINE(obj);
>
> - visit_type_SmbiosEntryPointType(v, name, &pcms->smbios_entry_point_type, errp);
> + pcms->smbios_use_cmdline_ep_type =
> + visit_type_SmbiosEntryPointType(v, name,
> + &pcms->smbios_entry_point_type,
> + errp);
> }
>
> static void pc_machine_get_max_ram_below_4g(Object *obj, Visitor *v,
> @@ -1992,6 +2003,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
> mc->nvdimm_supported = true;
> mc->smp_props.dies_supported = true;
> mc->default_ram_id = "pc.ram";
> + pcmc->default_smbios_ep_type = SMBIOS_ENTRY_POINT_TYPE_64;
>
> object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size",
> pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g,
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index da6ba4eeb4..1a2bb25c75 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -467,11 +467,16 @@ DEFINE_I440FX_MACHINE(v8_1, "pc-i440fx-8.1", NULL,
>
> static void pc_i440fx_8_0_machine_options(MachineClass *m)
> {
> + PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
> +
> pc_i440fx_8_1_machine_options(m);
> m->alias = NULL;
> m->is_default = false;
> compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len);
> compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len);
> +
> + /* For pc-i44fx-8.0 and older, use SMBIOS 2.8 by default */
> + pcmc->default_smbios_ep_type = SMBIOS_ENTRY_POINT_TYPE_32;
> }
>
> DEFINE_I440FX_MACHINE(v8_0, "pc-i440fx-8.0", NULL,
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index a58cd1d3ea..371cca7484 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -379,10 +379,15 @@ DEFINE_Q35_MACHINE(v8_1, "pc-q35-8.1", NULL,
>
> static void pc_q35_8_0_machine_options(MachineClass *m)
> {
> + PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
> +
> pc_q35_8_1_machine_options(m);
> m->alias = NULL;
> compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len);
> compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len);
> +
> + /* For pc-q35-8.0 and older, use SMBIOS 2.8 by default */
> + pcmc->default_smbios_ep_type = SMBIOS_ENTRY_POINT_TYPE_32;
> }
>
> DEFINE_Q35_MACHINE(v8_0, "pc-q35-8.0", NULL,
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index c661e9cc80..f754da5a38 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -50,6 +50,7 @@ typedef struct PCMachineState {
> bool i8042_enabled;
> bool default_bus_bypass_iommu;
> uint64_t max_fw_size;
> + bool smbios_use_cmdline_ep_type;
>
> /* ACPI Memory hotplug IO base address */
> hwaddr memhp_io_base;
> @@ -110,6 +111,7 @@ struct PCMachineClass {
> bool smbios_defaults;
> bool smbios_legacy_mode;
> bool smbios_uuid_encoded;
> + SmbiosEntryPointType default_smbios_ep_type;
>
> /* RAM / address space compat: */
> bool gigabyte_align;
next prev parent reply other threads:[~2023-06-06 7:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-05 21:39 [PATCH v4 0/3] hw/i386/pc: Update max_cpus and default to SMBIOS Suravee Suthikulpanit
2023-06-05 21:39 ` [PATCH v4 1/3] hw/i386/pc: Refactor logic to set SMBIOS set defaults Suravee Suthikulpanit
2023-06-06 7:45 ` Igor Mammedov
2023-06-07 1:23 ` Suthikulpanit, Suravee
2023-06-05 21:39 ` [PATCH v4 2/3] hw/i386/pc: Default to use SMBIOS 3.0 for newer machine models Suravee Suthikulpanit
2023-06-06 7:35 ` Igor Mammedov [this message]
2023-06-06 8:11 ` Igor Mammedov
2023-06-07 1:46 ` Suthikulpanit, Suravee
2023-06-07 1:25 ` Suthikulpanit, Suravee
2023-06-05 21:39 ` [PATCH v4 3/3] pc: q35: Bump max_cpus to 1024 Suravee Suthikulpanit
2023-06-06 7:55 ` Igor Mammedov
2023-06-07 1:19 ` Suthikulpanit, Suravee
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=20230606093541.5a2e6b87@imammedo.users.ipa.redhat.com \
--to=imammedo@redhat.com \
--cc=berrange@redhat.com \
--cc=dfaggioli@suse.com \
--cc=eduardo@habkost.net \
--cc=joao.m.martins@oracle.com \
--cc=jon.grimm@amd.com \
--cc=jusual@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=santosh.Shukla@amd.com \
--cc=suravee.suthikulpanit@amd.com \
/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).