OvmfPkg/OvmfXen: Build platform info HOB in XenPlatformPei
Copy the function BuildPlatformInfoHob() from OvmfPkg/PlatformPei.
QemuFwCfgLib expect this HOB to be present, or fails to do anything.
InternalQemuFwCfgIsAvailable() from QemuFwCfgPeiLib module will not
check if the HOB is actually present for example and try to use a NULL
pointer.
Fixes: cda98df162
("OvmfPkg/QemuFwCfgLib: remove mQemuFwCfgSupported + mQemuFwCfgDmaSupported")
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
451521ccbc
commit
0b633b1494
@@ -17,6 +17,7 @@
|
||||
//
|
||||
// The Library classes this module consumes
|
||||
//
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/HobLib.h>
|
||||
@@ -409,6 +410,20 @@ DebugDumpCmos (
|
||||
}
|
||||
}
|
||||
|
||||
EFI_HOB_PLATFORM_INFO *
|
||||
BuildPlatformInfoHob (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_HOB_PLATFORM_INFO PlatformInfoHob;
|
||||
EFI_HOB_GUID_TYPE *GuidHob;
|
||||
|
||||
ZeroMem (&PlatformInfoHob, sizeof PlatformInfoHob);
|
||||
BuildGuidDataHob (&gUefiOvmfPkgPlatformInfoGuid, &PlatformInfoHob, sizeof (EFI_HOB_PLATFORM_INFO));
|
||||
GuidHob = GetFirstGuidHob (&gUefiOvmfPkgPlatformInfoGuid);
|
||||
return (EFI_HOB_PLATFORM_INFO *)GET_GUID_HOB_DATA (GuidHob);
|
||||
}
|
||||
|
||||
/**
|
||||
Perform Platform PEI initialization.
|
||||
|
||||
@@ -429,6 +444,11 @@ InitializeXenPlatform (
|
||||
|
||||
DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n"));
|
||||
|
||||
//
|
||||
// Platform Info HOB used by QemuFw libraries
|
||||
//
|
||||
BuildPlatformInfoHob ();
|
||||
|
||||
DebugDumpCmos ();
|
||||
|
||||
if (!XenDetect ()) {
|
||||
|
Reference in New Issue
Block a user