From: Sebastien Boeuf <sebastien.bo...@intel.com> There are few places in the codebase assuming QemuFwCfg will be present and supported, which can cause some issues when trying to rely on the QemuFwCfgLibNull implementation of QemuFwCfgLib.
Signed-off-by: Sebastien Boeuf <sebastien.bo...@intel.com> --- OvmfPkg/Library/PlatformInitLib/Platform.c | 9 ++++++--- OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/Library/PlatformInitLib/Platform.c b/OvmfPkg/Library/PlatformInitLib/Platform.c index 101074f610..cb1a893aef 100644 --- a/OvmfPkg/Library/PlatformInitLib/Platform.c +++ b/OvmfPkg/Library/PlatformInitLib/Platform.c @@ -410,14 +410,17 @@ PlatformMaxCpuCountInitialization ( IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { - UINT16 BootCpuCount; + UINT16 BootCpuCount = 0; UINT32 MaxCpuCount; // // Try to fetch the boot CPU count. // - QemuFwCfgSelectItem (QemuFwCfgItemSmpCpuCount); - BootCpuCount = QemuFwCfgRead16 (); + if (QemuFwCfgIsAvailable ()) { + QemuFwCfgSelectItem (QemuFwCfgItemSmpCpuCount); + BootCpuCount = QemuFwCfgRead16 (); + } + if (BootCpuCount == 0) { // // QEMU doesn't report the boot CPU count. (BootCpuCount == 0) will let diff --git a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c index b5768285d8..67d29ac642 100644 --- a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c +++ b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c @@ -2233,6 +2233,11 @@ GetFrontPageTimeoutFromQemu ( { FIRMWARE_CONFIG_ITEM BootMenuWaitItem; UINTN BootMenuWaitSize; + UINT16 Timeout = PcdGet16 (PcdPlatformBootTimeOut); + + if (!QemuFwCfgIsAvailable ()) { + return Timeout; + } QemuFwCfgSelectItem (QemuFwCfgItemBootMenu); if (QemuFwCfgRead16 () == 0) { @@ -2257,9 +2262,6 @@ GetFrontPageTimeoutFromQemu ( // return three seconds if the platform default would cause us to skip the // front page, and return the platform default otherwise. // - UINT16 Timeout; - - Timeout = PcdGet16 (PcdPlatformBootTimeOut); if (Timeout == 0) { Timeout = 3; } -- 2.32.0 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 5 208 026.16 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89659): https://edk2.groups.io/g/devel/message/89659 Mute This Topic: https://groups.io/mt/91011865/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-