From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.10846.1649262444726019137 for ; Wed, 06 Apr 2022 09:27:24 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=iP7j0Oq3; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 9C88120DFD98; Wed, 6 Apr 2022 09:27:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9C88120DFD98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1649262444; bh=2tTPY3TwalkJwmHFzKyDMpV8jnHyiD/6ndTda7D+Oow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iP7j0Oq3D2N7+77hR9QjtbZhLeK2tw5EiEJ33wzc2x+sfnJs+N6NQWeatTLB3Xe4D 2TXuZcBQ71WHJD7Z2uytGZfwipMVmtZE5GHv+GhaDNrMwdqFW3AhOR1Va7EQtABGco gAh8zq95uaeYeHrHPwdsbCMug82xJl7JxeTJgZYA= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [PATCH v1 3/3] MdeModulePkg/FaultTolerantWrite: Consume Variable Info HOB Date: Wed, 6 Apr 2022 12:26:48 -0400 Message-Id: <20220406162648.234-4-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220406162648.234-1-mikuback@linux.microsoft.com> References: <20220406162648.234-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Adds support to the UEFI variable fault tolerant write (FTW) drivers to receive FTW base and size information dynamically via the Variable Flash Information HOB. This supplements support added earlier for the variable store base address and size passed with the Variable Flash Information HOB. Cc: Jian J Wang Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Michael Kubacki --- MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c = | 111 +++++++++++++++++--- MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c = | 7 +- MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c = | 92 ++++++++++++++-- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h = | 9 +- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf = | 11 +- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf = | 11 +- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandalon= eMm.inf | 11 +- MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf = | 10 +- 8 files changed, 221 insertions(+), 41 deletions(-) diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c b/Mde= ModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c index 661e1487673b..5066fe0d3711 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c @@ -972,6 +972,48 @@ GetPreviousRecordOfWrites ( return EFI_SUCCESS; } =20 +/** + Get the HOB that contains variable flash information. + + @param[out] VariableFlashInfo Pointer to a pointer to set to the var= iable flash information structure. + + @retval EFI_SUCCESS Variable flash information was found s= uccessfully. + @retval EFI_INVALID_PARAMETER The VariableFlashInfo pointer given is= NULL. + @retval EFI_NOT_FOUND Variable flash information could not b= e found. + +**/ +EFI_STATUS +GetVariableFlashInfo ( + OUT VARIABLE_FLASH_INFO **VariableFlashInfo + ) +{ + EFI_HOB_GUID_TYPE *GuidHob; + + if (VariableFlashInfo =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + GuidHob =3D GetFirstGuidHob (&gVariableFlashInfoHobGuid); + if (GuidHob =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + *VariableFlashInfo =3D GET_GUID_HOB_DATA (GuidHob); + + // + // Assert if more than one variable flash information HOB is present. + // + DEBUG_CODE ( + if ((GetNextGuidHob (&gVariableFlashInfoHobGuid, GET_NEXT_HOB (GuidH= ob)) !=3D NULL)) { + DEBUG ((DEBUG_ERROR, "ERROR: Found two variable flash information HO= Bs\n")); + ASSERT (FALSE); + } + + ); + + return EFI_SUCCESS; +} + /** Allocate private data for FTW driver and initialize it. =20 @@ -987,22 +1029,71 @@ InitFtwDevice ( OUT EFI_FTW_DEVICE **FtwData ) { - EFI_FTW_DEVICE *FtwDevice; + EFI_STATUS Status; + EFI_STATUS VariableFlashInfoStatus; + UINTN FtwWorkingSize; + VARIABLE_FLASH_INFO *VariableFlashInfo; + EFI_FTW_DEVICE *FtwDevice; + + FtwWorkingSize =3D 0; + VariableFlashInfoStatus =3D GetVariableFlashInfo (&VariableFlashInfo); + if (!EFI_ERROR (VariableFlashInfoStatus)) { + Status =3D SafeUint64ToUintn (VariableFlashInfo->FtwWorkingLength, &= FtwWorkingSize); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + FtwWorkingSize =3D 0; + } + } + + if (FtwWorkingSize =3D=3D 0) { + FtwWorkingSize =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwWorkingSize)= ; + } =20 // // Allocate private data of this driver, // Including the FtwWorkSpace[FTW_WORK_SPACE_SIZE]. // - FtwDevice =3D AllocateZeroPool (sizeof (EFI_FTW_DEVICE) + PcdGet32 (Pc= dFlashNvStorageFtwWorkingSize)); + FtwDevice =3D AllocateZeroPool (sizeof (EFI_FTW_DEVICE) + FtwWorkingSi= ze); if (FtwDevice =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } =20 + FtwDevice->WorkSpaceLength =3D FtwWorkingSize; + + if (!EFI_ERROR (VariableFlashInfoStatus)) { + // This driver currently assumes the size will be UINT32 so only acc= ept + // that for now. + Status =3D SafeUint64ToUintn (VariableFlashInfo->FtwSpareLength, &Ft= wDevice->SpareAreaLength); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + FtwDevice->SpareAreaLength =3D 0; + } + + FtwDevice->SpareAreaAddress =3D VariableFlashInfo->FtwSpareBaseAddre= ss; + FtwDevice->WorkSpaceAddress =3D VariableFlashInfo->FtwWorkingBaseAdd= ress; + } + + if (FtwDevice->SpareAreaLength =3D=3D 0) { + FtwDevice->SpareAreaLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtw= SpareSize); + } + + if (FtwDevice->SpareAreaAddress =3D=3D 0) { + FtwDevice->SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdF= lashNvStorageFtwSpareBase64); + if (FtwDevice->SpareAreaAddress =3D=3D 0) { + FtwDevice->SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (Pc= dFlashNvStorageFtwSpareBase); + } + } + + if (FtwDevice->WorkSpaceAddress =3D=3D 0) { + FtwDevice->WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdF= lashNvStorageFtwWorkingBase64); + if (FtwDevice->WorkSpaceAddress =3D=3D 0) { + FtwDevice->WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (Pc= dFlashNvStorageFtwWorkingBase); + } + } + // // Initialize other parameters, and set WorkSpace as FTW_ERASED_BYTE. // - FtwDevice->WorkSpaceLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwWo= rkingSize); - FtwDevice->SpareAreaLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwSp= areSize); if ((FtwDevice->WorkSpaceLength =3D=3D 0) || (FtwDevice->SpareAreaLeng= th =3D=3D 0)) { DEBUG ((DEBUG_ERROR, "Ftw: Workspace or Spare block does not exist!\= n")); FreePool (FtwDevice); @@ -1015,16 +1106,6 @@ InitFtwDevice ( FtwDevice->FtwWorkSpaceLba =3D (EFI_LBA)(-1); FtwDevice->FtwSpareLba =3D (EFI_LBA)(-1); =20 - FtwDevice->WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFla= shNvStorageFtwWorkingBase64); - if (FtwDevice->WorkSpaceAddress =3D=3D 0) { - FtwDevice->WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdF= lashNvStorageFtwWorkingBase); - } - - FtwDevice->SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFla= shNvStorageFtwSpareBase64); - if (FtwDevice->SpareAreaAddress =3D=3D 0) { - FtwDevice->SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdF= lashNvStorageFtwSpareBase); - } - *FtwData =3D FtwDevice; return EFI_SUCCESS; } @@ -1277,7 +1358,7 @@ InitFtwProtocol ( FtwDevice->FtwLastWriteHeader =3D NULL; FtwDevice->FtwLastWriteRecord =3D NULL; =20 - InitializeLocalWorkSpaceHeader (); + InitializeLocalWorkSpaceHeader (FtwDevice->WorkSpaceLength); =20 // // Refresh the working space data from working block diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBl= ock.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c index 61e7a92ccea1..fd563643eb63 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c @@ -16,10 +16,13 @@ EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER mWorkingBloc= kHeader =3D { ZERO_GUID, 0, 0 =20 Since Signature and WriteQueueSize have been known, Crc can be calcula= ted out, then the work space header will be fixed. + + @param[in] WorkSpaceLength Length in bytes of the FTW workspace a= rea. + **/ VOID InitializeLocalWorkSpaceHeader ( - VOID + IN UINTN WorkSpaceLength ) { // @@ -46,7 +49,7 @@ InitializeLocalWorkSpaceHeader ( &gEdkiiWorkingBlockSignatureGuid, sizeof (EFI_GUID) ); - mWorkingBlockHeader.WriteQueueSize =3D PcdGet32 (PcdFlashNvStorageFtwW= orkingSize) - sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER); + mWorkingBlockHeader.WriteQueueSize =3D WorkSpaceLength - sizeof (EFI_F= AULT_TOLERANT_WORKING_BLOCK_HEADER); =20 // // Crc is calculated with all the fields except Crc and STATE, so leav= e them as FTW_ERASED_BYTE. diff --git a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWr= itePei.c b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWrit= ePei.c index 15543f12ed29..7abf8f72d569 100644 --- a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.= c +++ b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.= c @@ -11,11 +11,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #include #include +#include #include #include #include #include #include +#include =20 EFI_PEI_PPI_DESCRIPTOR mPpiListVariable =3D { (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), @@ -186,6 +188,48 @@ IsValidWorkSpace ( return TRUE; } =20 +/** + Get the HOB that contains variable flash information. + + @param[out] VariableFlashInfo Pointer to a pointer to set to the var= iable flash information structure. + + @retval EFI_SUCCESS Variable flash information was found s= uccessfully. + @retval EFI_INVALID_PARAMETER The VariableFlashInfo pointer given is= NULL. + @retval EFI_NOT_FOUND Variable flash information could not b= e found. + +**/ +EFI_STATUS +GetVariableFlashInfo ( + OUT VARIABLE_FLASH_INFO **VariableFlashInfo + ) +{ + EFI_HOB_GUID_TYPE *GuidHob; + + if (VariableFlashInfo =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + GuidHob =3D GetFirstGuidHob (&gVariableFlashInfoHobGuid); + if (GuidHob =3D=3D NULL) { + return EFI_NOT_FOUND; + } + + *VariableFlashInfo =3D GET_GUID_HOB_DATA (GuidHob); + + // + // Assert if more than one variable flash information HOB is present. + // + DEBUG_CODE ( + if ((GetNextGuidHob (&gVariableFlashInfoHobGuid, GET_NEXT_HOB (GuidH= ob)) !=3D NULL)) { + DEBUG ((DEBUG_ERROR, "ERROR: Found two variable flash information HO= Bs\n")); + ASSERT (FALSE); + } + + ); + + return EFI_SUCCESS; +} + /** Main entry for Fault Tolerant Write PEIM. =20 @@ -207,6 +251,7 @@ PeimFaultTolerantWriteInitialize ( EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER *FtwWorkingBlockHeader; EFI_FAULT_TOLERANT_WRITE_HEADER *FtwLastWriteHeader; EFI_FAULT_TOLERANT_WRITE_RECORD *FtwLastWriteRecord; + VARIABLE_FLASH_INFO *VariableFlashInfo; EFI_PHYSICAL_ADDRESS WorkSpaceAddress; UINTN WorkSpaceLength; EFI_PHYSICAL_ADDRESS SpareAreaAddress; @@ -218,19 +263,52 @@ PeimFaultTolerantWriteInitialize ( FtwLastWriteHeader =3D NULL; FtwLastWriteRecord =3D NULL; =20 - WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFlashNvStorage= FtwWorkingBase64); - if (WorkSpaceAddress =3D=3D 0) { - WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFlashNvStora= geFtwWorkingBase); + SpareAreaAddress =3D 0; + SpareAreaLength =3D 0; + WorkSpaceAddress =3D 0; + WorkSpaceLength =3D 0; + + Status =3D GetVariableFlashInfo (&VariableFlashInfo); + if (!EFI_ERROR (Status)) { + // This driver currently assumes the size will be UINT32 so only acc= ept + // that for now. + Status =3D SafeUint64ToUintn (VariableFlashInfo->FtwSpareLength, &Sp= areAreaLength); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + SpareAreaLength =3D 0; + } + + Status =3D SafeUint64ToUintn (VariableFlashInfo->FtwWorkingLength, &= WorkSpaceLength); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + WorkSpaceLength =3D 0; + } + + SpareAreaAddress =3D VariableFlashInfo->FtwSpareBaseAddress; + WorkSpaceAddress =3D VariableFlashInfo->FtwWorkingBaseAddress; } =20 - WorkSpaceLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwWorkingSize); + if (SpareAreaLength =3D=3D 0) { + SpareAreaLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwSpareSize); + } + + if (WorkSpaceLength =3D=3D 0) { + WorkSpaceLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwWorkingSize= ); + } =20 - SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFlashNvStorage= FtwSpareBase64); if (SpareAreaAddress =3D=3D 0) { - SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFlashNvStora= geFtwSpareBase); + SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFlashNvStora= geFtwSpareBase64); + if (SpareAreaAddress =3D=3D 0) { + SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFlashNvSto= rageFtwSpareBase); + } } =20 - SpareAreaLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwSpareSize); + if (WorkSpaceAddress =3D=3D 0) { + WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFlashNvStora= geFtwWorkingBase64); + if (WorkSpaceAddress =3D=3D 0) { + WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFlashNvSto= rageFtwWorkingBase); + } + } =20 // // The address of FTW working base and spare base must not be 0. diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= ite.h b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h index c14e47b5c7b2..40ef44c069eb 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h @@ -14,11 +14,14 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =20 #include +#include #include #include #include #include =20 +#include +#include #include #include #include @@ -706,12 +709,16 @@ InitFtwProtocol ( /** Initialize a local work space header. =20 + Since Signature and WriteQueueSize have been known, Crc can be calcula= ted out, then the work space header will be fixed. + + @param[in] WorkSpaceLength Length in bytes of the FTW workspace a= rea. + **/ VOID InitializeLocalWorkSpaceHeader ( - VOID + IN UINTN WorkSpaceLength ); =20 /** diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteDxe.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteDxe.inf index 96165614d178..923f0231a047 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.= inf +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.= inf @@ -46,6 +46,8 @@ [LibraryClasses] UefiLib PcdLib ReportStatusCodeLib + HobLib + SafeIntLib =20 [Guids] # @@ -54,6 +56,7 @@ [Guids] ## CONSUMES ## GUID ## PRODUCES ## GUID gEdkiiWorkingBlockSignatureGuid + gVariableFlashInfoHobGuid ## CONSUMES ## HOB =20 [Protocols] gEfiSwapAddressRangeProtocolGuid | gEfiMdeModulePkgTokenSpaceGuid.PcdF= ullFtwServiceEnable ## SOMETIMES_CONSUMES @@ -67,11 +70,11 @@ [FeaturePcd] =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## S= OMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## C= ONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## C= ONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## S= OMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## S= OMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## S= OMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## C= ONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## C= ONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## S= OMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## S= OMETIMES_CONSUMES =20 # # gBS->CalculateCrc32() is consumed in EntryPoint. diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteSmm.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteSmm.inf index 8cc6028470d8..bbed17e4b611 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.= inf +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.= inf @@ -52,6 +52,8 @@ [LibraryClasses] ReportStatusCodeLib SmmMemLib BaseLib + HobLib + SafeIntLib =20 [Guids] # @@ -60,6 +62,7 @@ [Guids] ## CONSUMES ## GUID ## PRODUCES ## GUID gEdkiiWorkingBlockSignatureGuid + gVariableFlashInfoHobGuid ## CONSUMES ## HOB =20 [Protocols] gEfiSmmSwapAddressRangeProtocolGuid | gEfiMdeModulePkgTokenSpaceGuid.P= cdFullFtwServiceEnable ## SOMETIMES_CONSUMES @@ -76,11 +79,11 @@ [FeaturePcd] =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## S= OMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## C= ONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## C= ONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## S= OMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## S= OMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## S= OMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## C= ONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## C= ONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## S= OMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## S= OMETIMES_CONSUMES =20 # # gBS->CalculateCrc32() is consumed in EntryPoint. diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWr= iteStandaloneMm.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultT= olerantWriteStandaloneMm.inf index d0fab7d9414f..0b394b04da7b 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStan= daloneMm.inf +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStan= daloneMm.inf @@ -46,10 +46,12 @@ [LibraryClasses] BaseLib BaseMemoryLib DebugLib + HobLib MemoryAllocationLib MmServicesTableLib PcdLib ReportStatusCodeLib + SafeIntLib StandaloneMmDriverEntryPoint =20 [Guids] @@ -59,6 +61,7 @@ [Guids] ## CONSUMES ## GUID ## PRODUCES ## GUID gEdkiiWorkingBlockSignatureGuid + gVariableFlashInfoHobGuid ## CONSUMES ## HOB =20 [Protocols] gEfiSmmSwapAddressRangeProtocolGuid | gEfiMdeModulePkgTokenSpaceGuid.P= cdFullFtwServiceEnable ## SOMETIMES_CONSUMES @@ -75,11 +78,11 @@ [FeaturePcd] =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## S= OMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## C= ONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## C= ONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## S= OMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## S= OMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## S= OMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## C= ONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## C= ONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## S= OMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## S= OMETIMES_CONSUMES =20 [Depex] TRUE diff --git a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWr= itePei.inf b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWr= itePei.inf index f90892ad4493..ff9d53bf7040 100644 --- a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.= inf +++ b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.= inf @@ -39,6 +39,7 @@ [LibraryClasses] HobLib BaseMemoryLib PcdLib + SafeIntLib =20 [Guids] ## SOMETIMES_PRODUCES ## HOB @@ -46,14 +47,15 @@ [Guids] gEdkiiFaultTolerantWriteGuid gEdkiiWorkingBlockSignatureGuid ## SOMETIMES_CONSUMES = ## GUID gEfiSystemNvDataFvGuid ## SOMETIMES_CONSUMES = ## GUID + gVariableFlashInfoHobGuid ## CONSUMES = ## HOB =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## S= OMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## C= ONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## C= ONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## S= OMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## S= OMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## S= OMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## C= ONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## C= ONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## S= OMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## S= OMETIMES_CONSUMES =20 [Depex] TRUE --=20 2.28.0.windows.1