On Mon, 2023-07-24 at 14:59 +0200, Corvin Köhne wrote: > 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: cda98df16228970dcf9a4ce2af5368219711b4b0 > ("OvmfPkg/QemuFwCfgLib: remove mQemuFwCfgSupported + > mQemuFwCfgDmaSupported") > Signed-off-by: Corvin Köhne > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Rebecca Cran > Cc: Peter Grehan > --- >  OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf |  1 + >  OvmfPkg/Bhyve/PlatformPei/Platform.c      | 20 ++++++++++++++++++++ >  2 files changed, 21 insertions(+) > > diff --git a/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf > b/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf > index 739d63098b1e..07570d4e30ca 100644 > --- a/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf > +++ b/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf > @@ -44,6 +44,7 @@ [Packages] >   >  [Guids] >    gEfiMemoryTypeInformationGuid > +  gUefiOvmfPkgPlatformInfoGuid >   >  [LibraryClasses] >    BaseLib > diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c > b/OvmfPkg/Bhyve/PlatformPei/Platform.c > index 5bfe435327c1..bdfc1614d284 100644 > --- a/OvmfPkg/Bhyve/PlatformPei/Platform.c > +++ b/OvmfPkg/Bhyve/PlatformPei/Platform.c > @@ -17,6 +17,7 @@ >  // >  // The Library classes this module consumes >  // > +#include >  #include >  #include >  #include > @@ -27,6 +28,7 @@ >  #include >  #include >  #include > +#include >  #include >  #include >  #include > @@ -534,6 +536,23 @@ MaxCpuCountInitialization ( >      )); >  } >   > +/** > + * @brief Builds PlatformInfo Hob > + */ > +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. >   > @@ -551,6 +570,7 @@ InitializePlatform ( >    ) >  { >    DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n")); > +  BuildPlatformInfoHob(); >   >    // >    // Initialize Local APIC Timer hardware and disable Local APIC > Timer Any comments? CI: https://github.com/tianocore/edk2/pull/4676 -- Kind regards, Corvin -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107616): https://edk2.groups.io/g/devel/message/107616 Mute This Topic: https://groups.io/mt/100597527/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-