MdeModulePkg Core: Propagate PEI-phase FV authentication status to DXE

FV3 HOB was introduced by new (>= 1.5) PI spec, it is intended to
be used to propagate PEI-phase FV authentication status to DXE.
This patch is to update PeiCore to build FV3 HOB with the
authentication status and DxeCore to get the authentication
status from FV3 HOB when producing FVB Protocol.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Star Zeng
2017-10-03 21:48:47 +08:00
parent e4623bd5e6
commit c60370454e
4 changed files with 72 additions and 17 deletions

View File

@ -4,7 +4,7 @@
It consumes FV HOBs and creates read-only Firmare Volume Block protocol
instances for each of them.
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -517,9 +517,7 @@ ProduceFVBProtocolOnBuffer (
FvbDev->BaseAddress = BaseAddress;
FvbDev->FvbAttributes = FwVolHeader->Attributes;
FvbDev->FwVolBlockInstance.ParentHandle = ParentHandle;
if (ParentHandle != NULL) {
FvbDev->AuthenticationStatus = AuthenticationStatus;
}
FvbDev->AuthenticationStatus = AuthenticationStatus;
//
// Init the block caching fields of the device
@ -630,16 +628,31 @@ FwVolBlockDriverInit (
)
{
EFI_PEI_HOB_POINTERS FvHob;
EFI_PEI_HOB_POINTERS Fv3Hob;
UINT32 AuthenticationStatus;
//
// Core Needs Firmware Volumes to function
//
FvHob.Raw = GetHobList ();
while ((FvHob.Raw = GetNextHob (EFI_HOB_TYPE_FV, FvHob.Raw)) != NULL) {
AuthenticationStatus = 0;
//
// Get the authentication status propagated from PEI-phase to DXE.
//
Fv3Hob.Raw = GetHobList ();
while ((Fv3Hob.Raw = GetNextHob (EFI_HOB_TYPE_FV3, Fv3Hob.Raw)) != NULL) {
if ((Fv3Hob.FirmwareVolume3->BaseAddress == FvHob.FirmwareVolume->BaseAddress) &&
(Fv3Hob.FirmwareVolume3->Length == FvHob.FirmwareVolume->Length)) {
AuthenticationStatus = Fv3Hob.FirmwareVolume3->AuthenticationStatus;
break;
}
Fv3Hob.Raw = GET_NEXT_HOB (Fv3Hob);
}
//
// Produce an FVB protocol for it
//
ProduceFVBProtocolOnBuffer (FvHob.FirmwareVolume->BaseAddress, FvHob.FirmwareVolume->Length, NULL, 0, NULL);
ProduceFVBProtocolOnBuffer (FvHob.FirmwareVolume->BaseAddress, FvHob.FirmwareVolume->Length, NULL, AuthenticationStatus, NULL);
FvHob.Raw = GET_NEXT_HOB (FvHob);
}