I have an FV and I'd like to have PEI and DXE code in it. The code that I need 
to access at PEI Time (DXE Core) is a compressed file in the FV. The code that 
only needs to be accessed at DXE time is in a compressed FV. By default PEI 
will try to decompress the FV Section, so I added a EFI_SECTION_PEI_DEPEX of 
FALSE to prevent this. To my surprise this prevented the FV from being 
dispatched in DXE. 

I don't see any language in the PI spec that calls out this behavior. I think 
we should remove the checks for EFI_SECTION_PEI_DEPEX, and maybe even 
EFI_SECTION_SMM_DEPEX. I think it is a better design to have the FV prevent the 
dispatch from the phase(s) it is discovered in if that is the intent.  

So for my example I added:
SECTION PEI_DEPEX_EXP = {FALSE} 

If you had a FV that showed up in DXE, but was for SMM you could:
SECTION DXE_DEPEX_EXP = {FALSE} 

This is the code I'm talking about:
MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c

            //
            // Check if this EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE file has PEI 
depex section.
            //
            DepexBuffer  = NULL;
            SizeOfBuffer = 0;
            Status = Fv->ReadSection (
                           Fv,
                           &NameGuid,
                           EFI_SECTION_PEI_DEPEX,
                           0,
                           &DepexBuffer,
                           &SizeOfBuffer,
                           &AuthenticationStatus
                           );
            if (!EFI_ERROR (Status)) {
              //
              // If PEI depex section is found, this FV image will be ignored 
in DXE phase.
              // Now, DxeCore doesn't support FV image with more one type DEPEX 
section.
              //
              FreePool (DepexBuffer);
              continue;
            }


Thanks,

Andrew Fish

PS This logic also exists. 

            //
            // Check if this EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE file has SMM 
depex section.
            //
            DepexBuffer  = NULL;
            SizeOfBuffer = 0;
            Status = Fv->ReadSection (
                           Fv,
                           &NameGuid,
                           EFI_SECTION_SMM_DEPEX,
                           0,
                           &DepexBuffer,
                           &SizeOfBuffer,
                           &AuthenticationStatus
                           );
            if (!EFI_ERROR (Status)) {
              //
              // If SMM depex section is found, this FV image will be ignored 
in DXE phase.
              // Now, DxeCore doesn't support FV image with more one type DEPEX 
section.
              //
              FreePool (DepexBuffer);
              continue;
            }

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to