OvmfPkg: Check for QemuFwCfg availability before accessing it
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.boeuf@intel.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
5c9f151e0c
commit
43f3cfce19
@@ -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
|
||||
|
Reference in New Issue
Block a user