summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei6 Xu <wei6.xu@intel.com>2023-10-30 14:22:16 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-12-19 09:29:07 +0000
commit3c66390e4a514dcce4c8cc82f489d653d55ee3fa (patch)
tree380b3f29f20d0dc71c8443b56d2ba3dc38aaec28
parent4a9fcab124369c5568a8373a0d2fbc527867a4d9 (diff)
downloadedk2-3c66390e4a514dcce4c8cc82f489d653d55ee3fa.tar.gz
edk2-3c66390e4a514dcce4c8cc82f489d653d55ee3fa.tar.bz2
edk2-3c66390e4a514dcce4c8cc82f489d653d55ee3fa.zip
StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FV
The MmCoreFfsFindMmDriver only checks for encapsulated compressed FVs. When an inner FV is uncompressed, StandaloneMmCore will miss the FV and all the MM drivers in the FV will not be dispatched. Add checks for uncompressed inner FV to fix this issue. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
-rw-r--r--StandaloneMmPkg/Core/FwVol.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/StandaloneMmPkg/Core/FwVol.c b/StandaloneMmPkg/Core/FwVol.c
index 4d2b63a448..07500cee41 100644
--- a/StandaloneMmPkg/Core/FwVol.c
+++ b/StandaloneMmPkg/Core/FwVol.c
@@ -79,6 +79,8 @@ MmCoreFfsFindMmDriver (
UINTN DepexSize;
UINTN Index;
EFI_COMMON_SECTION_HEADER *Section;
+ VOID *SectionData;
+ UINTN SectionDataSize;
UINT32 DstBufferSize;
VOID *ScratchBuffer;
UINT32 ScratchBufferSize;
@@ -115,6 +117,26 @@ MmCoreFfsFindMmDriver (
break;
}
+ //
+ // Check uncompressed firmware volumes
+ //
+ Status = FfsFindSectionData (
+ EFI_SECTION_FIRMWARE_VOLUME_IMAGE,
+ FileHeader,
+ &SectionData,
+ &SectionDataSize
+ );
+ if (!EFI_ERROR (Status)) {
+ if (SectionDataSize > sizeof (EFI_FIRMWARE_VOLUME_HEADER)) {
+ InnerFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)SectionData;
+ MmCoreFfsFindMmDriver (InnerFvHeader, Depth + 1);
+ continue;
+ }
+ }
+
+ //
+ // Check compressed firmware volumes
+ //
Status = FfsFindSection (
EFI_SECTION_GUID_DEFINED,
FileHeader,