From nobody Sun May 19 19:10:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+99697+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99697+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1675709434; cv=none; d=zohomail.com; s=zohoarc; b=fZxbEbCq5TWNbhqUiO0whw7LcDKBKnk6X+ZL051sObOsTDCfXBbJebj6pD13gBMKasDvIQTZWDPMscrUqqbdF25IPLh8eDbbL3jzvX94OhE6Yx21KKif4yU7EnJFAOPqPwNjMbLjhhOXFIb066hjeqyYdTtduQBbh6eWyfrueOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675709434; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=+b/ssZI34MLiJuQbz3Wil4/ZblZdVPDl/dNApNW6Rhs=; b=cZ2iS6bDVVsMWylIljetUuFE5tKXeUmk1L3QPe19JokqVbWBDCR01jyyAvnmxXd+A0uo/xwRdXgW8W315LoC4MPOJ76/XuCZLC5Tej/ds42uuvOoKaE/apkhoNf1XvC+abjDdQt3GLJ1ikYQdl5roUxBiF5jysUq+WUdeTn4kmo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99697+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1675709434696653.9367099769424; Mon, 6 Feb 2023 10:50:34 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id ymswYY1788612xDZXG9mQibH; Mon, 06 Feb 2023 10:50:34 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.62559.1675709433447496337 for ; Mon, 06 Feb 2023 10:50:33 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="312939219" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="312939219" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2023 10:50:32 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10613"; a="698943731" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="698943731" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.209.84.217]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2023 10:50:32 -0800 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Ashraf Ali S , Isaac Oram , Rangasai V Chaganty , Ray Ni , Michael Kubacki Subject: [edk2-devel] [edk2-platforms: PATCH v2] IntelSiliconPkg/SpiFvbServiceSmm: Rewrite VariableStore header. Date: Mon, 6 Feb 2023 10:50:15 -0800 Message-Id: <20230206185015.1753-1-chasel.chiu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,chasel.chiu@intel.com X-Gm-Message-State: ZEYaeR9oCy0evJVgGrLTU77px1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1675709434; bh=RLzWSWQi5PbolkqWB2Q//TEAZ0qEsUHwsCFUM8BBuKE=; h=Cc:Date:From:Reply-To:Subject:To; b=oIg99hnzr/wrG2x0EIHPBvrnAw31Qq5S9XzCSbHKVfA1tHFE29/GGtULiBkFEPoZPAF xiIHrIMT0TQ2ZGnGRwVDtiBTeD8ZEXqpl3ToIctDX658rduqZQsH+OvtcYW4DlZeLtv0g z+5FFZ3040tyV9eBhXxNQGDSIrmgE52wv+U= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1675709435371100001 Content-Type: text/plain; charset="utf-8" When invalid VariableStore FV header detected, current SpiFvbService will erase both FV and VariableStore headers from flash, however, it will only rewrite FV header back and cause invalid VariableStore header. This patch adding the support for rewriting both FV header and VariableStore header when VariableStore corruption happened. Platform has to set PcdFlashVariableStoreType to inform SpiFvbService which VariableStoreType should be rewritten. Cc: Ashraf Ali S Cc: Isaac Oram Cc: Rangasai V Chaganty Cc: Ray Ni Cc: Michael Kubacki Signed-off-by: Chasel Chiu Reviewed-by: S, Ashraf Ali --- Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceMm.= c | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------= ----------------------------------- Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm= .inf | 4 ++++ Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec = | 8 ++++++++ 3 files changed, 134 insertions(+), 52 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiF= vbServiceMm.c b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/S= piFvbServiceMm.c index 6b4bcdcfe3..6af2dfac10 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServi= ceMm.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServi= ceMm.c @@ -12,6 +12,7 @@ #include #include #include +#include =20 /** The function installs EFI_FIRMWARE_VOLUME_BLOCK protocol @@ -25,12 +26,12 @@ **/ VOID InstallFvbProtocol ( - IN EFI_FVB_INSTANCE *FvbInstance + IN EFI_FVB_INSTANCE *FvbInstance ) { - EFI_FIRMWARE_VOLUME_HEADER *FvHeader; - EFI_STATUS Status; - EFI_HANDLE FvbHandle; + EFI_FIRMWARE_VOLUME_HEADER *FvHeader; + EFI_STATUS Status; + EFI_HANDLE FvbHandle; =20 ASSERT (FvbInstance !=3D NULL); if (FvbInstance =3D=3D NULL) { @@ -52,19 +53,21 @@ InstallFvbProtocol ( // // FV does not contains extension header, then produce MEMMAP_DEVICE_P= ATH // - FvbInstance->DevicePath =3D (EFI_DEVICE_PATH_PROTOCOL *) AllocateRunti= meCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); + FvbInstance->DevicePath =3D (EFI_DEVICE_PATH_PROTOCOL *)AllocateRuntim= eCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate); if (FvbInstance->DevicePath =3D=3D NULL) { DEBUG ((DEBUG_INFO, "SpiFvbServiceSmm.c: Memory allocation for MEMMA= P_DEVICE_PATH failed\n")); return; } - ((FV_MEMMAP_DEVICE_PATH *) FvbInstance->DevicePath)->MemMapDevPath.Sta= rtingAddress =3D FvbInstance->FvBase; - ((FV_MEMMAP_DEVICE_PATH *) FvbInstance->DevicePath)->MemMapDevPath.End= ingAddress =3D FvbInstance->FvBase + FvHeader->FvLength - 1; + + ((FV_MEMMAP_DEVICE_PATH *)FvbInstance->DevicePath)->MemMapDevPath.Star= tingAddress =3D FvbInstance->FvBase; + ((FV_MEMMAP_DEVICE_PATH *)FvbInstance->DevicePath)->MemMapDevPath.Endi= ngAddress =3D FvbInstance->FvBase + FvHeader->FvLength - 1; } else { - FvbInstance->DevicePath =3D (EFI_DEVICE_PATH_PROTOCOL *) AllocateRunti= meCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); + FvbInstance->DevicePath =3D (EFI_DEVICE_PATH_PROTOCOL *)AllocateRuntim= eCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate); if (FvbInstance->DevicePath =3D=3D NULL) { DEBUG ((DEBUG_INFO, "SpiFvbServiceSmm.c: Memory allocation for FV_PI= WG_DEVICE_PATH failed\n")); return; } + CopyGuid ( &((FV_PIWG_DEVICE_PATH *)FvbInstance->DevicePath)->FvDevPath.FvName, (GUID *)(UINTN)(FvbInstance->FvBase + FvHeader->ExtHeaderOffset) @@ -103,17 +106,21 @@ FvbInitialize ( VOID ) { - EFI_FVB_INSTANCE *FvbInstance; - EFI_FIRMWARE_VOLUME_HEADER *FvHeader; - EFI_FV_BLOCK_MAP_ENTRY *PtrBlockMapEntry; - EFI_PHYSICAL_ADDRESS BaseAddress; - EFI_STATUS Status; - UINTN BufferSize; - UINTN Idx; - UINT32 MaxLbaSize; - UINT32 BytesWritten; - UINTN BytesErased; - UINT64 NvStorageFvSize; + EFI_FVB_INSTANCE *FvbInstance; + EFI_FIRMWARE_VOLUME_HEADER *FvHeader; + EFI_FV_BLOCK_MAP_ENTRY *PtrBlockMapEntry; + EFI_PHYSICAL_ADDRESS BaseAddress; + EFI_STATUS Status; + UINTN BufferSize; + UINTN Idx; + UINT32 MaxLbaSize; + UINT32 BytesWritten; + UINTN BytesErased; + UINT64 NvStorageFvSize; + UINT32 ExpectedBytesWritten; + VARIABLE_STORE_HEADER *VariableStoreHeader; + UINT8 VariableStoreType; + UINT8 *NvStoreBuffer; =20 Status =3D GetVariableFlashNvStorageInfo (&BaseAddress, &NvStorageFvSize= ); if (EFI_ERROR (Status)) { @@ -129,6 +136,7 @@ FvbInitialize ( DEBUG ((DEBUG_ERROR, "[%a] - 64-bit variable storage base address not = supported.\n", __FUNCTION__)); return; } + Status =3D SafeUint64ToUint32 (NvStorageFvSize, &mPlatformFvBaseAddress[= 0].FvSize); if (EFI_ERROR (Status)) { ASSERT_EFI_ERROR (Status); @@ -136,8 +144,8 @@ FvbInitialize ( return; } =20 - mPlatformFvBaseAddress[1].FvBase =3D PcdGet32(PcdFlashMicrocodeFvBase); - mPlatformFvBaseAddress[1].FvSize =3D PcdGet32(PcdFlashMicrocodeFvSize); + mPlatformFvBaseAddress[1].FvBase =3D PcdGet32 (PcdFlashMicrocodeFvBase); + mPlatformFvBaseAddress[1].FvSize =3D PcdGet32 (PcdFlashMicrocodeFvSize); =20 // // We will only continue with FVB installation if the @@ -147,17 +155,17 @@ FvbInitialize ( // // Make sure all FVB are valid and/or fix if possible // - for (Idx =3D 0;; Idx++) { - if (mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0 && mPlatformFvBaseAd= dress[Idx].FvBase =3D=3D 0) { + for (Idx =3D 0; ; Idx++) { + if ((mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0) && (mPlatformFvBas= eAddress[Idx].FvBase =3D=3D 0)) { break; } =20 BaseAddress =3D mPlatformFvBaseAddress[Idx].FvBase; - FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress; + FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)BaseAddress; =20 if (!IsFvHeaderValid (BaseAddress, FvHeader)) { BytesWritten =3D 0; - BytesErased =3D 0; + BytesErased =3D 0; DEBUG ((DEBUG_ERROR, "ERROR - The FV in 0x%x is invalid!\n", FvHea= der)); FvHeader =3D NULL; Status =3D GetFvbInfo (BaseAddress, &FvHeader); @@ -165,57 +173,116 @@ FvbInitialize ( DEBUG ((DEBUG_WARN, "ERROR - Can't recovery FV header at 0x%x. = GetFvbInfo Status %r\n", BaseAddress, Status)); continue; } + DEBUG ((DEBUG_INFO, "Rewriting FV header at 0x%X with static data\= n", BaseAddress)); // // Spi erase // - BytesErased =3D (UINTN) FvHeader->BlockMap->Length; - Status =3D SpiFlashBlockErase( (UINTN) BaseAddress, &BytesErased); + BytesErased =3D (UINTN)FvHeader->BlockMap->Length; + Status =3D SpiFlashBlockErase ((UINTN)BaseAddress, &BytesEras= ed); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "ERROR - SpiFlashBlockErase Error %r\n", St= atus)); if (FvHeader !=3D NULL) { FreePool (FvHeader); } + continue; } + if (BytesErased !=3D FvHeader->BlockMap->Length) { DEBUG ((DEBUG_WARN, "ERROR - BytesErased !=3D FvHeader->BlockMap= ->Length\n")); DEBUG ((DEBUG_INFO, " BytesErased =3D 0x%X\n Length =3D 0x%X\n",= BytesErased, FvHeader->BlockMap->Length)); if (FvHeader !=3D NULL) { FreePool (FvHeader); } + continue; } - BytesWritten =3D FvHeader->HeaderLength; - Status =3D SpiFlashWrite ((UINTN)BaseAddress, &BytesWritten, (UINT= 8*)FvHeader); + + BytesWritten =3D FvHeader->HeaderLength; + ExpectedBytesWritten =3D BytesWritten; + if (Idx !=3D 0) { + Status =3D SpiFlashWrite ((UINTN)BaseAddress, &BytesWritten, (UI= NT8 *)FvHeader); + } else { + // + // This is Variable Store, rewrite both EFI_FIRMWARE_VOLUME_HEAD= ER and VARIABLE_STORE_HEADER + // + NvStoreBuffer =3D NULL; + NvStoreBuffer =3D AllocateZeroPool (sizeof (VARIABLE_STORE_HEADE= R) + FvHeader->HeaderLength); + if (NvStoreBuffer !=3D NULL) { + // + // Combine FV header and VariableStore header into the buffer. + // + CopyMem (NvStoreBuffer, FvHeader, FvHeader->HeaderLength); + VariableStoreHeader =3D (VARIABLE_STORE_HEADER *)(NvStoreBuffe= r + FvHeader->HeaderLength); + VariableStoreType =3D PcdGet8 (PcdFlashVariableStoreType); + switch (VariableStoreType) { + case 0: + DEBUG ((DEBUG_ERROR, "Type: gEfiVariableGuid\n")); + CopyGuid (&VariableStoreHeader->Signature, &gEfiVariableGu= id); + break; + case 1: + DEBUG ((DEBUG_ERROR, "Type: gEfiAuthenticatedVariableGuid\= n")); + CopyGuid (&VariableStoreHeader->Signature, &gEfiAuthentica= tedVariableGuid); + break; + default: + break; + } + + // + // Initialize common VariableStore header fields + // + VariableStoreHeader->Size =3D PcdGet32 (PcdFlashNvStorage= VariableSize) - FvHeader->HeaderLength; + VariableStoreHeader->Format =3D VARIABLE_STORE_FORMATTED; + VariableStoreHeader->State =3D VARIABLE_STORE_HEALTHY; + VariableStoreHeader->Reserved =3D 0; + VariableStoreHeader->Reserved1 =3D 0; + // + // Write buffer to flash + // + BytesWritten =3D FvHeader->HeaderLength + sizeof (VARI= ABLE_STORE_HEADER); + ExpectedBytesWritten =3D BytesWritten; + Status =3D SpiFlashWrite ((UINTN)BaseAddress, &B= ytesWritten, NvStoreBuffer); + FreePool (NvStoreBuffer); + } else { + Status =3D EFI_OUT_OF_RESOURCES; + } + } + if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "ERROR - SpiFlashWrite Error %r\n", Status)= ); if (FvHeader !=3D NULL) { FreePool (FvHeader); } + continue; } - if (BytesWritten !=3D FvHeader->HeaderLength) { - DEBUG ((DEBUG_WARN, "ERROR - BytesWritten !=3D HeaderLength\n")); - DEBUG ((DEBUG_INFO, " BytesWritten =3D 0x%X\n HeaderLength =3D 0= x%X\n", BytesWritten, FvHeader->HeaderLength)); + + if (BytesWritten !=3D ExpectedBytesWritten) { + DEBUG ((DEBUG_WARN, "ERROR - BytesWritten !=3D ExpectedBytesWrit= ten\n")); + DEBUG ((DEBUG_INFO, " BytesWritten =3D 0x%X\n ExpectedBytesWritt= en =3D 0x%X\n", BytesWritten, ExpectedBytesWritten)); if (FvHeader !=3D NULL) { FreePool (FvHeader); } + continue; } + Status =3D SpiFlashLock (); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "ERROR - SpiFlashLock Error %r\n", Status)); if (FvHeader !=3D NULL) { FreePool (FvHeader); } + continue; } + DEBUG ((DEBUG_INFO, "FV Header @ 0x%X restored with static data\n"= , BaseAddress)); // // Clear cache for this range. // - WriteBackInvalidateDataCacheRange ( (VOID *) (UINTN) BaseAddress, = FvHeader->BlockMap->Length); + WriteBackInvalidateDataCacheRange ((VOID *)(UINTN)BaseAddress, FvH= eader->BlockMap->Length); if (FvHeader !=3D NULL) { FreePool (FvHeader); } @@ -227,11 +294,12 @@ FvbInitialize ( // BufferSize =3D 0; for (Idx =3D 0; ; Idx++) { - if (mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0 && mPlatformFvBaseAd= dress[Idx].FvBase =3D=3D 0) { + if ((mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0) && (mPlatformFvBas= eAddress[Idx].FvBase =3D=3D 0)) { break; } + BaseAddress =3D mPlatformFvBaseAddress[Idx].FvBase; - FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress; + FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)BaseAddress; =20 if (!IsFvHeaderValid (BaseAddress, FvHeader)) { DEBUG ((DEBUG_WARN, "ERROR - The FV in 0x%x is invalid!\n", FvHead= er)); @@ -239,27 +307,28 @@ FvbInitialize ( } =20 BufferSize +=3D (FvHeader->HeaderLength + - sizeof (EFI_FVB_INSTANCE) - - sizeof (EFI_FIRMWARE_VOLUME_HEADER) - ); + sizeof (EFI_FVB_INSTANCE) - + sizeof (EFI_FIRMWARE_VOLUME_HEADER) + ); } =20 - mFvbModuleGlobal.FvbInstance =3D (EFI_FVB_INSTANCE *) AllocateRuntime= ZeroPool (BufferSize); + mFvbModuleGlobal.FvbInstance =3D (EFI_FVB_INSTANCE *)AllocateRuntimeZ= eroPool (BufferSize); if (mFvbModuleGlobal.FvbInstance =3D=3D NULL) { ASSERT (FALSE); return; } =20 - MaxLbaSize =3D 0; - FvbInstance =3D mFvbModuleGlobal.FvbInstance; - mFvbModuleGlobal.NumFv =3D 0; + MaxLbaSize =3D 0; + FvbInstance =3D mFvbModuleGlobal.FvbInstance; + mFvbModuleGlobal.NumFv =3D 0; =20 for (Idx =3D 0; ; Idx++) { - if (mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0 && mPlatformFvBaseAd= dress[Idx].FvBase =3D=3D 0) { + if ((mPlatformFvBaseAddress[Idx].FvSize =3D=3D 0) && (mPlatformFvBas= eAddress[Idx].FvBase =3D=3D 0)) { break; } + BaseAddress =3D mPlatformFvBaseAddress[Idx].FvBase; - FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress; + FvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)BaseAddress; =20 if (!IsFvHeaderValid (BaseAddress, FvHeader)) { DEBUG ((DEBUG_WARN, "ERROR - The FV in 0x%x is invalid!\n", FvHead= er)); @@ -269,22 +338,24 @@ FvbInitialize ( FvbInstance->Signature =3D FVB_INSTANCE_SIGNATURE; CopyMem (&(FvbInstance->FvHeader), FvHeader, FvHeader->HeaderLength); =20 - FvHeader =3D &(FvbInstance->FvHeader); + FvHeader =3D &(FvbInstance->FvHeader); FvbInstance->FvBase =3D (UINTN)BaseAddress; =20 // // Process the block map for each FV // - FvbInstance->NumOfBlocks =3D 0; + FvbInstance->NumOfBlocks =3D 0; for (PtrBlockMapEntry =3D FvHeader->BlockMap; PtrBlockMapEntry->NumBlocks !=3D 0; - PtrBlockMapEntry++) { + PtrBlockMapEntry++) + { // // Get the maximum size of a block. // if (MaxLbaSize < PtrBlockMapEntry->Length) { - MaxLbaSize =3D PtrBlockMapEntry->Length; + MaxLbaSize =3D PtrBlockMapEntry->Length; } + FvbInstance->NumOfBlocks +=3D PtrBlockMapEntry->NumBlocks; } =20 @@ -297,10 +368,9 @@ FvbInitialize ( // // Move on to the next FvbInstance // - FvbInstance =3D (EFI_FVB_INSTANCE *) ((UINTN)((UINT8 *)FvbInstance) + - FvHeader->HeaderLength + - (sizeof (EFI_FVB_INSTANCE) - s= izeof (EFI_FIRMWARE_VOLUME_HEADER))); - + FvbInstance =3D (EFI_FVB_INSTANCE *)((UINTN)((UINT8 *)FvbInstance) + + FvHeader->HeaderLength + + (sizeof (EFI_FVB_INSTANCE) - size= of (EFI_FIRMWARE_VOLUME_HEADER))); } } } diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiF= vbServiceSmm.inf b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbServic= e/SpiFvbServiceSmm.inf index 0cfa3f909b..0485b73679 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServi= ceSmm.inf +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServi= ceSmm.inf @@ -45,6 +45,8 @@ [Pcd] gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUM= ES gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUM= ES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## SOMETI= MES_CONSUMES + gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType ## SOMETI= MES_CONSUMES =20 [Sources] FvbInfo.c @@ -61,6 +63,8 @@ [Guids] gEfiFirmwareFileSystem2Guid ## CONSUMES gEfiSystemNvDataFvGuid ## CONSUMES + gEfiVariableGuid ## SOMETIMES_CONSUMES + gEfiAuthenticatedVariableGuid ## SOMETIMES_CONSUMES =20 [Depex] TRUE diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/In= tel/IntelSiliconPkg/IntelSiliconPkg.dec index 485cb3e80a..63dae756ad 100644 --- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec +++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec @@ -186,3 +186,11 @@ # @Prompt VTd abort DMA mode support. gIntelSiliconPkgTokenSpaceGuid.PcdVTdSupportAbortDmaMode|FALSE|BOOLEAN|0= x0000000C =20 + ## Define Flash Variable Store type.

+ # When Flash Variable Store corruption happened, the SpiFvbService will= recreate Variable Store + # with valid header information provided by this PCD value.
+ # 0: Variable Store is gEfiVariableGuid type.
+ # 1: Variable Store is gEfiAuthenticatedVariableGuid type.
+ # Other value: reserved for future use.
+ # @Prompt Flash Variable Store type. + gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType|0x00|UINT8|0x00= 00000E --=20 2.35.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#99697): https://edk2.groups.io/g/devel/message/99697 Mute This Topic: https://groups.io/mt/96790455/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-