MdeModulePkg/Universal/SmbiosDxe: Scan for existing tables

The default EfiSmbiosProtocol operates on an empty SMBIOS table.
The SMBIOS tables are provided by the bootloader on UefiPayloadPkg.
Scan for existing tables in SmbiosDxe and load them if they seem valid.
This fixes the settings menu not showing any hardware information, instead
only "0 MB RAM" was displayed.
Tests showed that the OS can still see the SMBIOS tables.

SmbiosDxe will get the SMBIOS from a guid Hob.
Also will keep the SmbiosHandle if it is available.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
This commit is contained in:
Zhiguang Liu
2021-04-30 13:36:54 +08:00
committed by mergify[bot]
parent 9d53e01efe
commit 70e8c9c3bc
3 changed files with 360 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
## @file
# This driver initializes and installs the SMBIOS protocol, constructs SMBIOS table into system configuration table.
#
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -41,6 +41,7 @@
UefiDriverEntryPoint
DebugLib
PcdLib
HobLib
[Protocols]
gEfiSmbiosProtocolGuid ## PRODUCES
@@ -48,6 +49,8 @@
[Guids]
gEfiSmbiosTableGuid ## SOMETIMES_PRODUCES ## SystemTable
gEfiSmbios3TableGuid ## SOMETIMES_PRODUCES ## SystemTable
gUniversalPayloadSmbios3TableGuid ## CONSUMES ## HOB
gUniversalPayloadSmbiosTableGuid ## SOMETIMES_CONSUMES ## HOB
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion ## CONSUMES