Re: UefiPayloadPkg: assert error in PeiPcdLib


Andrew Fish
 

On Aug 20, 2021, at 2:18 PM, King Sumo <kingsumos@gmail.com> wrote:

Hi,

If I revert the patch I can see the log output from PayloadEntry(), e.g.:
GET_BOOTLOADER_PARAMETER() = 0x17F766000

But with the patch nothing else is shown in the log besides:
ASSERT_EFI_ERROR (Status = Not Found)
ASSERT [PeiCore]
/work/edk2/edk2-orig/MdePkg/Library/PeiPcdLib/PeiPcdLib.c(43): !EFI_ERROR

So looks like it's crashing before the PayloadEntry() call. In fact, according to PeiPcdLib.c:43 it fails to locate gPcdPpiGuid:
Status = PeiServicesLocatePpi (&gPcdPpiGuid, 0, NULL, (VOID **)&PcdPpi);
Maybe it's failling inside ./UefiPayloadPkg/UefiPayloadEntry/Ia32/SecEntry.nasm... pretty odd.

Any advices?
There is “build magic”(TM) around PCDs. There are different flavors of PCDs. PCDs can be build constants or looked up from a central database. The ASSERT is from the code trying to look something up. What flavor a PCD has is controlled by the platform build, so DSC file.

In yoru hash…
For: UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc

- gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE)

+ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0

It looks like a PCD may have moved from a fixed at build (compile type constant) to something that needs to get looked up in the PCD database.

That PPI is usually produced by this PIEM:
MdeModulePkg/Universal/PCD/Pei/Pei.inf

Your ASSERT() is basically the above PEIM is missing.

If you move gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress back to being a compile time constant (location in the DSC file matters) that might get you past your ASSERT as a work around?

Thanks,

Andrew Fish

Thanks,
Sumo




Join discuss@edk2.groups.io to automatically receive all group messages.