qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios buil


From: Michael Tokarev
Subject: Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build
Date: Mon, 25 Mar 2024 18:03:15 +0300
User-agent: Mozilla Thunderbird

25.03.2024 16:40, Philippe Mathieu-Daudé пишет:
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:

How about this instead (in addition to original patch):

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 27a68071d7..4e3c220b85 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -109,7 +109,9 @@ struct PCMachineClass {

     /* SMBIOS compat: */
     bool smbios_defaults;
+#ifdef CONFIG_SMBIOS_LEGACY
     bool smbios_legacy_mode;
+#endif
     bool smbios_uuid_encoded;
     SmbiosEntryPointType default_smbios_ep_type;


?

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]