From nobody Wed May 15 11:16:04 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+88710+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+88710+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649698962; cv=none; d=zohomail.com; s=zohoarc; b=TH9BkVyrmwqcFJv0BbbYeRKN316GrDmVzVTDE6ZNhKrKPneW3GTd1AbgRlM3dfDNa7T7Q0dz8xdup4q2vm8JF+hw+roRgIzDO0a6W2syHkwEDRwO9+N+EtzHNa+j3nNQAjUo3jRhS9Db/Tn0GoPuEzrxIsacWJPNehK0OXcgUKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649698962; 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=MFesZONJlUaKrCt2vZ7pk496fhWx9CumQhgU4t1QnfQ=; b=eLDSrbKu1uOqnGl4jN/uEyX9zrOgQ0V4x0m7lDSDJXHWwrk/xxDLh8pVeFV7neGLQ/8jiglvXACa3142bqYPocYqVcq+RbK38LcX+ebDWhstpWDTw+RDqCUTF9+mooSJF5qGOV0vUTH5l5k9mK8tqI/TR9XJ8v6QKn4LDoCPvQY= 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+88710+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 1649698962237373.3602945344402; Mon, 11 Apr 2022 10:42:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KP1FYY1788612xm56NX3H06m; Mon, 11 Apr 2022 10:42:41 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.304.1649698961274812647 for ; Mon, 11 Apr 2022 10:42:41 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 0113020B9CEF; Mon, 11 Apr 2022 10:42:39 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0113020B9CEF From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v3 1/8] MdeModulePkg: Add Variable Flash Info HOB Date: Mon, 11 Apr 2022 13:42:02 -0400 Message-Id: <20220411174209.2804-2-mikuback@linux.microsoft.com> In-Reply-To: <20220411174209.2804-1-mikuback@linux.microsoft.com> References: <20220411174209.2804-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: dTVljdHVal9nHBJvbZlbOFRex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649698961; bh=o4vlWaqw6IvuJ2VK1RLYOxwxKQyRhfOzuSBAh1ISjX4=; h=Cc:Date:From:Reply-To:Subject:To; b=awzTEtzqymflMKobSAECxUikugVXrvTtltnGUdUOYK1Rs2KX3pgZf4FVvCmGrWo45N6 0bjD1DcyWjAAk0WNoHhuMDEEsU8kJuFZ0LAYM7SR6xq8ZJ9xDCwr2V7nTm71FtzGAxaGC L7BFnUlPpSaVJ074XTb/1WOJ6JOcXwMWKw8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649698962750100001 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 | 78 ++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 4 + 2 files changed, 82 insertions(+) diff --git a/MdeModulePkg/Include/Guid/VariableFlashInfo.h b/MdeModulePkg/I= nclude/Guid/VariableFlashInfo.h new file mode 100644 index 000000000000..7520953cd0f2 --- /dev/null +++ b/MdeModulePkg/Include/Guid/VariableFlashInfo.h @@ -0,0 +1,78 @@ +/** @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 { + /// + /// Version of this structure. + /// + /// Increment the value when the structure is modified. + /// + UINT32 Version; + /// + /// Base address of the non-volatile variable range in the flash device. + /// + /// Note that this address should align with the block size requirements= of the flash device. + /// + EFI_PHYSICAL_ADDRESS NvVariableBaseAddress; + /// + /// Size of the non-volatile variable range in the flash device. + /// + /// Note that this value should be less than or equal to FtwSpareLength = to support reclaim of + /// entire variable store area. + /// Note that this address should align with the block size requirements= of the flash device. + /// + UINT64 NvVariableLength; + /// + /// Base address of the FTW spare block range in the flash device. + /// + /// Note that this address should align with the block size requirements= of the flash device. + /// + EFI_PHYSICAL_ADDRESS FtwSpareBaseAddress; + /// + /// Size of the FTW spare block range in the flash device. + /// + /// Note that this value should be greater than or equal to NvVariableLe= ngth. + /// Note that this address should align with the block size requirements= of the flash device. + /// + UINT64 FtwSpareLength; + /// + /// Base address of the FTW working block range in the flash device. + /// + /// Note that if FtwWorkingLength is larger than on block size, this val= ue should be block size aligned. + /// + EFI_PHYSICAL_ADDRESS FtwWorkingBaseAddress; + /// + /// Size of the FTW working block range in the flash device. + /// + /// Note that if the value is less than on block size, the range should = not span blocks. + /// Note that if the value is larger than one block size, this value sho= uld be block size aligned. + /// + 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 (#88710): https://edk2.groups.io/g/devel/message/88710 Mute This Topic: https://groups.io/mt/90400858/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 Wed May 15 11:16:04 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+88711+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+88711+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649698967; cv=none; d=zohomail.com; s=zohoarc; b=fU7SdoOKeFj9T4mX4hhfM4A1BNz6DXAsM4ELn9xTN8VRX7E0mlNp6APammSNdz0dBBn13DQaFuE7iPopKKfL+Yvu2NQuljn9sX+B8PDU2aSERA08Jo0mSLwmL1eLkh3spke93jmy3CsgDuRCXFZ9gqIAZigx7+3Ip+pgH6P9qTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649698967; 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=qqOk0wX1UQxjQmqUacyEQnuet+xDX7nvDQIs9lWs5WI=; b=d/Nhc3s8mHtcazBeCZ4nH8MrkcJeywY8NPgAT/YN/yxotqccXLpqAB28OhcJOFOnYnJjg2re+vHNfbS94UAxoS4pX+wI3ipYOddZ/R3mSa5yWoo9WG9eH/UTEjfSPTXX6++dLcbvNuSiIupJmLNL5LaDSxfMYHVied6y0gBKXSI= 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+88711+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 1649698967350829.9570462308295; Mon, 11 Apr 2022 10:42:47 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 5jYXYY1788612xuamaOpqhlC; Mon, 11 Apr 2022 10:42:47 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.352.1649698966151417492 for ; Mon, 11 Apr 2022 10:42:46 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 438B8209DDA1; Mon, 11 Apr 2022 10:42:45 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 438B8209DDA1 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v3 2/8] MdeModulePkg/VariableFlashInfoLib: Add initial library Date: Mon, 11 Apr 2022 13:42:03 -0400 Message-Id: <20220411174209.2804-3-mikuback@linux.microsoft.com> In-Reply-To: <20220411174209.2804-1-mikuback@linux.microsoft.com> References: <20220411174209.2804-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: GVMXVAR3DGVG4TxNzpl9dN10x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649698967; bh=dXHqerm8GvCDZQewAJ37dOrMyRTmArH6tu+1QDV2HXY=; h=Cc:Date:From:Reply-To:Subject:To; b=rOyMY2gd0hF/LIdlXZP7cJBGP9ExhOpxViSe9kwG3CivLx3CqxAhLSGYXdipZtPGwPN eks+9nR+LLMufO5nJTwB2MKJj53efRGTjeYD5eGPyVUMGe/jm76jxGMSV6mPmMq8J1k0Y 0GM2RKIIcS1l72Ef9ouuvTXb32zXPZzsc4c= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649698968715100001 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..a1db97bdf218 --- /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->NvVariableBaseAddress; + *Length =3D VariableFlashInfo->NvVariableLength; + } 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 (#88711): https://edk2.groups.io/g/devel/message/88711 Mute This Topic: https://groups.io/mt/90400860/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 Wed May 15 11:16:04 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+88712+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+88712+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649698971; cv=none; d=zohomail.com; s=zohoarc; b=npDzSdAT70klp3/5n9Lmx12ul4pS79r+hLRb50gZOwO6Z8I8cl94zZHskRX5ayZXlhXEml/rbfvN/nCU+mfwID+J3DbO4EJwBxOBd7ghQjbP+q3TqFRkBLypezQSVqc87EoAbczr75yICuvptdei/4aJvlYoY/+iZn/k3XUREYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649698971; 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=+OsOsazoa/LL5fJZPSAWvJ3U231Gau5LTcAxgOkqo3o=; b=e/0YCdUpzYygpeOzozxyU5N2dkDq94NfrOplVoBEL7+lWUEe0EhTMlBfnfdlRV28rRYKHLLi8jfCRwDtr/duYa47+i7aQp4No+5WcktC7pPjj1EwuwGx5zSdFfvf5CVjIedYs5Mg96GekRyHIw4YB7tUVV2nZvuN3KfIlXt/Nhk= 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+88712+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 1649698971750845.7987888937423; Mon, 11 Apr 2022 10:42:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cfQIYY1788612xJ7UR8wImn8; Mon, 11 Apr 2022 10:42:51 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.333.1649698970706886564 for ; Mon, 11 Apr 2022 10:42:50 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id B2CE020BA5AC; Mon, 11 Apr 2022 10:42:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B2CE020BA5AC From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v3 3/8] MdeModulePkg/Variable: Consume Variable Flash Info Date: Mon, 11 Apr 2022 13:42:04 -0400 Message-Id: <20220411174209.2804-4-mikuback@linux.microsoft.com> In-Reply-To: <20220411174209.2804-1-mikuback@linux.microsoft.com> References: <20220411174209.2804-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: IjAiHivfmNKDvaxx6Cl04YXgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649698971; bh=YL1E2y9C/3UERPAYGvjxre8bg4Rc8CJ6O9r3u51jIw0=; h=Cc:Date:From:Reply-To:Subject:To; b=BWDIBlqoyLIcT/mZcEmzwBxUclmHcfUFn2+v4gWUSSN5Tvnl0L7nXen3hpZGu/Sw4IE Rj5tXwYDix7SsboNax/IxGgk+jiFc1GiKSzlbvcnCM9B8ia0NN9P2YGpfiL9cnT0kNEZw ZIwSkQl7/mbJnZlggayWxDeg6EIh5TBdrVw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649698972785100001 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 (#88712): https://edk2.groups.io/g/devel/message/88712 Mute This Topic: https://groups.io/mt/90400862/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 Wed May 15 11:16:04 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+88713+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+88713+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649698976; cv=none; d=zohomail.com; s=zohoarc; b=lZFqeNotOEbqUJkJqZKZQwtYgK49g0YOKZwDaOK6XH3roJjuxrtxrG4fM6inN7GFIC3CDZ9+3lwhRQErK2gxdyBPGc7y9L7BqWmXHG+3oCjLkHnK7pESr+dZxW/He9DzirPgBWN5iOkIKi7wamDccAq+YloHsxHKNILOKQDLFxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649698976; 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=Vfyc+lgGT7bsBJu0HISETMubX20NojDlF001aXsccU0=; b=Paa1v+TPMDVy8enb0wErvCmIUs1ZrJHtIUpVFvCkdfOGYhfUsfA9Wn5V/WirvOrxSwks+zRasXAiQpqn6HD9EVTuaw4xSR8zfy+KRsmnWvXbjjrDvIjRST91O3w5YcCjCsvLi4Vo5SujxgnRYVH9johmOhO8josa3prW3yJa8P8= 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+88713+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 1649698976415569.8915209396865; Mon, 11 Apr 2022 10:42:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id MiNwYY1788612xk3appvVgEy; Mon, 11 Apr 2022 10:42:56 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web08.353.1649698975161732171 for ; Mon, 11 Apr 2022 10:42:55 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 49405209DDA1; Mon, 11 Apr 2022 10:42:54 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 49405209DDA1 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v3 4/8] MdeModulePkg/FaultTolerantWrite: Consume Variable Flash Info Date: Mon, 11 Apr 2022 13:42:05 -0400 Message-Id: <20220411174209.2804-5-mikuback@linux.microsoft.com> In-Reply-To: <20220411174209.2804-1-mikuback@linux.microsoft.com> References: <20220411174209.2804-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: GmFnTAalgPix4lNhQLlOkiCWx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649698976; bh=V5VC3NnortHrgDdTxTxDHFyzFFoQvFqFNN9/TGvb03E=; h=Cc:Date:From:Reply-To:Subject:To; b=FSy5O2uoT7jbihzAcxTExEoApU9y4j/iBpATU712gcxM3rRSwL1s8YustaOARkNB7au xZJaCO8Q6zM5W1Um2Ei/9yuJuKbnbYuWZbtAjPSlqvtWtDeFM98IOS9UndLrLvTYkC0Tl ixdzaVW6OtTiOc6unjeHm7Uxl7UiuTp2H2M= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649698976836100001 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 (#88713): https://edk2.groups.io/g/devel/message/88713 Mute This Topic: https://groups.io/mt/90400865/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 Wed May 15 11:16:04 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+88714+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+88714+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649698981; cv=none; d=zohomail.com; s=zohoarc; b=PdRXXMSmgVx3SwdBoBdFYG3lHftUEUK9GzvNhHgeMri7XYCp00hlFsbxrn8wYhhkc9o/ierPUEwaYnMUBXO6LYAcOZqYoH9T86UzYVX7dy8zyqy/B8DeYP4x/JVL/+GZMX0QvxwG+jvGyLtvfuwognukZoiebU6xQnnvgUbBovA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649698981; 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=bbML4wp7nssK3+Yy7dXjFvfi19l3Tf38IluDW3ZguNk=; b=aza8+OmXwpq5+TQ3pvLk9kBQfy5tTvKzeNWFXrt3WKZKiagXwV7SPMjo3rULWPvLE73GEfIGlWjjgrodysEVCEKd5z76T77D/QQmfGZ1IgXdzkPKDs1cwft7ZzFD56msy4KAlJUNvXzBArOtJlNZY1icI9GmTWjZjQYMOyXZPVg= 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+88714+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 1649698981121717.8515904844164; Mon, 11 Apr 2022 10:43:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7GcwYY1788612xWPxjOh5wOs; Mon, 11 Apr 2022 10:43:00 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.337.1649698980107829900 for ; Mon, 11 Apr 2022 10:43:00 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 5F17720BE4A2; Mon, 11 Apr 2022 10:42:58 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5F17720BE4A2 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann , Julien Grall Subject: [edk2-devel] [PATCH v3 5/8] ArmVirtPkg/ArmVirt.dsc.inc: Add VariableFlashInfoLib Date: Mon, 11 Apr 2022 13:42:06 -0400 Message-Id: <20220411174209.2804-6-mikuback@linux.microsoft.com> In-Reply-To: <20220411174209.2804-1-mikuback@linux.microsoft.com> References: <20220411174209.2804-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: uU8Z5DHFtk7tDUaXkfqqZP01x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649698980; bh=ixTVTUzJQ6ofHMWHXjShe/RPyjh/SwkfMuRhHkO7vUQ=; h=Cc:Date:From:Reply-To:Subject:To; b=oNDvVcnpNJrk9slL7vGfB6K3M+C4XdR6hYtyWZKBm79JXqrK82RayopAhsNYuCPW/DL +EybhSiWoQuwIYSAYXP6XRylcDVj1mUvDMEMEQHdlJOAGfzPY4z8ine0dpbT28I4/w+kX DUZgc6Dji/6jArZ6q6wyP76YZT+4ypc3HPw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649698982843100003 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 (#88714): https://edk2.groups.io/g/devel/message/88714 Mute This Topic: https://groups.io/mt/90400867/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 Wed May 15 11:16:04 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+88715+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+88715+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649698985; cv=none; d=zohomail.com; s=zohoarc; b=UEQEqoyRnM/aWQi+/IlPtOt/IqiUIsiFgqeBpn+Bgf7uN63Q3vHw7tlHOVRm5w2Nl8oh3afnbFNlcBeO7xMcaIic2aXlTODFo3h4iumm8BGQ3dCnWqkFRSH8VlMellagFmO1xEjBR+NW7dP1JZX509FGeBJ1JMIEi86Nze5IGSs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649698985; 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=9A3UCOCdOW+2W9Auh9CSzEOYFFiBelI4eYjLHLubS3w=; b=BsSebKILnQ7hq3VgZi4B3lhyWfStteWP/Kp/r+65fjJ1Iz2JPBnKW4H1OKIu8YGA/RtpsRqe2ijH9Ke7wKplT3e59CVp9R1cKMuuJEoC97dgZJigEL2gowRVY3DneQRn27hSfujHbO2O586BpwA4oMeJWn66kLI4I02BRtg7Sys= 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+88715+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 16496989856301019.7637565147334; Mon, 11 Apr 2022 10:43:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UUCgYY1788612xRqRDSrn2B0; Mon, 11 Apr 2022 10:43:05 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web12.350.1649698984557697753 for ; Mon, 11 Apr 2022 10:43:04 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 5628120B9CEF; Mon, 11 Apr 2022 10:43:03 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5628120B9CEF From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Andrew Fish , Ray Ni , Abner Chang , Nickle Wang Subject: [edk2-devel] [PATCH v3 6/8] EmulatorPkg: Add VariableFlashInfoLib Date: Mon, 11 Apr 2022 13:42:07 -0400 Message-Id: <20220411174209.2804-7-mikuback@linux.microsoft.com> In-Reply-To: <20220411174209.2804-1-mikuback@linux.microsoft.com> References: <20220411174209.2804-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: ljLWd2UOUG97deWWy9wGxcrZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649698985; bh=Kh399Dmr9eDc3RQNtnPY5aAObj2J7++NUl2OVmBrof8=; h=Cc:Date:From:Reply-To:Subject:To; b=K4rwiSQFrIEv4DI/P92Q75Dlhl6LetAAKyyhZHQoyPxYswNuhuxL535tZhDx+zkOnID knMteTiVwea6J454DDhGSNYywzRKcntJqFgoF7ICCsr7Hzv8cfxEzQk5K3xh91UelslAr 7hrWMPk7BC6nogUlkN9jzRK1BxKk4WzlK8k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649698986812100001 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 (#88715): https://edk2.groups.io/g/devel/message/88715 Mute This Topic: https://groups.io/mt/90400869/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 Wed May 15 11:16:04 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+88716+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+88716+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649698990; cv=none; d=zohomail.com; s=zohoarc; b=BV+rKHy6Jn/wdzIAECV0LIwpeigMq1B7SSHF9Tx7wcLb/3bwH0GskyCUYtHfP6BoNqN8uIayrd7GvJNLXUIwf4afACtvWUbRtFO58OabR0lWFmyBwzJ23VseqzXexplFO7qcb1dkBGVfdMHMcA/2V7ew1M6pwO1Plb6QC3ts3Q4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649698990; 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=Hcj7NE+/AWQQVoJO7g1vTQkvECPxD9nJZdM8tJdJiAo=; b=DMpTrqOlnw0pK4mXPSh2hEHE3uUbNC0ePQJqPrfSGKeZi5NlMQcRE0pEVg3wmaRXuCSCDu2ZTdfAwF8XNKgGXNivfsEeAxLjAp1/vjis3Ab751jevg3nh7HDJI60hWPZseCfYJVewBikuYRgf6CKMrSK3Eu71HLJ3dnQQwtVGLw= 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+88716+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 1649698990971221.07223313593488; Mon, 11 Apr 2022 10:43:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xjQQYY1788612xG2H2AD514w; Mon, 11 Apr 2022 10:43:10 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.315.1649698989928339646 for ; Mon, 11 Apr 2022 10:43:10 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id F05BB209DDA1; Mon, 11 Apr 2022 10:43:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F05BB209DDA1 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 v3 7/8] OvmfPkg: Add VariableFlashInfoLib Date: Mon, 11 Apr 2022 13:42:08 -0400 Message-Id: <20220411174209.2804-8-mikuback@linux.microsoft.com> In-Reply-To: <20220411174209.2804-1-mikuback@linux.microsoft.com> References: <20220411174209.2804-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: Zwi2WuMNpVoh4Em7zpwR6hcwx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649698990; bh=dv5ZgiMbrpZHI7XNTex3JAF6QkgyDoZ55zxmuS6qOhc=; h=Cc:Date:From:Reply-To:Subject:To; b=Y3TeAdPGNKZDSp5Dj6oBcblI2ezr+DlnYE7s0/x4ZbCzFndLSQiHr2EtOIlBcRm7+Ce SzaLivKQ9eRoGYjExhLatF+zM92L4rrdOwFwsSJDUM4H1pgbODjsOJqrPxjv29uKXBFa3 QXgpoSlIYDnW8oM2VI5l77OMEqjQqO73pxA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649698992879100003 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 (#88716): https://edk2.groups.io/g/devel/message/88716 Mute This Topic: https://groups.io/mt/90400872/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 Wed May 15 11:16:04 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+88717+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+88717+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1649698995; cv=none; d=zohomail.com; s=zohoarc; b=dYT4bprx5zQVDz+MijH7vHlDyWOtilsDy80Scsk3kx6+RdZ7utplxOCA0UPIEywANdcnSipKBSMNLQi35S273CRSnBIrSb3MgzRqj340/LDbB4D7KK0YbKxhDN79wWS7UR7mpUFaWs6tNbG3eFN8aqXkcliO19Rme+hW1TrQEOE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649698995; 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=fbybIOcvZ0wXCcSqgVmdtPxZrJpBaDzSt6ywgyAmRjA=; b=Lwx0xf6aP+wlY/uVjnTwmQ6/tgqtcLIZQ3HbL7ogYBEsgq6x3JyPzp29r0wo72fxKqLp0J1jh7NdDwpkjHEfU6Tpp1EwVxJpHLLwgwKKgH2Vqp1xpepfOGwCtptrxQY7qkKyMDFzvw4FdujyElQLFrlST78bgjiXfmVGwdY0XKc= 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+88717+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 1649698995006183.48877083856974; Mon, 11 Apr 2022 10:43:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id y4mCYY1788612xJSw0NLSfq7; Mon, 11 Apr 2022 10:43:14 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.342.1649698994061928494 for ; Mon, 11 Apr 2022 10:43:14 -0700 X-Received: from localhost.localdomain (unknown [47.201.46.36]) by linux.microsoft.com (Postfix) with ESMTPSA id 0D3E720B9CF0; Mon, 11 Apr 2022 10:43:12 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0D3E720B9CF0 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Maurice Ma , Benjamin You , Sean Rhodes Subject: [edk2-devel] [PATCH v3 8/8] UefiPayloadPkg: Add VariableFlashInfoLib Date: Mon, 11 Apr 2022 13:42:09 -0400 Message-Id: <20220411174209.2804-9-mikuback@linux.microsoft.com> In-Reply-To: <20220411174209.2804-1-mikuback@linux.microsoft.com> References: <20220411174209.2804-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: vvCWgECqfqI3XM4V1R2kGtpUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649698994; bh=r2CMgOpUrZgNBF32BoQCr1GNrMC/loQVYrHGLSoSHD8=; h=Cc:Date:From:Reply-To:Subject:To; b=qjaanfb8AYxA5BmEG3SE4LP6r/kXcG3LlMhaEWFlv7NIyVWrwMzFPbK/kZF/pEgqoSC XwDjZpVZRO6e7Ts7Eg6ImUw9hzFq6j5+6LB8Xoe/Y9UMoRm9Eow/VtX3rwvtr1y1irWOY raRgpgjlvT6rJwxxS5XiYCcmcKNuCLTygpU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649698996818100003 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 17b30589e77c..4d9bbc80c866 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 (#88717): https://edk2.groups.io/g/devel/message/88717 Mute This Topic: https://groups.io/mt/90400874/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-