From: Igor Mammedov <imammedo@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
"Michael S . Tsirkin" <mst@redhat.com>,
Ani Sinha <anisinha@redhat.com>
Subject: Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build
Date: Mon, 25 Mar 2024 17:00:17 +0100 [thread overview]
Message-ID: <20240325170017.5b830e37@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <ca6b1ae9-14b9-413b-93dc-a28d930b0e3a@linaro.org>
On Mon, 25 Mar 2024 14:40:21 +0100
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> Hi Michael,
>
> On 25/3/24 14:09, Michael Tokarev wrote:
> > When building qemu with smbios but not legacy mode (eg minimal microvm build),
> > link fails with:
> >
> > hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy'
> >
> > This is because fw_cfg interface can call this function if CONFIG_SMBIOS
> > is defined. Made this code block to depend on CONFIG_SMBIOS_LEGACY.
> >
> > Fixes: b42b0e4daaa5 "smbios: build legacy mode code only for 'pc' machine"
> > Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> > ---
> > hw/i386/fw_cfg.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
> > index d802d2787f..d5e78a9183 100644
> > --- a/hw/i386/fw_cfg.c
> > +++ b/hw/i386/fw_cfg.c
> > @@ -70,6 +70,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,
> > /* tell smbios about cpuid version and features */
> > smbios_set_cpuid(cpu->env.cpuid_version, cpu->env.features[FEAT_1_EDX]);
> >
> > +#ifdef CONFIG_SMBIOS_LEGACY
> > if (pcmc->smbios_legacy_mode) {
>
> But then having pcmc->smbios_legacy_mode == true without
> CONFIG_SMBIOS_LEGACY would be a bug. IMHO what we want is:
>
> -- >8 --
> diff --git a/hw/smbios/smbios_legacy_stub.c b/hw/smbios/smbios_legacy_stub.c
> index f29b15316c..7d593dca98 100644
> --- a/hw/smbios/smbios_legacy_stub.c
> +++ b/hw/smbios/smbios_legacy_stub.c
> @@ -13,3 +13,8 @@
> void smbios_add_usr_blob_size(size_t size)
> {
> }
> +
> +uint8_t *smbios_get_table_legacy(size_t *length, Error **errp)
> +{
> + g_assert_not_reached();
> +}
Agreed
Philippe,
shall I post a patch or will you do this?
> ---
>
> > smbios_tables = smbios_get_table_legacy(&smbios_tables_len,
> > &error_fatal);
> > @@ -77,6 +78,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,
> > smbios_tables, smbios_tables_len);
> > return;
> > }
> > +#endif
> >
> > /* build the array of physical mem area from e820 table */
> > mem_array = g_malloc0(sizeof(*mem_array) * e820_get_num_entries());
>
next prev parent reply other threads:[~2024-03-25 16:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 13:09 [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build Michael Tokarev
2024-03-25 13:40 ` Philippe Mathieu-Daudé
2024-03-25 15:03 ` Michael Tokarev
2024-03-25 16:00 ` Igor Mammedov [this message]
2024-03-25 15:20 ` Igor Mammedov
2024-03-25 18:01 ` Michael Tokarev
2024-03-26 12:32 ` Igor Mammedov
2024-03-25 15:29 ` Igor Mammedov
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=20240325170017.5b830e37@imammedo.users.ipa.redhat.com \
--to=imammedo@redhat.com \
--cc=anisinha@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).