Add more debug messages when search FFS in SEC phase. Signed-off-by: Abner Chang <abner.ch...@hpe.com> Cc: Daniel Schaefer <daniel.schae...@hpe.com> Cc: Sunil V L <suni...@ventanamicro.com> --- .../RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c index 17f33a02cc..05f228c44d 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -166,6 +166,8 @@ FindFfsFileAndSection ( UINT32 Size; EFI_PHYSICAL_ADDRESS EndOfFile; + DEBUG ((DEBUG_INFO, "%a: DBT FV at 0x%x\n", __FUNCTION__, Fv)); + if (Fv->Signature != EFI_FVH_SIGNATURE) { DEBUG ((DEBUG_ERROR, "%a: FV at %p does not have FV header signature\n", __FUNCTION__, Fv)); return EFI_VOLUME_CORRUPTED; @@ -181,17 +183,20 @@ FindFfsFileAndSection ( CurrentAddress = (EndOfFile + 7) & ~(7ULL); if (CurrentAddress > EndOfFirmwareVolume) { + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return EFI_VOLUME_CORRUPTED; } File = (EFI_FFS_FILE_HEADER*)(UINTN) CurrentAddress; Size = *(UINT32*) File->Size & 0xffffff; if (Size < (sizeof (*File) + sizeof (EFI_COMMON_SECTION_HEADER))) { + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return EFI_VOLUME_CORRUPTED; } EndOfFile = CurrentAddress + Size; if (EndOfFile > EndOfFirmwareVolume) { + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return EFI_VOLUME_CORRUPTED; } @@ -199,6 +204,7 @@ FindFfsFileAndSection ( // Look for the request file type // if (File->Type != FileType) { + DEBUG ((DEBUG_INFO, "%a: (File->Type != FileType), find next FFS\n", __FUNCTION__)); continue; } @@ -208,9 +214,15 @@ FindFfsFileAndSection ( SectionType, FoundSection ); - if (!EFI_ERROR (Status) || (Status == EFI_VOLUME_CORRUPTED)) { + if (!EFI_ERROR(Status)) { + DEBUG ((DEBUG_INFO, "%a: Get firmware file section\n", __FUNCTION__)); + return Status; + } + if (Status == EFI_VOLUME_CORRUPTED) { + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return Status; } + DEBUG ((DEBUG_INFO, "%a: Find next FFS\n", __FUNCTION__)); } } -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83749): https://edk2.groups.io/g/devel/message/83749 Mute This Topic: https://groups.io/mt/87062629/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-