[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/24] smbios: cleanup smbios_get_tables() from legacy handling
From: |
Michael S. Tsirkin |
Subject: |
[PULL 07/24] smbios: cleanup smbios_get_tables() from legacy handling |
Date: |
Mon, 18 Mar 2024 12:15:49 -0400 |
From: Igor Mammedov <imammedo@redhat.com>
smbios_get_tables() bails out right away if leagacy mode is enabled
and won't generate any SMBIOS tables. At the same time x86 specific
fw_cfg_build_smbios() will genarate legacy tables and then proceed
to preparing temporary mem_array for useless call to
smbios_get_tables() and then discard it.
Drop legacy related check in smbios_get_tables() and return from
fw_cfg_build_smbios() early if legacy tables where built without
proceeding to non legacy part of the function.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Message-Id: <20240314152302.2324164-5-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/fw_cfg.c | 1 +
hw/smbios/smbios.c | 6 ------
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index 98a478c276..a635234e68 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -74,6 +74,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState
*fw_cfg)
if (smbios_tables) {
fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES,
smbios_tables, smbios_tables_len);
+ return;
}
/* build the array of physical mem area from e820 table */
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 949c2d74a1..a1741a64a6 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -1229,12 +1229,6 @@ void smbios_get_tables(MachineState *ms,
{
unsigned i, dimm_cnt, offset;
- if (smbios_legacy) {
- *tables = *anchor = NULL;
- *tables_len = *anchor_len = 0;
- return;
- }
-
if (!smbios_immutable) {
smbios_build_type_0_table();
smbios_build_type_1_table();
--
MST
- [PULL 00/24] virtio,pc,pci: bugfixes, Michael S. Tsirkin, 2024/03/18
- [PULL 01/24] SMBIOS: fix long lines, Michael S. Tsirkin, 2024/03/18
- [PULL 03/24] docs/specs/pvpanic: mark shutdown event as not implemented, Michael S. Tsirkin, 2024/03/18
- [PULL 02/24] qapi: document PCIe Gen5/Gen6 speeds since 9.0, Michael S. Tsirkin, 2024/03/18
- [PULL 04/24] tests: smbios: make it possible to write SMBIOS only test, Michael S. Tsirkin, 2024/03/18
- [PULL 06/24] tests: smbios: add test for legacy mode CLI options, Michael S. Tsirkin, 2024/03/18
- [PULL 05/24] tests: smbios: add test for -smbios type=11 option, Michael S. Tsirkin, 2024/03/18
- [PULL 07/24] smbios: cleanup smbios_get_tables() from legacy handling,
Michael S. Tsirkin <=
- [PULL 08/24] smbios: get rid of smbios_smp_sockets global, Michael S. Tsirkin, 2024/03/18
- [PULL 10/24] smbios: avoid mangling user provided tables, Michael S. Tsirkin, 2024/03/18
- [PULL 11/24] smbios: don't check type4 structures in legacy mode, Michael S. Tsirkin, 2024/03/18
- [PULL 09/24] smbios: get rid of smbios_legacy global, Michael S. Tsirkin, 2024/03/18
- [PULL 12/24] smbios: add smbios_add_usr_blob_size() helper, Michael S. Tsirkin, 2024/03/18
- [PULL 13/24] smbios: rename/expose structures/bitmaps used by both legacy and modern code, Michael S. Tsirkin, 2024/03/18
- [PULL 14/24] smbios: build legacy mode code only for 'pc' machine, Michael S. Tsirkin, 2024/03/18
- [PULL 15/24] smbios: handle errors consistently, Michael S. Tsirkin, 2024/03/18
- [PULL 16/24] smbios: get rid of global smbios_ep_type, Michael S. Tsirkin, 2024/03/18
- [PULL 18/24] smbios: extend smbios-entry-point-type with 'auto' value, Michael S. Tsirkin, 2024/03/18