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 1/3] hw/i386/pc: Refactor logic to set SMBIOS set defaults
Date: Tue, 6 Jun 2023 09:45:19 +0200 [thread overview]
Message-ID: <20230606094519.75a38aa5@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <20230605213906.644883-2-suravee.suthikulpanit@amd.com>
On Mon, 5 Jun 2023 16:39:04 -0500
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> wrote:
> In preparation for subsequent code to upgrade default SMBIOS
> entry point type. There is no functional change.
>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> hw/i386/pc.c | 12 ++++++++++++
> hw/i386/pc_piix.c | 9 ---------
> hw/i386/pc_q35.c | 8 --------
> 3 files changed, 12 insertions(+), 17 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index bb62c994fa..8fc34f5454 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -781,6 +781,18 @@ void pc_machine_done(Notifier *notifier, void *data)
>
> acpi_setup();
> if (x86ms->fw_cfg) {
> + PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
> +
> + if (pcmc->smbios_defaults) {
> + MachineClass *mc = MACHINE_GET_CLASS(pcms);
> +
> + /* These values are guest ABI, do not change */
> + smbios_set_defaults("QEMU", mc->desc,
> + mc->name, pcmc->smbios_legacy_mode,
> + pcmc->smbios_uuid_encoded,
> + pcms->smbios_entry_point_type);
> + }
>
well, pc_machine_done() is the hack for the last minute changes to
board that can't done earlier otherwise (during machine_initfn time).
So I'd prefer not adding anything there unless we have to.
> fw_cfg_build_smbios(MACHINE(pcms), x86ms->fw_cfg);
> fw_cfg_build_feature_control(MACHINE(pcms), x86ms->fw_cfg);
> /* update FW_CFG_NB_CPUS to account for -device added CPUs */
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index d5b0dcd1fe..da6ba4eeb4 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -198,15 +198,6 @@ static void pc_init1(MachineState *machine,
>
> pc_guest_info_init(pcms);
>
> - if (pcmc->smbios_defaults) {
> - MachineClass *mc = MACHINE_GET_CLASS(machine);
> - /* These values are guest ABI, do not change */
> - smbios_set_defaults("QEMU", mc->desc,
> - mc->name, pcmc->smbios_legacy_mode,
> - pcmc->smbios_uuid_encoded,
> - pcms->smbios_entry_point_type);
> - }
> -
> /* allocate ram and load rom/bios */
> if (!xen_enabled()) {
> pc_memory_init(pcms, system_memory, rom_memory, hole64_size);
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index 6155427e48..a58cd1d3ea 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -198,14 +198,6 @@ static void pc_q35_init(MachineState *machine)
>
> pc_guest_info_init(pcms);
>
> - if (pcmc->smbios_defaults) {
> - /* These values are guest ABI, do not change */
> - smbios_set_defaults("QEMU", mc->desc,
> - mc->name, pcmc->smbios_legacy_mode,
> - pcmc->smbios_uuid_encoded,
> - pcms->smbios_entry_point_type);
> - }
> -
> /* create pci host bus */
> q35_host = Q35_HOST_DEVICE(qdev_new(TYPE_Q35_HOST_DEVICE));
>
next prev parent reply other threads:[~2023-06-06 7:46 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 [this message]
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
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=20230606094519.75a38aa5@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).