From nobody Fri May 17 03:00:58 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+88650+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+88650+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452701; cv=none; d=zohomail.com; s=zohoarc; b=WItxPdWQvi+1eoPa6VKQXeyDGeZl0pQgfltQNTz0jprg6I0BALigG2wRgPnI6u3gOBPjx2QXiZv91WQcvMqPtxfieBKdrzjmBazHs4zZM7ceERe3QM+JUfQDMEu2pi19CAjsUGvA6fTpJy9zLSIJL5C83K4c7sF/XY9g6+W8u/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452701; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=SN6oS6RVEUduzWTNp9sW1FKtec1/mY+49wJxhTGnr+g=; b=Jh0kSf+RSdw0uTxWrffht27eA3p6rbnaPl9HKezZJ9lUu35ftyHJwk8ZAOckRfMEyPxKC/0Hd3YkR2NKWVNnqXrD0HneYpn9vkxm1v+puv3J6RWk6YJSFVECz+fLYW7Ip5I+duaO8DYj+YOLWecJpLmdwruT6Kt0biFJrEtB5S8= 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+88650+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 1649452701598461.47088834347153; Fri, 8 Apr 2022 14:18:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0XI8YY1788612xblxn1MTBk2; Fri, 08 Apr 2022 14:18:21 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web08.707.1649452700666903228 for ; Fri, 08 Apr 2022 14:18:20 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 6555B20B9CEF; Fri, 8 Apr 2022 14:18:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6555B20B9CEF From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB Date: Fri, 8 Apr 2022 17:17:26 -0400 Message-Id: <20220408211733.1332-2-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.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,mikuback@linux.microsoft.com X-Gm-Message-State: OgyZMRx5ELSnTYuHGV9fCOcXx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452701; bh=udSgu00Y/Yg022UgomQwySY7lSmfWIbpXafWh+lGLsQ=; h=Cc:Date:From:Reply-To:Subject:To; b=Uvj6h5Czo+InrHxLt+pi4jxt0wmttMqpjW/6glEyT3wTvB4cK+fmwv1pPkxho4mTTIE ry6a3gerP+/1WQiZcD48I/4oPfRCddVblteGabGY/rZ2sW4tSvnzL5rNIULyiESX0smz4 /wThls2YDJC0sXuawY3MwXsaIvwJVAvIYcA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452703385100003 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Adds a new GUID that is used to identify a HOB that passes variable flash information to UEFI variable drivers in HOB consumption phases such as DXE, Traditional MM, and Standalone MM. This information was previously passed directly with PCDs such as EfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase and gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize. However, the Standalone MM variable driver instance does not have direct access to the PCD database. Therefore, this HOB will first be considered as the source for variable flash information and if platforms do not produce the HOB, reading the information from the PCDs directly will be a backup to provide backward compatibility. Cc: Jian J Wang Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Michael Kubacki --- MdeModulePkg/Include/Guid/VariableFlashInfo.h | 39 ++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 4 ++ 2 files changed, 43 insertions(+) diff --git a/MdeModulePkg/Include/Guid/VariableFlashInfo.h b/MdeModulePkg/I= nclude/Guid/VariableFlashInfo.h new file mode 100644 index 000000000000..e526e362aab9 --- /dev/null +++ b/MdeModulePkg/Include/Guid/VariableFlashInfo.h @@ -0,0 +1,39 @@ +/** @file + This file defines the GUID and data structure used to pass information a= bout + a variable store mapped on flash (i.e. a MMIO firmware volume) to the DX= E and MM environment. + + Copyright (c) Microsoft Corporation.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef VARIABLE_FLASH_INFO_H_ +#define VARIABLE_FLASH_INFO_H_ + +#define VARIABLE_FLASH_INFO_HOB_GUID \ + { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2, 0xfb, 0xa2, 0x89, 0x20, 0xfc= , 0x90 }} + +#define VARIABLE_FLASH_INFO_HOB_VERSION 1 + +extern EFI_GUID gVariableFlashInfoHobGuid; + +#pragma pack (push, 1) + +/// +/// This structure can be used to describe UEFI variable +/// flash information. +/// +typedef struct { + UINT32 Version; + EFI_PHYSICAL_ADDRESS NvStorageBaseAddress; + UINT64 NvStorageLength; + EFI_PHYSICAL_ADDRESS FtwSpareBaseAddress; + UINT64 FtwSpareLength; + EFI_PHYSICAL_ADDRESS FtwWorkingBaseAddress; + UINT64 FtwWorkingLength; +} VARIABLE_FLASH_INFO; + +#pragma pack (pop) + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index cf79292ec877..4e82f5836096 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -226,6 +226,10 @@ [Guids] # Include/Guid/SmmVariableCommon.h gSmmVariableWriteGuid =3D { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0= xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }} =20 + ## Guid of the variable flash information HOB. + # Include/Guid/VariableFlashInfo.h + gVariableFlashInfoHobGuid =3D { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2= , 0xfb, 0xa2, 0x89, 0x20, 0xfc, 0x90 }} + ## Performance protocol guid that also acts as the performance HOB guid = and performance variable GUID # Include/Guid/Performance.h gPerformanceProtocolGuid =3D { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E,= 0x3F, 0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } } --=20 2.28.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 (#88650): https://edk2.groups.io/g/devel/message/88650 Mute This Topic: https://groups.io/mt/90345653/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- From nobody Fri May 17 03:00:58 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+88651+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+88651+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452705; cv=none; d=zohomail.com; s=zohoarc; b=MIX0jE/GQKAxsErFov3tozvgrbLNs+bL9zxjgywsFnQLLvILCKGS9gODYJdzTMfsDX6yI8DX7w1pwfxQ6/15V2KbhW1K+P+TeJwxLubcRdup2b30ks1o7ppvAKgJCB85EJOUTyM9//CxIG1YV3iG/JkjCvxk+rDT++dhuIT3MeU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452705; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=pxNnbwAK9banSroUvhIVK0GS3ilET/QR0Y+Q0Vw513k=; b=NmzGwnBFoCn/mqTdLl/Ef6vsORxmda91ttWA9zuV8l/xBYej1HdIE/hTQ1PURgpUVB/wJIuXQ+MS4c7RmAdEVfpl0eI6ayUxS06vgqyW1VKes6JOkYc6s1AWLIEl9OdxkditTc1pb3H6C8UON48stC+YCpv+Zz5Dqli0nnrCEBE= 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+88651+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 1649452705521323.5321879256602; Fri, 8 Apr 2022 14:18:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bV1DYY1788612xVhnCRIuQzc; Fri, 08 Apr 2022 14:18:25 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.727.1649452704278829748 for ; Fri, 08 Apr 2022 14:18:24 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 5C40B2034C44; Fri, 8 Apr 2022 14:18:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5C40B2034C44 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v2 2/8] MdeModulePkg/VariableFlashInfoLib: Add initial library Date: Fri, 8 Apr 2022 17:17:27 -0400 Message-Id: <20220408211733.1332-3-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.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,mikuback@linux.microsoft.com X-Gm-Message-State: ftBEBw02Zt5NIlklwxmDeeZUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452705; bh=NltCdXWH/cTlEYQc4MHf8+nUa3uHRm7Gzgc7h6DjvoA=; h=Cc:Date:From:Reply-To:Subject:To; b=Ijz5SCcNaWZgHsHUmbhAA/O3Wifgt69R5r4D6ctYBmPdsGZ9ZHKcoSG6TrnWrNtqW3o olX3zK757OiC/vRUyJEmYHVYyeBa5I4Nlj+YwCvE/ntDqJToOzqS/kyXP8nfdFxtQZbBV oKKU2Pv1Ch9GNGNGt5fUaot8C3FEoiEUqGU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452707229100003 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Adds a new library class VariableFlashInfoLib that abstracts access to variable flash information. The instance provided first attempts to retrieve information from the Variable Flash Info HOB. If that HOB is not present, it falls back to the PCDs defined in MdeModulePkg. This fall back behavior provides backward compatibility for platforms that only provide PCDs but also allows platforms that need to dynamically provide the information using the Variable Flash Info HOB to do so at runtime. Cc: Jian J Wang Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Michael Kubacki --- MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.c = | 178 ++++++++++++++++++++ MdeModulePkg/Include/Library/VariableFlashInfoLib.h = | 68 ++++++++ MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf= | 48 ++++++ MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.uni= | 12 ++ MdeModulePkg/MdeModulePkg.dec = | 4 + MdeModulePkg/MdeModulePkg.dsc = | 2 + 6 files changed, 312 insertions(+) diff --git a/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlas= hInfoLib.c b/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlas= hInfoLib.c new file mode 100644 index 000000000000..8e3c6e75c957 --- /dev/null +++ b/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLi= b.c @@ -0,0 +1,178 @@ +/** @file + Variable Flash Information Library + + Copyright (c) Microsoft Corporation
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include + +/** + Get the HOB that contains variable flash information. + + @param[out] VariableFlashInfo Pointer to a pointer to set to the varia= ble flash information structure. + + @retval EFI_SUCCESS Variable flash information was found suc= cessfully. + @retval EFI_INVALID_PARAMETER The VariableFlashInfo pointer given is N= ULL. + @retval EFI_NOT_FOUND Variable flash information could not be = found. + +**/ +EFI_STATUS +GetVariableFlashInfoFromHob ( + 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 (GuidHob= )) !=3D NULL)) { + DEBUG ((DEBUG_ERROR, "ERROR: Found two variable flash information HOBs= \n")); + ASSERT (FALSE); + } + + ); + + return EFI_SUCCESS; +} + +/** + Get the base address and size for the NV storage area used for UEFI vari= able storage. + + @param[out] BaseAddress The NV storage base address. + @param[out] Length The NV storage length in bytes. + + @retval EFI_SUCCESS NV storage information was found success= fully. + @retval EFI_INVALID_PARAMETER A required pointer parameter is NULL. + +**/ +EFI_STATUS +EFIAPI +GetVariableFlashNvStorageInfo ( + OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + OUT UINT64 *Length + ) +{ + EFI_STATUS Status; + VARIABLE_FLASH_INFO *VariableFlashInfo; + + if ((BaseAddress =3D=3D NULL) || (Length =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + Status =3D GetVariableFlashInfoFromHob (&VariableFlashInfo); + if (!EFI_ERROR (Status)) { + *BaseAddress =3D VariableFlashInfo->NvStorageBaseAddress; + *Length =3D VariableFlashInfo->NvStorageLength; + } else { + *BaseAddress =3D (EFI_PHYSICAL_ADDRESS)(PcdGet64 (PcdFlashNvStorageVar= iableBase64) !=3D 0 ? + PcdGet64 (PcdFlashNvStorageVaria= bleBase64) : + PcdGet32 (PcdFlashNvStorageVaria= bleBase) + ); + *Length =3D (UINT64)PcdGet32 (PcdFlashNvStorageVariableSize); + } + + return EFI_SUCCESS; +} + +/** + Get the base address and size for the fault tolerant write (FTW) spare + area used for UEFI variable storage. + + @param[out] BaseAddress The FTW spare base address. + @param[out] Length The FTW spare length in bytes. + + @retval EFI_SUCCESS FTW spare information was found successf= ully. + @retval EFI_INVALID_PARAMETER A required pointer parameter is NULL. + @retval EFI_NOT_FOUND FTW spare information could not be found. + +**/ +EFI_STATUS +EFIAPI +GetVariableFlashFtwSpareInfo ( + OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + OUT UINT64 *Length + ) +{ + EFI_STATUS Status; + VARIABLE_FLASH_INFO *VariableFlashInfo; + + if ((BaseAddress =3D=3D NULL) || (Length =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + Status =3D GetVariableFlashInfoFromHob (&VariableFlashInfo); + if (!EFI_ERROR (Status)) { + *BaseAddress =3D VariableFlashInfo->FtwSpareBaseAddress; + *Length =3D VariableFlashInfo->FtwSpareLength; + } else { + *BaseAddress =3D (EFI_PHYSICAL_ADDRESS)(PcdGet64 (PcdFlashNvStorageFtw= SpareBase64) !=3D 0 ? + PcdGet64 (PcdFlashNvStorageFtwSp= areBase64) : + PcdGet32 (PcdFlashNvStorageFtwSp= areBase) + ); + *Length =3D (UINT64)PcdGet32 (PcdFlashNvStorageFtwSpareSize); + } + + return EFI_SUCCESS; +} + +/** + Get the base address and size for the fault tolerant write (FTW) working + area used for UEFI variable storage. + + @param[out] BaseAddress The FTW working area base address. + @param[out] Length The FTW working area length in bytes. + + @retval EFI_SUCCESS FTW working information was found succes= sfully. + @retval EFI_INVALID_PARAMETER A required pointer parameter is NULL. + @retval EFI_NOT_FOUND FTW working information could not be fou= nd. + +**/ +EFI_STATUS +EFIAPI +GetVariableFlashFtwWorkingInfo ( + OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + OUT UINT64 *Length + ) +{ + EFI_STATUS Status; + VARIABLE_FLASH_INFO *VariableFlashInfo; + + if ((BaseAddress =3D=3D NULL) || (Length =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + Status =3D GetVariableFlashInfoFromHob (&VariableFlashInfo); + if (!EFI_ERROR (Status)) { + *BaseAddress =3D VariableFlashInfo->FtwWorkingBaseAddress; + *Length =3D VariableFlashInfo->FtwWorkingLength; + } else { + *BaseAddress =3D (EFI_PHYSICAL_ADDRESS)(PcdGet64 (PcdFlashNvStorageFtw= WorkingBase64) !=3D 0 ? + PcdGet64 (PcdFlashNvStorageFtwWo= rkingBase64) : + PcdGet32 (PcdFlashNvStorageFtwWo= rkingBase) + ); + *Length =3D (UINT64)PcdGet32 (PcdFlashNvStorageFtwWorkingSize); + } + + return EFI_SUCCESS; +} diff --git a/MdeModulePkg/Include/Library/VariableFlashInfoLib.h b/MdeModul= ePkg/Include/Library/VariableFlashInfoLib.h new file mode 100644 index 000000000000..1367be9376ea --- /dev/null +++ b/MdeModulePkg/Include/Library/VariableFlashInfoLib.h @@ -0,0 +1,68 @@ +/** @file + Variable Flash Information Library + +Copyright (c) Microsoft Corporation
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef VARIABLE_FLASH_INFO_LIB_H_ +#define VARIABLE_FLASH_INFO_LIB_H_ + +/** + Get the base address and size for the NV storage area used for UEFI vari= able storage. + + @param[out] BaseAddress The NV storage base address. + @param[out] Length The NV storage length in bytes. + + @retval EFI_SUCCESS NV storage information was found success= fully. + @retval EFI_INVALID_PARAMETER A required pointer parameter is NULL. + @retval EFI_NOT_FOUND NV storage information could not be foun= d. + +**/ +EFI_STATUS +EFIAPI +GetVariableFlashNvStorageInfo ( + OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + OUT UINT64 *Length + ); + +/** + Get the base address and size for the fault tolerant write (FTW) spare + area used for UEFI variable storage. + + @param[out] BaseAddress The FTW spare base address. + @param[out] Length The FTW spare length in bytes. + + @retval EFI_SUCCESS FTW spare information was found successf= ully. + @retval EFI_INVALID_PARAMETER A required pointer parameter is NULL. + @retval EFI_NOT_FOUND FTW spare information could not be found. + +**/ +EFI_STATUS +EFIAPI +GetVariableFlashFtwSpareInfo ( + OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + OUT UINT64 *Length + ); + +/** + Get the base address and size for the fault tolerant write (FTW) working + area used for UEFI variable storage. + + @param[out] BaseAddress The FTW working area base address. + @param[out] Length The FTW working area length in bytes. + + @retval EFI_SUCCESS FTW working information was found succes= sfully. + @retval EFI_INVALID_PARAMETER A required pointer parameter is NULL. + @retval EFI_NOT_FOUND FTW working information could not be fou= nd. + +**/ +EFI_STATUS +EFIAPI +GetVariableFlashFtwWorkingInfo ( + OUT EFI_PHYSICAL_ADDRESS *BaseAddress, + OUT UINT64 *Length + ); + +#endif diff --git a/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlas= hInfoLib.inf b/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFl= ashInfoLib.inf new file mode 100644 index 000000000000..70175e75f9b1 --- /dev/null +++ b/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLi= b.inf @@ -0,0 +1,48 @@ +## @file +# Variable Flash Information Library +# +# Provides services to access UEFI variable flash information. +# +# Copyright (c) Microsoft Corporation
+# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BaseVariableFlashInfoLib + MODULE_UNI_FILE =3D BaseVariableFlashInfoLib.uni + FILE_GUID =3D DEC426C9-C92E-4BAD-8E93-3F61C261118B + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D VariableFlashInfoLib + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D ANY +# + +[Sources] + BaseVariableFlashInfoLib.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + DebugLib + HobLib + +[Guids] + gVariableFlashInfoHobGuid ## CONSUMES ## HOB + +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## SOM= ETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 ## SOM= ETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## SOM= ETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## SOM= ETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## SOM= ETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## SOM= ETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## SOM= ETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## SOM= ETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## SOM= ETIMES_CONSUMES diff --git a/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlas= hInfoLib.uni b/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFl= ashInfoLib.uni new file mode 100644 index 000000000000..9a5348fa02a0 --- /dev/null +++ b/MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLi= b.uni @@ -0,0 +1,12 @@ +// /** @file +// Variable Flash Information Library +// +// Copyright (c) Microsoft Corporation
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + +#string STR_MODULE_ABSTRACT #language en-US "UEFI variable flash infor= mation library" + +#string STR_MODULE_DESCRIPTION #language en-US "Provides services to acce= ss UEFI variable flash information." diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 4e82f5836096..2bcb9f9453af 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -154,6 +154,10 @@ [LibraryClasses] # VariablePolicyHelperLib|Include/Library/VariablePolicyHelperLib.h =20 + ## @libraryclass Provides services to access UEFI variable flash infor= mation. + # + VariableFlashInfoLib|Include/Library/VariableFlashInfoLib.h + [Guids] ## MdeModule package token space guid # Include/Guid/MdeModulePkgTokenSpace.h diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index b1d83461865e..90a0a7ec4a7c 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -103,6 +103,7 @@ [LibraryClasses] DisplayUpdateProgressLib|MdeModulePkg/Library/DisplayUpdateProgressLibGr= aphics/DisplayUpdateProgressLibGraphics.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibN= ull.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 [LibraryClasses.EBC.PEIM] IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf @@ -440,6 +441,7 @@ [Components] MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.i= nf MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf + MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.i= nf =20 [Components.IA32, Components.X64, Components.AARCH64] MdeModulePkg/Universal/EbcDxe/EbcDxe.inf --=20 2.28.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 (#88651): https://edk2.groups.io/g/devel/message/88651 Mute This Topic: https://groups.io/mt/90345654/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- From nobody Fri May 17 03:00:58 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+88652+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+88652+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452710; cv=none; d=zohomail.com; s=zohoarc; b=eD6ecYG5SlR81JNX+4r4WrlnbQfUw4AZ3MesADhjJbiw+J/oGv/SvaHFo3J8ow/IFNOLRJx+Ls2H3k0qErq/IJFSpbLJnHSLJ4i1pE4lcOXBTSPQIUldizJOmGLsOawyYbQ7f7tg7inDIzku5rB3RHhXNrVK4IvTJOAL4o834WY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452710; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=mc7ZqORSU55Dn0/mJhVuFg+ap81Cy3omuBiu56Z9mKc=; b=Z83CQC+nzyRuThRbHFgZjq7FAjdzWZTlvFoatxBm1JUE42UjBLPX8EUwaLj6xVoERh3XgReDj5DVqClnITNqe7EKsANXuP7XDQPwzvbJrt+4MwjEEcXAhnci5AFJE5MggrHWAZPiLV0WTWpAAvegVtxlt4Hjen9l+gT5GXshsBY= 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+88652+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 1649452710454859.8500184608314; Fri, 8 Apr 2022 14:18:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id fR12YY1788612xVRZaGcSNUm; Fri, 08 Apr 2022 14:18:30 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.728.1649452708991799068 for ; Fri, 08 Apr 2022 14:18:29 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 0BC5220B9CF0; Fri, 8 Apr 2022 14:18:27 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0BC5220B9CF0 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v2 3/8] MdeModulePkg/Variable: Consume Variable Flash Info Date: Fri, 8 Apr 2022 17:17:28 -0400 Message-Id: <20220408211733.1332-4-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.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,mikuback@linux.microsoft.com X-Gm-Message-State: IQnJwORJhPdQTlfYcimRVqBax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452710; bh=LH+EKkYp4/G1Sq89j3eqfAsXhOboKf2NwN22y5abAT8=; h=Cc:Date:From:Reply-To:Subject:To; b=MbAaQxYT8vWSdqGESAY4yy59kSIMcqRz2fytmkjuvfuMOgbC7c62r4h4VMUx+7lq+er qU3e4Z0VGnru9VTUlQX/FG2DAGoITJLQwCY6O/I+SW0CgKh5jm6GQR5KvqS8G5z5OlcqD VXPTzN9xLbwmbrKtQTn9xNBCN5SFCIcdG1c= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452711264100001 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Updates VariableRuntimeDxe, VariableSmm, and VariableStandaloneMm to acquire variable flash information from the Variable Flash Information library. Cc: Jian J Wang Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Michael Kubacki --- MdeModulePkg/Universal/Variable/Pei/Variable.c | 14 += ++++++++----- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c | 16 += +++++++++++---- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c | 14 += +++++++++---- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c | 17 += ++++++++++++---- MdeModulePkg/Universal/Variable/Pei/Variable.h | 2 ++ MdeModulePkg/Universal/Variable/Pei/VariablePei.inf | 5 += +--- MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h | 7 += +----- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf | 5 += +--- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf | 5 += +--- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf | 5 += +--- 10 files changed, 56 insertions(+), 34 deletions(-) diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/= Universal/Variable/Pei/Variable.c index b36dd0de67b2..26a4c73b45a5 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c @@ -567,11 +567,13 @@ GetVariableStore ( OUT VARIABLE_STORE_INFO *StoreInfo ) { + EFI_STATUS Status; EFI_HOB_GUID_TYPE *GuidHob; EFI_FIRMWARE_VOLUME_HEADER *FvHeader; VARIABLE_STORE_HEADER *VariableStoreHeader; EFI_PHYSICAL_ADDRESS NvStorageBase; UINT32 NvStorageSize; + UINT64 NvStorageSize64; FAULT_TOLERANT_WRITE_LAST_WRITE_DATA *FtwLastWriteData; UINT32 BackUpOffset; =20 @@ -591,11 +593,13 @@ GetVariableStore ( // Emulated non-volatile variable mode is not enabled. // =20 - NvStorageSize =3D PcdGet32 (PcdFlashNvStorageVariableSize); - NvStorageBase =3D (EFI_PHYSICAL_ADDRESS)(PcdGet64 (PcdFlashNvStora= geVariableBase64) !=3D 0 ? - PcdGet64 (PcdFlashNvStorage= VariableBase64) : - PcdGet32 (PcdFlashNvStorage= VariableBase) - ); + Status =3D GetVariableFlashNvStorageInfo (&NvStorageBase, &NvStora= geSize64); + ASSERT_EFI_ERROR (Status); + + Status =3D SafeUint64ToUint32 (NvStorageSize64, &NvStorageSize); + // This driver currently assumes the size will be UINT32 so assert= the value is safe for now. + ASSERT_EFI_ERROR (Status); + ASSERT (NvStorageBase !=3D 0); =20 // diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c b/Mde= ModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c index 03fec3048dc4..d5c409c914d1 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c @@ -423,6 +423,8 @@ FtwNotificationEvent ( EFI_PHYSICAL_ADDRESS VariableStoreBase; UINT64 VariableStoreLength; UINTN FtwMaxBlockSize; + UINT32 NvStorageVariableSize; + UINT64 NvStorageVariableSize64; =20 // // Ensure FTW protocol is installed. @@ -432,14 +434,20 @@ FtwNotificationEvent ( return; } =20 + Status =3D GetVariableFlashNvStorageInfo (&NvStorageVariableBase, &NvSto= rageVariableSize64); + ASSERT_EFI_ERROR (Status); + + Status =3D SafeUint64ToUint32 (NvStorageVariableSize64, &NvStorageVariab= leSize); + // This driver currently assumes the size will be UINT32 so assert the v= alue is safe for now. + ASSERT_EFI_ERROR (Status); + + VariableStoreBase =3D NvStorageVariableBase + mNvFvHeaderCache->HeaderLe= ngth; + Status =3D FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize); if (!EFI_ERROR (Status)) { - ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <=3D FtwMaxBlockSize); + ASSERT (NvStorageVariableSize <=3D FtwMaxBlockSize); } =20 - NvStorageVariableBase =3D NV_STORAGE_VARIABLE_BASE; - VariableStoreBase =3D NvStorageVariableBase + mNvFvHeaderCache->Head= erLength; - // // Let NonVolatileVariableBase point to flash variable store base direct= ly after FTW ready. // diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile= .c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c index 5e9d40b67ac2..9e2d8fe0fe0c 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c @@ -142,6 +142,7 @@ InitRealNonVolatileVariableStore ( EFI_PHYSICAL_ADDRESS NvStorageBase; UINT8 *NvStorageData; UINT32 NvStorageSize; + UINT64 NvStorageSize64; FAULT_TOLERANT_WRITE_LAST_WRITE_DATA *FtwLastWriteData; UINT32 BackUpOffset; UINT32 BackUpSize; @@ -153,19 +154,24 @@ InitRealNonVolatileVariableStore ( =20 mVariableModuleGlobal->FvbInstance =3D NULL; =20 + Status =3D GetVariableFlashNvStorageInfo (&NvStorageBase, &NvStorageSize= 64); + ASSERT_EFI_ERROR (Status); + + Status =3D SafeUint64ToUint32 (NvStorageSize64, &NvStorageSize); + // This driver currently assumes the size will be UINT32 so assert the v= alue is safe for now. + ASSERT_EFI_ERROR (Status); + + ASSERT (NvStorageBase !=3D 0); + // // Allocate runtime memory used for a memory copy of the FLASH region. // Keep the memory and the FLASH in sync as updates occur. // - NvStorageSize =3D PcdGet32 (PcdFlashNvStorageVariableSize); NvStorageData =3D AllocateRuntimeZeroPool (NvStorageSize); if (NvStorageData =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } =20 - NvStorageBase =3D NV_STORAGE_VARIABLE_BASE; - ASSERT (NvStorageBase !=3D 0); - // // Copy NV storage data to the memory buffer. // diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/Mde= ModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c index 517cae7b00f8..5253c328dcd9 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c @@ -1084,6 +1084,8 @@ SmmFtwNotificationEvent ( EFI_SMM_FAULT_TOLERANT_WRITE_PROTOCOL *FtwProtocol; EFI_PHYSICAL_ADDRESS NvStorageVariableBase; UINTN FtwMaxBlockSize; + UINT32 NvStorageVariableSize; + UINT64 NvStorageVariableSize64; =20 if (mVariableModuleGlobal->FvbInstance !=3D NULL) { return EFI_SUCCESS; @@ -1097,14 +1099,21 @@ SmmFtwNotificationEvent ( return Status; } =20 + Status =3D GetVariableFlashNvStorageInfo (&NvStorageVariableBase, &NvSto= rageVariableSize64); + ASSERT_EFI_ERROR (Status); + + Status =3D SafeUint64ToUint32 (NvStorageVariableSize64, &NvStorageVariab= leSize); + // This driver currently assumes the size will be UINT32 so assert the v= alue is safe for now. + ASSERT_EFI_ERROR (Status); + + ASSERT (NvStorageVariableBase !=3D 0); + VariableStoreBase =3D NvStorageVariableBase + mNvFvHeaderCache->HeaderLe= ngth; + Status =3D FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize); if (!EFI_ERROR (Status)) { - ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <=3D FtwMaxBlockSize); + ASSERT (NvStorageVariableSize <=3D FtwMaxBlockSize); } =20 - NvStorageVariableBase =3D NV_STORAGE_VARIABLE_BASE; - VariableStoreBase =3D NvStorageVariableBase + mNvFvHeaderCache->Head= erLength; - // // Let NonVolatileVariableBase point to flash variable store base direct= ly after FTW ready. // diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.h b/MdeModulePkg/= Universal/Variable/Pei/Variable.h index 7f9ad5bfc357..51effbf79987 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.h +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.h @@ -20,6 +20,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include +#include =20 #include #include diff --git a/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf b/MdeModul= ePkg/Universal/Variable/Pei/VariablePei.inf index 7cbdd2385e8f..7264a24bdf71 100644 --- a/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +++ b/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf @@ -39,6 +39,8 @@ [LibraryClasses] DebugLib PeiServicesTablePointerLib PeiServicesLib + SafeIntLib + VariableFlashInfoLib =20 [Guids] ## CONSUMES ## GUID # Variable store header @@ -59,9 +61,6 @@ [Ppis] gEfiPeiReadOnlyVariable2PpiGuid ## PRODUCES =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CON= SUMES gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable ## SOM= ETIMES_CONSUMES =20 [Depex] diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h b/MdeMod= ulePkg/Universal/Variable/RuntimeDxe/Variable.h index 31e408976a35..a668abb82b15 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h @@ -31,6 +31,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include +#include #include #include #include @@ -40,11 +42,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #include "PrivilegePolymorphic.h" =20 -#define NV_STORAGE_VARIABLE_BASE (EFI_PHYSICAL_ADDRESS)\ - (PcdGet64 (PcdFlashNvStorageVariableBas= e64) !=3D 0 ? \ - PcdGet64 (PcdFlashNvStorageVariableBas= e64) : \ - PcdGet32 (PcdFlashNvStorageVariableBas= e)) - #define EFI_VARIABLE_ATTRIBUTES_MASK (EFI_VARIABLE_NON_VOLATILE |\ EFI_VARIABLE_BOOTSERVICE_ACCESS | \ EFI_VARIABLE_RUNTIME_ACCESS | \ diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.= inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf index c9434df631ee..3858adf6739d 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf @@ -71,8 +71,10 @@ [LibraryClasses] TpmMeasurementLib AuthVariableLib VarCheckLib + VariableFlashInfoLib VariablePolicyLib VariablePolicyHelperLib + SafeIntLib =20 [Protocols] gEfiFirmwareVolumeBlockProtocolGuid ## CONSUMES @@ -125,9 +127,6 @@ [Guids] gEfiImageSecurityDatabaseGuid =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 ## CON= SUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize ## CON= SUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize ## CON= SUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize ## CON= SUMES diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf b/M= deModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf index eaa97a01c6e5..8c552b87e080 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf @@ -80,8 +80,10 @@ [LibraryClasses] AuthVariableLib VarCheckLib UefiBootServicesTableLib + VariableFlashInfoLib VariablePolicyLib VariablePolicyHelperLib + SafeIntLib =20 [Protocols] gEfiSmmFirmwareVolumeBlockProtocolGuid ## CONSUMES @@ -127,9 +129,6 @@ [Guids] gEdkiiVarErrorFlagGuid =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CO= NSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## SO= METIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize ## CO= NSUMES diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneM= m.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf index d8c4f77e7f1f..f09bed40cf51 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf @@ -73,9 +73,11 @@ [LibraryClasses] HobLib MemoryAllocationLib MmServicesTableLib + SafeIntLib StandaloneMmDriverEntryPoint SynchronizationLib VarCheckLib + VariableFlashInfoLib VariablePolicyLib VariablePolicyHelperLib =20 @@ -120,9 +122,6 @@ [Guids] gEdkiiVarErrorFlagGuid =20 [Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## SO= METIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 ## CO= NSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize ## CO= NSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize ## CO= NSUMES --=20 2.28.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 (#88652): https://edk2.groups.io/g/devel/message/88652 Mute This Topic: https://groups.io/mt/90345657/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- From nobody Fri May 17 03:00:58 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+88653+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+88653+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452714; cv=none; d=zohomail.com; s=zohoarc; b=GMtj2ZLS5CWjYiZCy0swpppoSxr3MmrQF8e96LNIrMpIDJqo0Kg9gc4NbCC+YZQuzjeoxa3iLN/GmbNg6vC4U+bcUf/qZvaVKfJqW91wgYmcAzzO28tvVSM2z9tPOXX2Oje2iGF8Rlju0hWGFONhDZVoe6xZfGlavO9TCyolk+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452714; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qMI3BdVB46IRzxuX2A0+GoawA4x+Xlp/etbAMQXydDQ=; b=K8pQQRMAkLnyfbdSPZPDIOAdQQZNn84g6ndQXDvWWFvUEQ7Os7lHqzBbm8h6OTJn1poX/3L7hObNyteCd7jwR1/g2E201fG0jhr4AWPEPdfw2AtX3Bk6FtudiQ2+uq1tba9CejUtNi5fxUnI5Yb9raDlcizpt2WBb0+o89em6WE= 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+88653+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 1649452714693223.6282561053423; Fri, 8 Apr 2022 14:18:34 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id GA58YY1788612xy7uJeWkTv1; Fri, 08 Apr 2022 14:18:34 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.729.1649452713502073279 for ; Fri, 08 Apr 2022 14:18:33 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 72CAC203A05C; Fri, 8 Apr 2022 14:18:32 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 72CAC203A05C From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v2 4/8] MdeModulePkg/FaultTolerantWrite: Consume Variable Flash Info Date: Fri, 8 Apr 2022 17:17:29 -0400 Message-Id: <20220408211733.1332-5-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.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,mikuback@linux.microsoft.com X-Gm-Message-State: Ka5ilVMTKxoEUijaias0EEHHx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452714; bh=lAzI95dygfq39NlEsXb+BezvCeq9lYNDMSzk/2H2/uU=; h=Cc:Date:From:Reply-To:Subject:To; b=l9RkAGR9QE0emWm2XoWf0yMLvnvziYdTeoKHtjkIgraBK9ysei6b7oBQmiiHuHAcrcS rO9cgcawpVwMs3Mj6hXwAU9CJoj0N/1g5R5OJsqlJh5FoWKXDbmj/ev6srOQVRgkO3yeF X9RKpIQhd0lk+feqq4U7Zt3O5vHUGp8lyp0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452715315100001 Content-Type: text/plain; charset="utf-8" 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 library. Cc: Jian J Wang Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Michael Kubacki --- MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c = | 41 +++++++++++++------- MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c = | 7 +++- MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c = | 28 ++++++++----- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h = | 7 +++- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf = | 10 +---- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf = | 10 +---- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneM= m.inf | 10 +---- MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf = | 10 +---- 8 files changed, 63 insertions(+), 60 deletions(-) diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c b/MdeMo= dulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c index 661e1487673b..f1335870e797 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c @@ -987,22 +987,43 @@ InitFtwDevice ( OUT EFI_FTW_DEVICE **FtwData ) { - EFI_FTW_DEVICE *FtwDevice; + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS WorkSpaceAddress; + UINT64 Size; + UINTN FtwWorkingSize; + EFI_FTW_DEVICE *FtwDevice; + + FtwWorkingSize =3D 0; + + Status =3D GetVariableFlashFtwWorkingInfo (&WorkSpaceAddress, &Size); + ASSERT_EFI_ERROR (Status); + + Status =3D SafeUint64ToUintn (Size, &FtwWorkingSize); + // This driver currently assumes the size will be UINTN so assert the va= lue is safe for now. + ASSERT_EFI_ERROR (Status); =20 // // Allocate private data of this driver, // Including the FtwWorkSpace[FTW_WORK_SPACE_SIZE]. // - FtwDevice =3D AllocateZeroPool (sizeof (EFI_FTW_DEVICE) + PcdGet32 (PcdF= lashNvStorageFtwWorkingSize)); + FtwDevice =3D AllocateZeroPool (sizeof (EFI_FTW_DEVICE) + FtwWorkingSize= ); if (FtwDevice =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } =20 + FtwDevice->WorkSpaceAddress =3D WorkSpaceAddress; + FtwDevice->WorkSpaceLength =3D FtwWorkingSize; + + Status =3D GetVariableFlashFtwSpareInfo (&FtwDevice->SpareAreaAddress, &= Size); + ASSERT_EFI_ERROR (Status); + + Status =3D SafeUint64ToUintn (Size, &FtwDevice->SpareAreaLength); + // This driver currently assumes the size will be UINTN so assert the va= lue is safe for now. + ASSERT_EFI_ERROR (Status); + // // Initialize other parameters, and set WorkSpace as FTW_ERASED_BYTE. // - FtwDevice->WorkSpaceLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwWork= ingSize); - FtwDevice->SpareAreaLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwSpar= eSize); if ((FtwDevice->WorkSpaceLength =3D=3D 0) || (FtwDevice->SpareAreaLength= =3D=3D 0)) { DEBUG ((DEBUG_ERROR, "Ftw: Workspace or Spare block does not exist!\n"= )); FreePool (FtwDevice); @@ -1015,16 +1036,6 @@ InitFtwDevice ( FtwDevice->FtwWorkSpaceLba =3D (EFI_LBA)(-1); FtwDevice->FtwSpareLba =3D (EFI_LBA)(-1); =20 - FtwDevice->WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFlash= NvStorageFtwWorkingBase64); - if (FtwDevice->WorkSpaceAddress =3D=3D 0) { - FtwDevice->WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFla= shNvStorageFtwWorkingBase); - } - - FtwDevice->SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFlash= NvStorageFtwSpareBase64); - if (FtwDevice->SpareAreaAddress =3D=3D 0) { - FtwDevice->SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFla= shNvStorageFtwSpareBase); - } - *FtwData =3D FtwDevice; return EFI_SUCCESS; } @@ -1277,7 +1288,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/UpdateWorkingBloc= k.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 mWorkingBlockH= eader =3D { ZERO_GUID, 0, 0 =20 Since Signature and WriteQueueSize have been known, Crc can be calculate= d out, then the work space header will be fixed. + + @param[in] WorkSpaceLength Length in bytes of the FTW workspace are= a. + **/ VOID InitializeLocalWorkSpaceHeader ( - VOID + IN UINTN WorkSpaceLength ) { // @@ -46,7 +49,7 @@ InitializeLocalWorkSpaceHeader ( &gEdkiiWorkingBlockSignatureGuid, sizeof (EFI_GUID) ); - mWorkingBlockHeader.WriteQueueSize =3D PcdGet32 (PcdFlashNvStorageFtwWor= kingSize) - sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER); + mWorkingBlockHeader.WriteQueueSize =3D WorkSpaceLength - sizeof (EFI_FAU= LT_TOLERANT_WORKING_BLOCK_HEADER); =20 // // Crc is calculated with all the fields except Crc and STATE, so leave = them as FTW_ERASED_BYTE. diff --git a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWrit= ePei.c b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei= .c index 15543f12ed29..8c152dcbad98 100644 --- a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c +++ b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.c @@ -16,6 +16,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include +#include =20 EFI_PEI_PPI_DESCRIPTOR mPpiListVariable =3D { (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), @@ -212,25 +214,31 @@ PeimFaultTolerantWriteInitialize ( EFI_PHYSICAL_ADDRESS SpareAreaAddress; UINTN SpareAreaLength; EFI_PHYSICAL_ADDRESS WorkSpaceInSpareArea; + UINT64 Size; FAULT_TOLERANT_WRITE_LAST_WRITE_DATA FtwLastWrite; =20 FtwWorkingBlockHeader =3D NULL; FtwLastWriteHeader =3D NULL; FtwLastWriteRecord =3D NULL; =20 - WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFlashNvStorageFt= wWorkingBase64); - if (WorkSpaceAddress =3D=3D 0) { - WorkSpaceAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFlashNvStorage= FtwWorkingBase); - } + SpareAreaAddress =3D 0; + SpareAreaLength =3D 0; + WorkSpaceAddress =3D 0; + WorkSpaceLength =3D 0; =20 - WorkSpaceLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwWorkingSize); + Status =3D GetVariableFlashFtwWorkingInfo (&WorkSpaceAddress, &Size); + ASSERT_EFI_ERROR (Status); =20 - SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdFlashNvStorageFt= wSpareBase64); - if (SpareAreaAddress =3D=3D 0) { - SpareAreaAddress =3D (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdFlashNvStorage= FtwSpareBase); - } + Status =3D SafeUint64ToUintn (Size, &WorkSpaceLength); + // This driver currently assumes the size will be UINTN so assert the va= lue is safe for now. + ASSERT_EFI_ERROR (Status); =20 - SpareAreaLength =3D (UINTN)PcdGet32 (PcdFlashNvStorageFtwSpareSize); + Status =3D GetVariableFlashFtwSpareInfo (&SpareAreaAddress, &Size); + ASSERT_EFI_ERROR (Status); + + Status =3D SafeUint64ToUintn (Size, &SpareAreaLength); + // This driver currently assumes the size will be UINTN so assert the va= lue is safe for now. + ASSERT_EFI_ERROR (Status); =20 // // The address of FTW working base and spare base must not be 0. diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrit= e.h b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h index c14e47b5c7b2..5b84d062c294 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h @@ -26,6 +26,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include +#include =20 // // Flash erase polarity is 1 @@ -708,10 +710,13 @@ InitFtwProtocol ( =20 Since Signature and WriteQueueSize have been known, Crc can be calculate= d out, then the work space header will be fixed. + + @param[in] WorkSpaceLength Length in bytes of the FTW workspace are= a. + **/ VOID InitializeLocalWorkSpaceHeader ( - VOID + IN UINTN WorkSpaceLength ); =20 /** diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrit= eDxe.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteD= xe.inf index 96165614d178..d524e1849a2e 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf @@ -46,6 +46,8 @@ [LibraryClasses] UefiLib PcdLib ReportStatusCodeLib + SafeIntLib + VariableFlashInfoLib =20 [Guids] # @@ -65,14 +67,6 @@ [Protocols] [FeaturePcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFullFtwServiceEnable ## CONSUMES =20 -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## CON= SUMES - # # gBS->CalculateCrc32() is consumed in EntryPoint. # PI spec said: When the DXE Foundation is notified that the EFI_RUNTIME_A= RCH_PROTOCOL diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrit= eSmm.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteS= mm.inf index 8cc6028470d8..8a4b9ad24657 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf @@ -52,6 +52,8 @@ [LibraryClasses] ReportStatusCodeLib SmmMemLib BaseLib + SafeIntLib + VariableFlashInfoLib =20 [Guids] # @@ -74,14 +76,6 @@ [Protocols] [FeaturePcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFullFtwServiceEnable ## CONSUMES =20 -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## CON= SUMES - # # gBS->CalculateCrc32() is consumed in EntryPoint. # PI spec said: When the DXE Foundation is notified that the EFI_RUNTIME_A= RCH_PROTOCOL diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrit= eStandaloneMm.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultToler= antWriteStandaloneMm.inf index d0fab7d9414f..0ac6edf771ab 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStanda= loneMm.inf +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStanda= loneMm.inf @@ -50,7 +50,9 @@ [LibraryClasses] MmServicesTableLib PcdLib ReportStatusCodeLib + SafeIntLib StandaloneMmDriverEntryPoint + VariableFlashInfoLib =20 [Guids] # @@ -73,13 +75,5 @@ [Protocols] [FeaturePcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFullFtwServiceEnable ## CONSUMES =20 -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## CON= SUMES - [Depex] TRUE diff --git a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWrit= ePei.inf b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWriteP= ei.inf index f90892ad4493..230138272c3a 100644 --- a/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf +++ b/MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf @@ -39,6 +39,8 @@ [LibraryClasses] HobLib BaseMemoryLib PcdLib + SafeIntLib + VariableFlashInfoLib =20 [Guids] ## SOMETIMES_PRODUCES ## HOB @@ -47,14 +49,6 @@ [Guids] gEdkiiWorkingBlockSignatureGuid ## SOMETIMES_CONSUMES ##= GUID gEfiSystemNvDataFvGuid ## SOMETIMES_CONSUMES ##= GUID =20 -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## SOM= ETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## CON= SUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## CON= SUMES - [Depex] TRUE =20 --=20 2.28.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 (#88653): https://edk2.groups.io/g/devel/message/88653 Mute This Topic: https://groups.io/mt/90345658/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- From nobody Fri May 17 03:00:58 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+88654+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+88654+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452718; cv=none; d=zohomail.com; s=zohoarc; b=I2V8JD6K+MK4okaH3O4yPodccHcywZODyTQ6Ff8mTaZ+KkDqlFTXpN9M6wcnQw7XPXRZzQQ2FK4ShDxe0DjHEdBn3pUcgBqjxd37kJcvk+jeFpKTWHGFH1i/o3U44jEvry49F3jpf7XfmnaWRJHAuZRNm8oXWaDqYrJM/XN4zpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452718; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=s+6Vdj3LziMtD+AmdK9SP9ldXXvrnLEgNDfA7dAOPcg=; b=i1GOQNesRAfqdEqj3Qy7Yqy1PDB4EP08kGhZ4DoJ15+q0HBjD9bSF/ENJshEZRW1B8GoUBb2A/MjgutxPMfpjBM7dSia9R61R6WARa5D8xOVrC39Qx7ge+uqeZ1jyfRcRWMKE5UpT7GCN4NmpZ7jrLZXoF9lJGK/C/Ae3GVf4+M= 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+88654+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 1649452718264597.9901048653336; Fri, 8 Apr 2022 14:18:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ww7qYY1788612xo7iBnCFMdN; Fri, 08 Apr 2022 14:18:37 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web08.710.1649452717284896773 for ; Fri, 08 Apr 2022 14:18:37 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 38CD920B9CEF; Fri, 8 Apr 2022 14:18:36 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 38CD920B9CEF From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann , Julien Grall Subject: [edk2-devel] [PATCH v2 5/8] ArmVirtPkg/ArmVirt.dsc.inc: Add VariableFlashInfoLib Date: Fri, 8 Apr 2022 17:17:30 -0400 Message-Id: <20220408211733.1332-6-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.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,mikuback@linux.microsoft.com X-Gm-Message-State: GQxOOQoUYMRyImmZ6Rp0DWhAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452717; bh=v5ulyiOR9k1PVaJS64VOkyYAJWZTw13draG/ioGJ/3A=; h=Cc:Date:From:Reply-To:Subject:To; b=meiPjhWswWqQiN8+3g1OHa9pbHJRAtozwt9WNrPuiU0Is0k0z4BLBnLiLdkgFnhswaa MvNaeeWzuQeH3CjPIKyhJauybvKIIMM44T4PO9RAU4yqViLaFMhWPUZEhFgLj2vk30eNd pi87wid/G+9CLgEXfKJs/UKzmhJhI+mqOWY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452719251100001 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Adds an instance of VariableFlashInfoLib to the platform build as it is a new library class introduced in MdeModulePkg. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Sami Mujawar Cc: Gerd Hoffmann Cc: Julien Grall Signed-off-by: Michael Kubacki --- ArmVirtPkg/ArmVirt.dsc.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index ba711deac025..988c1eb75529 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -177,6 +177,7 @@ [LibraryClasses.common] AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib= Null.inf !endif VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf --=20 2.28.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 (#88654): https://edk2.groups.io/g/devel/message/88654 Mute This Topic: https://groups.io/mt/90345659/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- From nobody Fri May 17 03:00:58 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+88655+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+88655+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452722; cv=none; d=zohomail.com; s=zohoarc; b=Yv6WTeSa7gmHEmGM0AkqcqzFM8qtXLe0HooKJzAn2ke9be3BZtVpS8saMSLAjiPxcKJa8tEGi1qi7zAF2bSN5sjUQ3TkZ3DRp9Z2E/OHrqLybxAIrw0D7gd5kjTMWckh+ioKATX6Oha0BQS8RNGzZrXb9qhLAcr/9hyONRx+Aq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452722; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=jbOc1wgA0ocYgv2XmJoY6Onmd9MvL9XLuHVajXgi/18=; b=cefBTqNRt7HW5tmreMZgT8yBQFI7/oZbk/4zHhB0XjjE7XOESv6uJEFg2pwGEAUqF/yWo/8FQc9YzbNzW66QPTcKJVI7LMdYDJKiLYgQ5qvPosM82W/Lnd978QkWrrOk4FdXD8QTSj8p/BV6uw4pvQbkCZfC/nX1DsVEqZephBA= 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+88655+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 1649452722747481.62593802194147; Fri, 8 Apr 2022 14:18:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 43xzYY1788612xKzt28YuIUM; Fri, 08 Apr 2022 14:18:42 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web12.732.1649452721614773153 for ; Fri, 08 Apr 2022 14:18:41 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 76698203A056; Fri, 8 Apr 2022 14:18:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 76698203A056 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni , Abner Chang , Nickle Wang Subject: [edk2-devel] [PATCH v2 6/8] EmulatorPkg: Add VariableFlashInfoLib Date: Fri, 8 Apr 2022 17:17:31 -0400 Message-Id: <20220408211733.1332-7-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.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,mikuback@linux.microsoft.com X-Gm-Message-State: OmwcctBNLiKmHyZBSn8Bfvv2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452722; bh=9xgMOo3J9M1m6/rqn937o+X8+ENb9nMnKl5EIHZ7pFs=; h=Cc:Date:From:Reply-To:Subject:To; b=uhxCXDH6jgwHC+XEslla9HXuI8ltkVkn2CCexTsTUgydgldSG+owHGQr0/1YjW+5ovQ xPbOnEUYp2PrCFKXn7y/e3+p0x41aptsHQ3/vNH0RIp4Vwmed/yT4TZVdX/NcV/KGyHsM T2JkZesai9+x/Ofm76LtaTgiySMQxJUSsH4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452723301100001 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Adds an instance of VariableFlashInfoLib to the platform build as it is a new library class introduced in MdeModulePkg. Cc: Andrew Fish Cc: Ray Ni Cc: Abner Chang Cc: Nickle Wang Signed-off-by: Michael Kubacki --- EmulatorPkg/EmulatorPkg.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index 554c13ddb500..4cf886b9eac7 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -122,6 +122,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ibRuntimeDxe.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf --=20 2.28.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 (#88655): https://edk2.groups.io/g/devel/message/88655 Mute This Topic: https://groups.io/mt/90345663/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- From nobody Fri May 17 03:00:58 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+88656+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+88656+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452733; cv=none; d=zohomail.com; s=zohoarc; b=SGaEPH/axRoR9kUZKf7EGS5Xl9+pAjDNg5Wm3/bYEjAr56vvL6BJX3UXKykY2Tj42yB4QIACPugw36gK3ZNJn4+thWOHW2Hu2ZjReijkFUoRH9TJyzxWAe9Yzx6hU5AmDm5qyrVDPhP3o0V3oIJur/r/9NZb/1WrCTNwve2Mjeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452733; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Uv3C0Nm9Pglrp2ymvnj4po58BF043MqOrXklYTUEvJs=; b=dtMwG8lLJ8I+rC0rFf4cMRZJX50A7LWQMgaYX+ZeKVe4YJiozys4pNTm4O7wnL5tuLaggzZ9vHPMPGqUPzLVk+6BLQDaclvu0aosa7S9i0h2a+h4Ay/PN2AKi4hwOAvgNO5iJJzCvik9XKmiBMSyyZbgUjGmu0wjnxPNglWK7n4= 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+88656+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 1649452733453677.2758403715287; Fri, 8 Apr 2022 14:18:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id XofgYY1788612x2fXi8JHLBH; Fri, 08 Apr 2022 14:18:53 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.734.1649452727114821691 for ; Fri, 08 Apr 2022 14:18:47 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id C811720B9CF0; Fri, 8 Apr 2022 14:18:44 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C811720B9CF0 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Anthony Perard , Ard Biesheuvel , Brijesh Singh , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Jordan Justen , Julien Grall , Min Xu , Peter Grehan , Rebecca Cran , Sebastien Boeuf , Tom Lendacky Subject: [edk2-devel] [PATCH v2 7/8] OvmfPkg: Add VariableFlashInfoLib Date: Fri, 8 Apr 2022 17:17:32 -0400 Message-Id: <20220408211733.1332-8-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.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,mikuback@linux.microsoft.com X-Gm-Message-State: ti1eGMUZv77y0hOcNvGuPnmCx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452733; bh=BWkQMuSNfrwVuKJ9umoBUF9SXqkMuQRzaqidK/o+fv4=; h=Cc:Date:From:Reply-To:Subject:To; b=rPGFuoRHd0RRJd7+pbk6D4Q2e4u5/shWQtg8y0HFbga31/6MADjSl/vyzulYnGpyc57 ALH+YbHkZVjM7sIpk6ay0yBq8mBG0rMx6gKrNI0b3zOOK3yDuQIdjtd6i2FZhD9QHL/qZ P6t/apjT10JJRmu2EIdOIvaefZEaa2lKv0g= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452735339100004 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Adds an instance of VariableFlashInfoLib to the platform build as it is a new library class introduced in MdeModulePkg. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Jordan Justen Cc: Julien Grall Cc: Min Xu Cc: Peter Grehan Cc: Rebecca Cran Cc: Sebastien Boeuf Cc: Tom Lendacky Signed-off-by: Michael Kubacki --- OvmfPkg/AmdSev/AmdSevX64.dsc | 1 + OvmfPkg/Bhyve/BhyveX64.dsc | 1 + OvmfPkg/CloudHv/CloudHvX64.dsc | 1 + OvmfPkg/IntelTdx/IntelTdxX64.dsc | 1 + OvmfPkg/Microvm/MicrovmX64.dsc | 1 + OvmfPkg/OvmfPkgIa32.dsc | 1 + OvmfPkg/OvmfPkgIa32X64.dsc | 1 + OvmfPkg/OvmfPkgX64.dsc | 1 + OvmfPkg/OvmfXen.dsc | 1 + 9 files changed, 9 insertions(+) diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index fcdc3efab204..3868c577fe39 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -195,6 +195,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 !if $(BUILD_SHELL) =3D=3D TRUE ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index e1b6b8e15f36..3df49e54de8a 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -206,6 +206,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 # # Network libraries diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc index 20f3bc340807..19b84275eba3 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -216,6 +216,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 =20 # diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index 245155d41b30..f21a33ed6ba3 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -184,6 +184,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index 59580ccd4691..d8603f016a0c 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -206,6 +206,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 =20 # diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index e4218b01f0fc..c689d4707046 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -213,6 +213,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 =20 # diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index a80cdaacb8bc..44c75639aa5d 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -217,6 +217,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 =20 # diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index fb2899f8a1be..60e7e3724a6b 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -225,6 +225,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 =20 # diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 7bd594c6e263..01d832323585 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -195,6 +195,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf =20 =20 # --=20 2.28.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 (#88656): https://edk2.groups.io/g/devel/message/88656 Mute This Topic: https://groups.io/mt/90345664/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- From nobody Fri May 17 03:00:58 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+88657+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+88657+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649452733; cv=none; d=zohomail.com; s=zohoarc; b=hqOh3jkJAfxSIRbnPeocxQyEUoeH8ve9wuq0LzgMmOCozyn8X9F1Z1xs48B27mDcUzBt5PhE1TJZkEnZpEdLkF+/oc73O8KqTD5TZ61eRUFlg7kJ0Kklr2mke0bMssxgbENax9psKSxzMhPkNcoHQhbLlcwjEI3y/q1xyBCNRzg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649452733; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=k6wawzOj9sS02tEuO9qeBQIknBASO/Hxfw97Ux7Odos=; b=XH38dDyPXOrljBq5wU4FbwihxjtTrDrBKg3sAucrI8TGCcfGm/wxq/33E+v7yFZFR2aPimVRD0IAQ8vpiTNVuKPUmPyb2xY9r7MXOwrvS8r4OdAXUpECiT8VkwB89tPG4X+QI2e6FVjOohceajFv6UnRlrsTaJiWlouX3oHDv64= 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+88657+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 1649452733982160.0618801881285; Fri, 8 Apr 2022 14:18:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yUKtYY1788612x8lexDXqsY0; Fri, 08 Apr 2022 14:18:53 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.721.1649452732755271709 for ; Fri, 08 Apr 2022 14:18:52 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 7412D20B36F7; Fri, 8 Apr 2022 14:18:51 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7412D20B36F7 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Maurice Ma , Benjamin You , Sean Rhodes Subject: [edk2-devel] [PATCH v2 8/8] UefiPayloadPkg: Add VariableFlashInfoLib Date: Fri, 8 Apr 2022 17:17:33 -0400 Message-Id: <20220408211733.1332-9-mikuback@linux.microsoft.com> In-Reply-To: <20220408211733.1332-1-mikuback@linux.microsoft.com> References: <20220408211733.1332-1-mikuback@linux.microsoft.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,mikuback@linux.microsoft.com X-Gm-Message-State: QqXs9CIJOPan3VVHDDTzVFc8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649452733; bh=1v7xSV/I309IPIQyHLvPSmhrP+47IeRkQSKB7E2Q2RA=; h=Cc:Date:From:Reply-To:Subject:To; b=VPcxjlm+uc55b0AyQt7FE/dFKSRHFMco9Y48UsaMir2ienZ5SzLW+iVJxXvWkjOElvd k84Y3H0HpQnofRo/QTBbdObdF4hnstCpChVh8cEnLfGOLElHBndSGtubaaez4GJBfRX6d /dn2O2U9uPEzn2s9oEei5rzPnTkblofq44A= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649452735313100003 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3479 Adds an instance of VariableFlashInfoLib to the platform build as it is a new library class introduced in MdeModulePkg. Cc: Guo Dong Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Cc: Sean Rhodes Signed-off-by: Michael Kubacki --- UefiPayloadPkg/UefiPayloadPkg.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index e2ea48348257..170c5a1db4b2 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -272,6 +272,7 @@ [LibraryClasses] VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf + VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf =20 --=20 2.28.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 (#88657): https://edk2.groups.io/g/devel/message/88657 Mute This Topic: https://groups.io/mt/90345666/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-