From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534378825169.98657716179696; Tue, 14 Mar 2017 16:32:58 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9A59B803E1; Tue, 14 Mar 2017 16:32:55 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 97310803E1 for ; Tue, 14 Mar 2017 16:32:53 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32ADEC04B95E; Tue, 14 Mar 2017 23:32:54 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwV006449; Tue, 14 Mar 2017 19:32:53 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:33 +0100 Message-Id: <20170314233246.17864-2-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 14 Mar 2017 23:32:54 +0000 (UTC) Subject: [edk2] [PATCH 01/14] OvmfPkg/EmuVariableFvbRuntimeDxe: always format an auth varstore header X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In this patch, we extend commit d92eaabefbe0 ("OvmfPkg: simplify VARIABLE_STORE_HEADER generation", 2016-02-05) to EmuVariableFvbRuntimeDxe. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf | 3 - OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c | 79 ++------------------ 2 files changed, 5 insertions(+), 77 deletions(-) diff --git a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf b/OvmfPkg/EmuVariable= FvbRuntimeDxe/Fvb.inf index 4d4827decb52..69b3c9972a76 100644 --- a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf +++ b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf @@ -68,9 +68,6 @@ [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved =20 -[FeaturePcd] - gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable - [Depex] TRUE =20 diff --git a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c b/OvmfPkg/EmuVariableFv= bRuntimeDxe/Fvb.c index dec6d4af50df..7a6d3153ec8c 100644 --- a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c +++ b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.c @@ -626,75 +626,6 @@ InitializeFvAndVariableStoreHeaders ( ) { // - // Templates for standard (non-authenticated) variable FV header - // - STATIC FVB_FV_HDR_AND_VARS_TEMPLATE FvAndVarTemplate =3D { - { // EFI_FIRMWARE_VOLUME_HEADER FvHdr; - // UINT8 ZeroVector[16]; - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - - // EFI_GUID FileSystemGuid; - EFI_SYSTEM_NV_DATA_FV_GUID, - - // UINT64 FvLength; - EMU_FVB_SIZE, - - // UINT32 Signature; - EFI_FVH_SIGNATURE, - - // EFI_FVB_ATTRIBUTES_2 Attributes; - 0x4feff, - - // UINT16 HeaderLength; - EMU_FV_HEADER_LENGTH, - - // UINT16 Checksum; - 0, - - // UINT16 ExtHeaderOffset; - 0, - - // UINT8 Reserved[1]; - {0}, - - // UINT8 Revision; - EFI_FVH_REVISION, - - // EFI_FV_BLOCK_MAP_ENTRY BlockMap[1]; - {=20 - { - 2, // UINT32 NumBlocks; - EMU_FVB_BLOCK_SIZE // UINT32 Length; - } - } - }, - // EFI_FV_BLOCK_MAP_ENTRY EndBlockMap; - { 0, 0 }, // End of block map - { // VARIABLE_STORE_HEADER VarHdr; - // EFI_GUID Signature; - EFI_VARIABLE_GUID, - - // UINT32 Size; - ( - FixedPcdGet32 (PcdVariableStoreSize) - - OFFSET_OF (FVB_FV_HDR_AND_VARS_TEMPLATE, VarHdr) - ), - - // UINT8 Format; - VARIABLE_STORE_FORMATTED, - - // UINT8 State; - VARIABLE_STORE_HEALTHY, - - // UINT16 Reserved; - 0, - - // UINT32 Reserved1; - 0 - } - }; - - // // Templates for authenticated variable FV header // STATIC FVB_FV_HDR_AND_VARS_TEMPLATE FvAndAuthenticatedVarTemplate =3D { @@ -768,11 +699,11 @@ InitializeFvAndVariableStoreHeaders ( // // Copy the template structure into the location // - if (FeaturePcdGet (PcdSecureBootEnable) =3D=3D FALSE) { - CopyMem (Ptr, (VOID*)&FvAndVarTemplate, sizeof (FvAndVarTemplate)); - } else { - CopyMem (Ptr, (VOID*)&FvAndAuthenticatedVarTemplate, sizeof (FvAndAuth= enticatedVarTemplate)); - } + CopyMem ( + Ptr, + &FvAndAuthenticatedVarTemplate, + sizeof FvAndAuthenticatedVarTemplate + ); =20 // // Update the checksum for the FV header --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534379901923.5341374709784; Tue, 14 Mar 2017 16:32:59 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CD251803E5; Tue, 14 Mar 2017 16:32:57 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3E5BA803E5 for ; Tue, 14 Mar 2017 16:32:57 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD42A81F01; Tue, 14 Mar 2017 23:32:57 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwW006449; Tue, 14 Mar 2017 19:32:56 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:34 +0100 Message-Id: <20170314233246.17864-3-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 14 Mar 2017 23:32:57 +0000 (UTC) Subject: [edk2] [PATCH 02/14] OvmfPkg: remove gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This PCD is no longer used. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/OvmfPkg.dec | 1 - OvmfPkg/OvmfPkgIa32.dsc | 3 --- OvmfPkg/OvmfPkgIa32X64.dsc | 3 --- OvmfPkg/OvmfPkgX64.dsc | 3 --- 4 files changed, 10 deletions(-) diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 3490f7ca7c07..5627be0bab0a 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -136,7 +136,6 @@ [PcdsDynamic, PcdsDynamicEx] gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x27 =20 [PcdsFeatureFlag] - gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|FALSE|BOOLEAN|3 gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE|BOOLEAN|0= x1c gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|FALSE|BOOLEAN= |0x1d =20 diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 0796b0db816b..6d24ef113e64 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -381,9 +381,6 @@ [PcdsFeatureFlag] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE -!if $(SECURE_BOOT_ENABLE) =3D=3D TRUE - gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE -!endif !if $(SMM_REQUIRE) =3D=3D TRUE gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 71ac62f023b5..e9d5322d35cc 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -386,9 +386,6 @@ [PcdsFeatureFlag] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE -!if $(SECURE_BOOT_ENABLE) =3D=3D TRUE - gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE -!endif !if $(SMM_REQUIRE) =3D=3D TRUE gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 2ceb31d7ffd5..65ed44e827fc 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -386,9 +386,6 @@ [PcdsFeatureFlag] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE -!if $(SECURE_BOOT_ENABLE) =3D=3D TRUE - gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootEnable|TRUE -!endif !if $(SMM_REQUIRE) =3D=3D TRUE gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534384984760.9111848441181; Tue, 14 Mar 2017 16:33:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 07D87803E9; Tue, 14 Mar 2017 16:32:59 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 78986803E8 for ; Tue, 14 Mar 2017 16:32:58 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1327283F42; Tue, 14 Mar 2017 23:32:59 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwX006449; Tue, 14 Mar 2017 19:32:58 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:35 +0100 Message-Id: <20170314233246.17864-4-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 14 Mar 2017 23:32:59 +0000 (UTC) Subject: [edk2] [PATCH 03/14] OvmfPkg/PlatformPei: remove unused PcdVariableStoreSize dependency X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/PlatformPei/PlatformPei.inf | 1 - 1 file changed, 1 deletion(-) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 53c6dd445a0e..a1e12c1fc7e2 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -84,7 +84,6 @@ [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDecompressionScratchEnd gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress - gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534383293111.54297364814818; Tue, 14 Mar 2017 16:33:03 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 452C3803E8; Tue, 14 Mar 2017 16:33:01 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B254480331 for ; Tue, 14 Mar 2017 16:32:59 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50956C04B959; Tue, 14 Mar 2017 23:33:00 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwY006449; Tue, 14 Mar 2017 19:32:59 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:36 +0100 Message-Id: <20170314233246.17864-5-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 14 Mar 2017 23:33:00 +0000 (UTC) Subject: [edk2] [PATCH 04/14] OvmfPkg/PlatformPei: don't allocate reserved mem varstore if SMM_REQUIRE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" For the emulated variable store, PlatformPei allocates reserved memory (as early as possible, so that the address remains the same during reboot), and PcdEmuVariableNvStoreReserved carries the address to EmuVariableFvbRuntimeDxe. However, EmuVariableFvbRuntimeDxe is excluded from the SMM_REQUIRE build, and then noone consumes PcdEmuVariableNvStoreReserved. Don't waste reserved memory whenever that's the case. (Even a dynamic default for PcdEmuVariableNvStoreReserved would be unnecessary; but that way the PcdSet64S() call in the ReserveEmuVariableNvStore() function doesn't compile.) Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 3 +++ OvmfPkg/OvmfPkgIa32X64.dsc | 3 +++ OvmfPkg/OvmfPkgX64.dsc | 3 +++ OvmfPkg/PlatformPei/Platform.c | 4 +++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 6d24ef113e64..8e88744087e0 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -469,7 +469,10 @@ [PcdsFixedAtBuild] ##########################################################################= ###### =20 [PcdsDynamicDefault] + # only set when + # ($(SMM_REQUIRE) =3D=3D FALSE) gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index e9d5322d35cc..18348d8e9c58 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -475,7 +475,10 @@ [PcdsFixedAtBuild.X64] ##########################################################################= ###### =20 [PcdsDynamicDefault] + # only set when + # ($(SMM_REQUIRE) =3D=3D FALSE) gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 65ed44e827fc..76dd72a0d0d0 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -474,7 +474,10 @@ [PcdsFixedAtBuild] ##########################################################################= ###### =20 [PcdsDynamicDefault] + # only set when + # ($(SMM_REQUIRE) =3D=3D FALSE) gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 77a8a16c15b8..041eb9d189b4 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -661,7 +661,9 @@ InitializePlatform ( mHostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID); =20 if (mBootMode !=3D BOOT_ON_S3_RESUME) { - ReserveEmuVariableNvStore (); + if (!FeaturePcdGet (PcdSmmSmramRequire)) { + ReserveEmuVariableNvStore (); + } PeiFvInitialization (); MemMapInitialization (); NoexecDxeInitialization (); --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534385486754.5510005727514; Tue, 14 Mar 2017 16:33:05 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 779FC803EE; Tue, 14 Mar 2017 16:33:02 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EF40A80331 for ; Tue, 14 Mar 2017 16:33:00 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8CD2A85547; Tue, 14 Mar 2017 23:33:01 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwZ006449; Tue, 14 Mar 2017 19:33:00 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:37 +0100 Message-Id: <20170314233246.17864-6-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 14 Mar 2017 23:33:01 +0000 (UTC) Subject: [edk2] [PATCH 05/14] OvmfPkg: introduce PcdMemVarstoreEmuEnable feature flag X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ... and the corresponding MEM_VARSTORE_EMU_ENABLE build define, which defaults to TRUE. Setting the build flag to FALSE will later enable the exclusion of the dynamically allocated, emulated, in-memory varstore. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/OvmfPkg.dec | 6 ++++++ OvmfPkg/OvmfPkgIa32.dsc | 4 ++++ OvmfPkg/OvmfPkgIa32X64.dsc | 4 ++++ OvmfPkg/OvmfPkgX64.dsc | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 5627be0bab0a..3c39a3b79894 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -148,3 +148,9 @@ [PcdsFeatureFlag] # runtime OS from tampering with firmware structures (special memory ra= nges # used by OVMF, the varstore pflash chip, LockBox etc). gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|FALSE|BOOLEAN|0x1e + + ## This feature flag reports whether in-memory (that is, non-flash) vari= able + # emulation is enabled. Note that with PcdSmmSmramRequire set to TRUE, = this + # setting is irrelevant, as SMM/SMRAM support always requires flash + # variables. + gUefiOvmfPkgTokenSpaceGuid.PcdMemVarstoreEmuEnable|TRUE|BOOLEAN|3 diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 8e88744087e0..c3d7d146ecb7 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -39,6 +39,7 @@ [Defines] DEFINE HTTP_BOOT_ENABLE =3D FALSE DEFINE SMM_REQUIRE =3D FALSE DEFINE TLS_ENABLE =3D FALSE + DEFINE MEM_VARSTORE_EMU_ENABLE =3D TRUE =20 [BuildOptions] GCC:*_UNIXGCC_*_CC_FLAGS =3D -DMDEPKG_NDEBUG @@ -385,6 +386,9 @@ [PcdsFeatureFlag] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE !endif +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D FALSE + gUefiOvmfPkgTokenSpaceGuid.PcdMemVarstoreEmuEnable|FALSE +!endif =20 [PcdsFixedAtBuild] gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 18348d8e9c58..55a6c66e986d 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -39,6 +39,7 @@ [Defines] DEFINE HTTP_BOOT_ENABLE =3D FALSE DEFINE SMM_REQUIRE =3D FALSE DEFINE TLS_ENABLE =3D FALSE + DEFINE MEM_VARSTORE_EMU_ENABLE =3D TRUE =20 [BuildOptions] GCC:*_UNIXGCC_*_CC_FLAGS =3D -DMDEPKG_NDEBUG @@ -390,6 +391,9 @@ [PcdsFeatureFlag] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE !endif +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D FALSE + gUefiOvmfPkgTokenSpaceGuid.PcdMemVarstoreEmuEnable|FALSE +!endif =20 [PcdsFixedAtBuild] gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 76dd72a0d0d0..400c96ee4b0f 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -39,6 +39,7 @@ [Defines] DEFINE HTTP_BOOT_ENABLE =3D FALSE DEFINE SMM_REQUIRE =3D FALSE DEFINE TLS_ENABLE =3D FALSE + DEFINE MEM_VARSTORE_EMU_ENABLE =3D TRUE =20 [BuildOptions] GCC:*_UNIXGCC_*_CC_FLAGS =3D -DMDEPKG_NDEBUG @@ -390,6 +391,9 @@ [PcdsFeatureFlag] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE !endif +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D FALSE + gUefiOvmfPkgTokenSpaceGuid.PcdMemVarstoreEmuEnable|FALSE +!endif =20 [PcdsFixedAtBuild] gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534389960499.86936123765895; Tue, 14 Mar 2017 16:33:09 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B253D803DA; Tue, 14 Mar 2017 16:33:04 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 31B3B803DA for ; Tue, 14 Mar 2017 16:33:02 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2C3D61B8E; Tue, 14 Mar 2017 23:33:02 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwa006449; Tue, 14 Mar 2017 19:33:01 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:38 +0100 Message-Id: <20170314233246.17864-7-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 14 Mar 2017 23:33:02 +0000 (UTC) Subject: [edk2] [PATCH 06/14] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: check PcdMemVarstoreEmuEnable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch parallels commit b963ec494c48 ("OvmfPkg: QemuFlashFvbServicesRuntimeDxe: adhere to -D SMM_REQUIRE", 2015-11-30) in that if QemuFlashDetected() fails -- because flash is not found --, not only SMM_REQUIRE=3DTRUE is a wrong build to execute, but MEM_VARSTORE_EMU_ENABLE=3DFALSE as well. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf | 1 + OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf | 1 + OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 1 + 3 files changed, 3 insertions(+) diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.i= nf b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf index c0dda75bf75f..cf30d5c8f021 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf @@ -87,6 +87,7 @@ [Pcd] =20 [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire + gUefiOvmfPkgTokenSpaceGuid.PcdMemVarstoreEmuEnable =20 [Depex] TRUE diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf b/Ov= mfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf index ba2d3679a46d..d5aa393dbc0b 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf @@ -86,6 +86,7 @@ [Pcd] =20 [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire + gUefiOvmfPkgTokenSpaceGuid.PcdMemVarstoreEmuEnable =20 [Depex] TRUE diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c b/OvmfPkg/Q= emuFlashFvbServicesRuntimeDxe/QemuFlash.c index 5677b5ee119c..60bc7a84bd6b 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c @@ -246,6 +246,7 @@ QemuFlashInitialize ( =20 if (!QemuFlashDetected ()) { ASSERT (!FeaturePcdGet (PcdSmmSmramRequire)); + ASSERT (FeaturePcdGet (PcdMemVarstoreEmuEnable)); return EFI_WRITE_PROTECTED; } =20 --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534393367474.90098597523513; Tue, 14 Mar 2017 16:33:13 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E3333803F4; Tue, 14 Mar 2017 16:33:04 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6FF1680331 for ; Tue, 14 Mar 2017 16:33:03 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BF9EC04B95F; Tue, 14 Mar 2017 23:33:04 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwb006449; Tue, 14 Mar 2017 19:33:03 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:39 +0100 Message-Id: <20170314233246.17864-8-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 14 Mar 2017 23:33:04 +0000 (UTC) Subject: [edk2] [PATCH 07/14] OvmfPkg: conditionally disable reserved memory varstore emulation at build X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" (All of the below is only relevant for SMM_REQUIRE=3DFALSE.) For the emulated variable store, PlatformPei allocates reserved memory (as early as possible, so that the address remains the same during reboot), and PcdEmuVariableNvStoreReserved carries the address to EmuVariableFvbRuntimeDxe. In addition, QemuFlashFvbServicesRuntimeDxe is always launched before EmuVariableFvbRuntimeDxe, so that if flash variables are available, QemuFlashFvbServicesRuntimeDxe can set PcdFlashNvStorageVariableBase64 first, and EmuVariableFvbRuntimeDxe can exit early. This ordering is currently enforced by adding QemuFlashFvbServicesRuntimeDxe to the APRIORI DXE file. All of this is unnecessary when MEM_VARSTORE_EMU_ENABLE is set to FALSE. In such a build, - (almost) remove the dynamic default for PcdEmuVariableNvStoreReserved (we can't really do this because the PcdSet64() in ReserveEmuVariableNvStore() wouldn't compile), - prevent the reserved memory allocation and PCD setting in PlatformPei, - exclude EmuVariableFvbRuntimeDxe, - and drop QemuFlashFvbServicesRuntimeDxe from the APRIORI DXE file (since it doesn't have to beat EmuVariableFvbRuntimeDxe in setting PcdFlashNvStorageVariableBase64 any longer). Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 4 +++- OvmfPkg/OvmfPkgIa32X64.dsc | 4 +++- OvmfPkg/OvmfPkgX64.dsc | 4 +++- OvmfPkg/OvmfPkgIa32.fdf | 4 +++- OvmfPkg/OvmfPkgIa32X64.fdf | 4 +++- OvmfPkg/OvmfPkgX64.fdf | 4 +++- OvmfPkg/PlatformPei/PlatformPei.inf | 1 + OvmfPkg/PlatformPei/Platform.c | 3 ++- 8 files changed, 21 insertions(+), 7 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index c3d7d146ecb7..416868ab51fb 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -474,7 +474,7 @@ [PcdsFixedAtBuild] =20 [PcdsDynamicDefault] # only set when - # ($(SMM_REQUIRE) =3D=3D FALSE) + # (($(SMM_REQUIRE) =3D=3D FALSE) && ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D= TRUE)) gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 @@ -840,10 +840,12 @@ [Components] # Variable driver stack (non-SMM) # OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D TRUE OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf { PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.i= nf } +!endif MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 55a6c66e986d..ca661fb09410 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -480,7 +480,7 @@ [PcdsFixedAtBuild.X64] =20 [PcdsDynamicDefault] # only set when - # ($(SMM_REQUIRE) =3D=3D FALSE) + # (($(SMM_REQUIRE) =3D=3D FALSE) && ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D= TRUE)) gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 @@ -849,10 +849,12 @@ [Components.X64] # Variable driver stack (non-SMM) # OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D TRUE OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf { PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.i= nf } +!endif MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 400c96ee4b0f..0205ca987aee 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -479,7 +479,7 @@ [PcdsFixedAtBuild] =20 [PcdsDynamicDefault] # only set when - # ($(SMM_REQUIRE) =3D=3D FALSE) + # (($(SMM_REQUIRE) =3D=3D FALSE) && ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D= TRUE)) gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 @@ -847,10 +847,12 @@ [Components] # Variable driver stack (non-SMM) # OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D TRUE OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf { PlatformFvbLib|OvmfPkg/Library/EmuVariableFvbLib/EmuVariableFvbLib.i= nf } +!endif MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index 09c165882c3f..ce6641f534d0 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -190,7 +190,7 @@ [FV.DXEFV] APRIORI DXE { INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf -!if $(SMM_REQUIRE) =3D=3D FALSE +!if ($(SMM_REQUIRE) =3D=3D FALSE) && ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D TR= UE) INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf !endif } @@ -376,7 +376,9 @@ [FV.DXEFV] # Variable driver stack (non-SMM) # INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D TRUE INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf +!endif INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf !endif diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 5233314139bc..c28a3080bee7 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -190,7 +190,7 @@ [FV.DXEFV] APRIORI DXE { INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf -!if $(SMM_REQUIRE) =3D=3D FALSE +!if ($(SMM_REQUIRE) =3D=3D FALSE) && ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D TR= UE) INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf !endif } @@ -376,7 +376,9 @@ [FV.DXEFV] # Variable driver stack (non-SMM) # INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D TRUE INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf +!endif INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf !endif diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 36150101e784..00c539ca5e4a 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -190,7 +190,7 @@ [FV.DXEFV] APRIORI DXE { INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf -!if $(SMM_REQUIRE) =3D=3D FALSE +!if ($(SMM_REQUIRE) =3D=3D FALSE) && ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D TR= UE) INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf !endif } @@ -376,7 +376,9 @@ [FV.DXEFV] # Variable driver stack (non-SMM) # INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +!if $(MEM_VARSTORE_EMU_ENABLE) =3D=3D TRUE INF OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf +!endif INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf !endif diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index a1e12c1fc7e2..9c1ffa9815c1 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -103,6 +103,7 @@ [FixedPcd] =20 [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire + gUefiOvmfPkgTokenSpaceGuid.PcdMemVarstoreEmuEnable =20 [Ppis] gEfiPeiMasterBootModePpiGuid diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 041eb9d189b4..ec449b422eda 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -661,7 +661,8 @@ InitializePlatform ( mHostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID); =20 if (mBootMode !=3D BOOT_ON_S3_RESUME) { - if (!FeaturePcdGet (PcdSmmSmramRequire)) { + if (!FeaturePcdGet (PcdSmmSmramRequire) && + FeaturePcdGet (PcdMemVarstoreEmuEnable)) { ReserveEmuVariableNvStore (); } PeiFvInitialization (); --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534394869242.10785341648682; Tue, 14 Mar 2017 16:33:14 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2028E803F3; Tue, 14 Mar 2017 16:33:07 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B32AC803E3 for ; Tue, 14 Mar 2017 16:33:04 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 49D8761B8E; Tue, 14 Mar 2017 23:33:05 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwc006449; Tue, 14 Mar 2017 19:33:04 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:40 +0100 Message-Id: <20170314233246.17864-9-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 14 Mar 2017 23:33:05 +0000 (UTC) Subject: [edk2] [PATCH 08/14] OvmfPkg: resolve PcdLib for all PEIMs individually X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently the default (module type independent) PcdLib resolution is to BasePcdLibNull.inf, which is inherited by all PEIMs. In the next patch, we'll flip the PEIM default resolution to PeiPcdLib.inf, but in order to keep that patch both correct and simple to review, we should spell out the Null resolution for those two PEIMs (ReportStatusCodeRouterPei and StatusCodeHandlerPei) that are now the only ones that don't specify an explicit resolution. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 10 ++++++++-- OvmfPkg/OvmfPkgIa32X64.dsc | 10 ++++++++-- OvmfPkg/OvmfPkgX64.dsc | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 416868ab51fb..19932b874550 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -537,8 +537,14 @@ [Components] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf + MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index ca661fb09410..da34a2663f68 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -545,8 +545,14 @@ [Components.IA32] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf + MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 0205ca987aee..a16555e12ec6 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -544,8 +544,14 @@ [Components] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf + MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534398680580.0609736756793; Tue, 14 Mar 2017 16:33:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5BFDD803FA; Tue, 14 Mar 2017 16:33:07 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E76B4803F7 for ; Tue, 14 Mar 2017 16:33:05 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8403681241; Tue, 14 Mar 2017 23:33:06 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwd006449; Tue, 14 Mar 2017 19:33:05 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:41 +0100 Message-Id: <20170314233246.17864-10-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 14 Mar 2017 23:33:06 +0000 (UTC) Subject: [edk2] [PATCH 09/14] OvmfPkg: resolve PcdLib for PEIMs to PeiPcdLib by default X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In the previous patch we had to add two explicit Null resolutions, but here we can remove five PeiPcdLib ones, after setting the default to it. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 22 +++++--------------- OvmfPkg/OvmfPkgIa32X64.dsc | 22 +++++--------------- OvmfPkg/OvmfPkgX64.dsc | 22 +++++--------------- 3 files changed, 15 insertions(+), 51 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 19932b874550..0d073e3341ba 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -238,6 +238,7 @@ [LibraryClasses.common.PEIM] CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuE= xceptionHandlerLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf =20 [LibraryClasses.common.DXE_CORE] HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf @@ -545,32 +546,19 @@ [Components] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/PlatformPei/PlatformPei.inf UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf !if $(SMM_REQUIRE) =3D=3D TRUE LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf !endif } !if $(SMM_REQUIRE) =3D=3D TRUE - OvmfPkg/SmmAccess/SmmAccessPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 # # DXE Phase modules diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index da34a2663f68..20810acbe030 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -243,6 +243,7 @@ [LibraryClasses.common.PEIM] CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuE= xceptionHandlerLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf =20 [LibraryClasses.common.DXE_CORE] HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf @@ -553,32 +554,19 @@ [Components.IA32] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/PlatformPei/PlatformPei.inf UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf !if $(SMM_REQUIRE) =3D=3D TRUE LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf !endif } !if $(SMM_REQUIRE) =3D=3D TRUE - OvmfPkg/SmmAccess/SmmAccessPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 [Components.X64] # diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index a16555e12ec6..844581d2c417 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -243,6 +243,7 @@ [LibraryClasses.common.PEIM] CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuE= xceptionHandlerLib.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf =20 [LibraryClasses.common.DXE_CORE] HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf @@ -552,32 +553,19 @@ [Components] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf } - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 - OvmfPkg/PlatformPei/PlatformPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/PlatformPei/PlatformPei.inf UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf !if $(SMM_REQUIRE) =3D=3D TRUE LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf !endif } !if $(SMM_REQUIRE) =3D=3D TRUE - OvmfPkg/SmmAccess/SmmAccessPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf { - - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - } + UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 # # DXE Phase modules --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534399219524.5472251815715; Tue, 14 Mar 2017 16:33:19 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8E55780400; Tue, 14 Mar 2017 16:33:08 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2CF13803F7 for ; Tue, 14 Mar 2017 16:33:07 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD0D3C04B95E; Tue, 14 Mar 2017 23:33:07 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwe006449; Tue, 14 Mar 2017 19:33:06 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:42 +0100 Message-Id: <20170314233246.17864-11-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 14 Mar 2017 23:33:07 +0000 (UTC) Subject: [edk2] [PATCH 10/14] OvmfPkg: introduce FlashNvStorageAddressLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" An OVMF binary built with -D SMM_REQUIRE or with -D MEM_VARSTORE_EMU_ENABLE=3DFALSE requires flash to be present at the expected (build-time determined) location; falling back to the emulated varstore is not possible. In such builds, we can replace the settings of the - varstore, - FTW working block, - and FTW spare area address PCDs in QemuFlashFvbServicesRuntimeDxe with identical settings in a new plug-in (NULL class) library, to be linked into variable-related PEIMs. This will enable such builds to access variables during the PEI phase, without dynamic flash detection and without ordering constraints against other PEIMs. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressLib.inf | 48= ++++++++++++++++++ OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressLib.c | 53= ++++++++++++++++++++ 2 files changed, 101 insertions(+) diff --git a/OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddress= Lib.inf b/OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressLib= .inf new file mode 100644 index 000000000000..f79194f80de9 --- /dev/null +++ b/OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressLib.inf @@ -0,0 +1,48 @@ +## @file +# +# A hook-in library for variable-related PEIMs, in order to set +# - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64, +# - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase, +# - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase, +# from their gUefiOvmfPkgTokenSpaceGuid counterparts, just before those PE= IMs +# consume them. +# +# Copyright (C) 2017, Red Hat, Inc. +# +# This program and the accompanying materials are licensed and made availa= ble +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +## + +[Defines] + INF_VERSION =3D 1.25 + BASE_NAME =3D FlashNvStorageAddressLib + FILE_GUID =3D 5FF5A9F9-D01E-49EC-9A17-1682FC85122F + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D FlashNvStorageAddressLib|PEIM + CONSTRUCTOR =3D SetFlashNvStorageAddresses + +[Sources] + FlashNvStorageAddressLib.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + OvmfPkg/OvmfPkg.dec + +[LibraryClasses] + PcdLib + +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase diff --git a/OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddress= Lib.c b/OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressLib.c new file mode 100644 index 000000000000..dc1280cc23f1 --- /dev/null +++ b/OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressLib.c @@ -0,0 +1,53 @@ +/** @file + + A hook-in library for variable-related PEIMs, in order to set + - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64, + - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase, + - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase, + from their gUefiOvmfPkgTokenSpaceGuid counterparts, just before those PE= IMs + consume them. + + Copyright (C) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + +RETURN_STATUS +EFIAPI +SetFlashNvStorageAddresses ( + VOID + ) +{ + RETURN_STATUS PcdStatus; + + PcdStatus =3D PcdSet64S ( + PcdFlashNvStorageVariableBase64, + PcdGet32 (PcdOvmfFlashNvStorageVariableBase) + ); + if (RETURN_ERROR (PcdStatus)) { + return PcdStatus; + } + + PcdStatus =3D PcdSet32S ( + PcdFlashNvStorageFtwWorkingBase, + PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase) + ); + if (RETURN_ERROR (PcdStatus)) { + return PcdStatus; + } + + PcdStatus =3D PcdSet32S ( + PcdFlashNvStorageFtwSpareBase, + PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase) + ); + return PcdStatus; +} --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534405191678.8545965768451; Tue, 14 Mar 2017 16:33:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CD548803FD; Tue, 14 Mar 2017 16:33:09 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6A288803FE for ; Tue, 14 Mar 2017 16:33:08 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 087AC12B48; Tue, 14 Mar 2017 23:33:09 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwf006449; Tue, 14 Mar 2017 19:33:08 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:43 +0100 Message-Id: <20170314233246.17864-12-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 14 Mar 2017 23:33:09 +0000 (UTC) Subject: [edk2] [PATCH 11/14] OvmfPkg: include FaultTolerantWritePei and VariablePei X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ... but only for the -D SMM_REQUIRE and -D MEM_VARSTORE_EMU_ENABLE=3DFALSE builds, where - FaultTolerantWritePei can immediately consume PcdFlashNvStorageFtwWorkingBase and PcdFlashNvStorageFtwSpareBase, - and VariablePei can immediately consume PcdFlashNvStorageVariableBase64, with the help of FlashNvStorageAddressLib, plus variables can actually be read from some variable store (namely, the pflash chip). FaultTolerantWritePei produces a GUID data HOB with FAULT_TOLERANT_WRITE_LAST_WRITE_DATA as contents. It also installs a Null PPI that carries, as GUID, the same gEdkiiFaultTolerantWriteGuid as the GUID data HOB. VariablePei depends on the Null PPI mentioned above with a DEPEX, consumes the HOB (which is safe due to the DEPEX), and produces EFI_PEI_READ_ONLY_VARIABLE2_PPI. Because of the above serialization via the Null PPI, it suffices to link FlashNvStorageAddressLib into FaultTolerantWritePei only. Cc: Jordan Justen Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D386 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 7 +++++++ OvmfPkg/OvmfPkgIa32X64.dsc | 7 +++++++ OvmfPkg/OvmfPkgX64.dsc | 7 +++++++ OvmfPkg/OvmfPkgIa32.fdf | 4 ++++ OvmfPkg/OvmfPkgIa32X64.fdf | 4 ++++ OvmfPkg/OvmfPkgX64.fdf | 4 ++++ 6 files changed, 33 insertions(+) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 0d073e3341ba..ff6c397b287b 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -559,6 +559,13 @@ [Components] OvmfPkg/SmmAccess/SmmAccessPei.inf !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf +!if ($(SMM_REQUIRE) =3D=3D TRUE) || ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D FAL= SE) + MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf { + + NULL|OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressL= ib.inf + } + MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +!endif =20 # # DXE Phase modules diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 20810acbe030..42c366030a7c 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -567,6 +567,13 @@ [Components.IA32] OvmfPkg/SmmAccess/SmmAccessPei.inf !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf +!if ($(SMM_REQUIRE) =3D=3D TRUE) || ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D FAL= SE) + MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf { + + NULL|OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressL= ib.inf + } + MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +!endif =20 [Components.X64] # diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 844581d2c417..9bcb6ae4377b 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -566,6 +566,13 @@ [Components] OvmfPkg/SmmAccess/SmmAccessPei.inf !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf +!if ($(SMM_REQUIRE) =3D=3D TRUE) || ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D FAL= SE) + MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf { + + NULL|OvmfPkg/Library/FlashNvStorageAddressLib/FlashNvStorageAddressL= ib.inf + } + MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +!endif =20 # # DXE Phase modules diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index ce6641f534d0..1d00feabf50a 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -164,6 +164,10 @@ [FV.PEIFV] INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +!if ($(SMM_REQUIRE) =3D=3D TRUE) || ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D FAL= SE) +INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf +INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +!endif =20 ##########################################################################= ###### =20 diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index c28a3080bee7..33aff848e66e 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -164,6 +164,10 @@ [FV.PEIFV] INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +!if ($(SMM_REQUIRE) =3D=3D TRUE) || ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D FAL= SE) +INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf +INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +!endif =20 ##########################################################################= ###### =20 diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 00c539ca5e4a..259e4419480c 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -164,6 +164,10 @@ [FV.PEIFV] INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +!if ($(SMM_REQUIRE) =3D=3D TRUE) || ($(MEM_VARSTORE_EMU_ENABLE) =3D=3D FAL= SE) +INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf +INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +!endif =20 ##########################################################################= ###### =20 --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534405384181.67958474928264; Tue, 14 Mar 2017 16:33:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 078AD803FF; Tue, 14 Mar 2017 16:33:13 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A199180331 for ; Tue, 14 Mar 2017 16:33:09 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4133212B48; Tue, 14 Mar 2017 23:33:10 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwg006449; Tue, 14 Mar 2017 19:33:09 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:44 +0100 Message-Id: <20170314233246.17864-13-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 14 Mar 2017 23:33:10 +0000 (UTC) Subject: [edk2] [PATCH 12/14] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: don't set flash PCDs if SMM or no-emu X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" ... only check them. When OVMF is built with -D SMM_REQUIRE or with -D MEM_VARSTORE_EMU_ENABLE=3DFALSE then the PCDs are set during the PEI phase, as part of FaultTolerantWritePei's startup (in FlashNvStorageAddressLib's constructor). Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c | 58 +++++++++++++= +------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c b/Ovmf= Pkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c index ff27c1100c01..62419a8fdf08 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c @@ -1093,24 +1093,46 @@ FvbInitialize ( =20 MarkMemoryRangeForRuntimeAccess (BaseAddress, Length); =20 - // - // Set several PCD values to point to flash - // - PcdStatus =3D PcdSet64S ( - PcdFlashNvStorageVariableBase64, - (UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); - PcdStatus =3D PcdSet32S ( - PcdFlashNvStorageFtwWorkingBase, - PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); - PcdStatus =3D PcdSet32S ( - PcdFlashNvStorageFtwSpareBase, - PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase) - ); - ASSERT_RETURN_ERROR (PcdStatus); + if (!FeaturePcdGet (PcdSmmSmramRequire) && + FeaturePcdGet (PcdMemVarstoreEmuEnable)) { + // + // This build is suitable for both flash and in-memory emulated variab= les, + // and we happen to have found flash. Set several PCD values to point = to + // flash. + // + PcdStatus =3D PcdSet64S ( + PcdFlashNvStorageVariableBase64, + PcdGet32 (PcdOvmfFlashNvStorageVariableBase) + ); + ASSERT_RETURN_ERROR (PcdStatus); + PcdStatus =3D PcdSet32S ( + PcdFlashNvStorageFtwWorkingBase, + PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase) + ); + ASSERT_RETURN_ERROR (PcdStatus); + PcdStatus =3D PcdSet32S ( + PcdFlashNvStorageFtwSpareBase, + PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase) + ); + ASSERT_RETURN_ERROR (PcdStatus); + } else { + // + // This build is suitable for flash variables only. Double-check sever= al + // PCDs that point to the flash. + // + ASSERT ( + (PcdGet64 (PcdFlashNvStorageVariableBase64) =3D=3D + PcdGet32 (PcdOvmfFlashNvStorageVariableBase)) + ); + ASSERT ( + (PcdGet32 (PcdFlashNvStorageFtwWorkingBase) =3D=3D + PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase)) + ); + ASSERT ( + (PcdGet32 (PcdFlashNvStorageFtwSpareBase) =3D=3D + PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase)) + ); + } =20 FwhInstance =3D (EFI_FW_VOL_INSTANCE *) ( --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534408873822.0356351157754; Tue, 14 Mar 2017 16:33:28 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3DF6180406; Tue, 14 Mar 2017 16:33:13 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 08FAD80403 for ; Tue, 14 Mar 2017 16:33:11 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97D9285547; Tue, 14 Mar 2017 23:33:11 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwh006449; Tue, 14 Mar 2017 19:33:10 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:45 +0100 Message-Id: <20170314233246.17864-14-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 14 Mar 2017 23:33:11 +0000 (UTC) Subject: [edk2] [PATCH 13/14] OvmfPkg/PlatformPei: remedy UEFI memory map fragmentation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The Memory Type Information HOB is used for sizing the allocation bins for the various memory types. If the PEI phase does not produce the HOB, and it includes the VariablePei driver, then the DXE IPL PEIM will itself build the HOB, from the "MemoryTypeInformation" non-volatile variable. (The HOB is consumed in the DxeLoadCore() function, and it is ignored if the boot mode is BOOT_ON_S3_RESUME. Accordingly, we already don't build the HOB in InitializePlatform() during S3 resume; MemMapInitialization() isn't called.) In the BDS phase, BmSetMemoryTypeInformationVariable() reads the variable (if it exists) under all boot modes different from BOOT_WITH_DEFAULT_SETTINGS, and (re-)sets the variable if it doesn't exist, or the counts of the pages allocated during boot have changed, relative to what the variable predicted. In effect this creates a feedback loop between BDS and the next boot's PEI, making sure the memory allocation bins are sized large enough in advance. Ultimately, for BOOT_WITH_FULL_CONFIGURATION, as a special case of the above, this measures the maximum boot memory requirement per UEFI memory type, and over time decreases fragmentation in the UEFI memory map. We continue creating our (constant) Memory Type Information HOB in OvmfPkg/PlatformPei -- which prevents the above feedback loop -- except in one case: when OVMF is built with SMM_REQUIRE=3DTRUE or MEM_VARSTORE_EMU_ENABLE=3DFALSE (that is, when a flash-based varstore is guaranteed), and the "MemoryTypeInformation" variable exists (that is, when the virtual machine has been booted at least once). This lets the OS installer see a somewhat fragmented memory map at first boot, but further boots should witness defragmented maps. In practice the difference seems to be 20-24 entries in the UEFI memory map. In the longer term this should also serve as basis for S4 enablement. For now, we keep the PcdResetOnMemoryTypeInformationChange|FALSE setting in the OVMF DSC files, dating back to commit 7709cf48e432 ("DuetPkg, OvmfPkg, UnixPkg: Remove unnecessary reset during boot", 2010-12-06). Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/PlatformPei/PlatformPei.inf | 2 + OvmfPkg/PlatformPei/Platform.h | 5 + OvmfPkg/PlatformPei/MemTypeInfo.c | 151 ++++++++++++++++++++ OvmfPkg/PlatformPei/Platform.c | 23 +-- 4 files changed, 159 insertions(+), 22 deletions(-) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 9c1ffa9815c1..21f3a5ea4909 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -33,6 +33,7 @@ [Sources] FeatureControl.c Fv.c MemDetect.c + MemTypeInfo.c Platform.c Xen.c =20 @@ -108,6 +109,7 @@ [FeaturePcd] [Ppis] gEfiPeiMasterBootModePpiGuid gEfiPeiMpServicesPpiGuid + gEfiPeiReadOnlyVariable2PpiGuid =20 [Depex] TRUE diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h index 18f42c3f0ea8..64a87da4a70a 100644 --- a/OvmfPkg/PlatformPei/Platform.h +++ b/OvmfPkg/PlatformPei/Platform.h @@ -74,6 +74,11 @@ PeiFvInitialization ( ); =20 VOID +MemTypeInfoInitialization ( + VOID + ); + +VOID InstallFeatureControlCallback ( VOID ); diff --git a/OvmfPkg/PlatformPei/MemTypeInfo.c b/OvmfPkg/PlatformPei/MemTyp= eInfo.c new file mode 100644 index 000000000000..46ed9aaf8f31 --- /dev/null +++ b/OvmfPkg/PlatformPei/MemTypeInfo.c @@ -0,0 +1,151 @@ +/**@file + Produce a default memory type information HOB unless we can determine, f= rom + the existence of the "MemoryTypeInformation" variable, that the DXE IPL = PEIM + will produce the HOB. + + Copyright (C) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#include +#include +#include +#include +#include +#include +#include + +#include "Platform.h" + +STATIC EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] =3D { + { EfiACPIMemoryNVS, 0x004 }, + { EfiACPIReclaimMemory, 0x008 }, + { EfiReservedMemoryType, 0x004 }, + { EfiRuntimeServicesData, 0x024 }, + { EfiRuntimeServicesCode, 0x030 }, + { EfiBootServicesCode, 0x180 }, + { EfiBootServicesData, 0xF00 }, + { EfiMaxMemoryType, 0x000 } +}; + +STATIC +VOID +BuildMemTypeInfoHob ( + VOID + ) +{ + BuildGuidDataHob ( + &gEfiMemoryTypeInformationGuid, + mDefaultMemoryTypeInformation, + sizeof mDefaultMemoryTypeInformation + ); + DEBUG (( + DEBUG_INFO, + "%a: default memory type information HOB built\n", + __FUNCTION__ + )); +} + +/** + Notification function called when EFI_PEI_READ_ONLY_VARIABLE2_PPI becomes + available. + + @param[in] PeiServices Indirect reference to the PEI Services Table. + @param[in] NotifyDescriptor Address of the notification descriptor data + structure. + @param[in] Ppi Address of the PPI that was installed. + + @return Status of the notification. The status code returned from this + function is ignored. +**/ +STATIC +EFI_STATUS +EFIAPI +OnReadOnlyVariable2Available ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, + IN VOID *Ppi + ) +{ + EFI_PEI_READ_ONLY_VARIABLE2_PPI *ReadOnlyVariable2; + UINTN DataSize; + EFI_STATUS Status; + + DEBUG ((DEBUG_VERBOSE, "%a: %a\n", gEfiCallerBaseName, __FUNCTION__)); + + // + // Check if the "MemoryTypeInformation" variable exists, in the + // gEfiMemoryTypeInformationGuid namespace. + // + ReadOnlyVariable2 =3D Ppi; + DataSize =3D 0; + Status =3D ReadOnlyVariable2->GetVariable ( + ReadOnlyVariable2, + EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME, + &gEfiMemoryTypeInformationGuid, + NULL, + &DataSize, + NULL + ); + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + // + // The variable exists; the DXE IPL PEIM will build the HOB from it. + // + return EFI_SUCCESS; + } + // + // Install the default memory type information HOB. + // + BuildMemTypeInfoHob (); + return EFI_SUCCESS; +} + +// +// Notification object for registering the callback, for when +// EFI_PEI_READ_ONLY_VARIABLE2_PPI becomes available. +// +STATIC CONST EFI_PEI_NOTIFY_DESCRIPTOR mReadOnlyVariable2Notify =3D { + (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH | + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), // Flags + &gEfiPeiReadOnlyVariable2PpiGuid, // Guid + OnReadOnlyVariable2Available // Notify +}; + +VOID +MemTypeInfoInitialization ( + VOID + ) +{ + EFI_STATUS Status; + + if (!FeaturePcdGet (PcdSmmSmramRequire) && + FeaturePcdGet (PcdMemVarstoreEmuEnable)) { + // + // EFI_PEI_READ_ONLY_VARIABLE2_PPI will never be available; install + // the default memory type information HOB right away. + // + BuildMemTypeInfoHob (); + return; + } + + Status =3D PeiServicesNotifyPpi (&mReadOnlyVariable2Notify); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: failed to set up R/O Variable 2 callback: %r\n", + __FUNCTION__, + Status + )); + // + // Install the default HOB as a last resort. + // + BuildMemTypeInfoHob (); + } +} diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index ec449b422eda..11a7a05fb1d7 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -42,18 +41,6 @@ #include "Platform.h" #include "Cmos.h" =20 -EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] =3D { - { EfiACPIMemoryNVS, 0x004 }, - { EfiACPIReclaimMemory, 0x008 }, - { EfiReservedMemoryType, 0x004 }, - { EfiRuntimeServicesData, 0x024 }, - { EfiRuntimeServicesCode, 0x030 }, - { EfiBootServicesCode, 0x180 }, - { EfiBootServicesData, 0xF00 }, - { EfiMaxMemoryType, 0x000 } -}; - - EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] =3D { { EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, @@ -166,15 +153,6 @@ MemMapInitialization ( PciIoSize =3D 0x4000; =20 // - // Create Memory Type Information HOB - // - BuildGuidDataHob ( - &gEfiMemoryTypeInformationGuid, - mDefaultMemoryTypeInformation, - sizeof(mDefaultMemoryTypeInformation) - ); - - // // Video memory + Legacy BIOS region // AddIoMemoryRangeHob (0x0A0000, BASE_1MB); @@ -666,6 +644,7 @@ InitializePlatform ( ReserveEmuVariableNvStore (); } PeiFvInitialization (); + MemTypeInfoInitialization (); MemMapInitialization (); NoexecDxeInitialization (); } --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 19 00:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1489534412427225.97653757104592; Tue, 14 Mar 2017 16:33:32 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7151880405; Tue, 14 Mar 2017 16:33:15 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 419BA803FF for ; Tue, 14 Mar 2017 16:33:12 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D1B3EC05AA61; Tue, 14 Mar 2017 23:33:12 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2ENWpwi006449; Tue, 14 Mar 2017 19:33:11 -0400 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 15 Mar 2017 00:32:46 +0100 Message-Id: <20170314233246.17864-15-lersek@redhat.com> In-Reply-To: <20170314233246.17864-1-lersek@redhat.com> References: <20170314233246.17864-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 14 Mar 2017 23:33:12 +0000 (UTC) Subject: [edk2] [PATCH 14/14] OvmfPkg/README: document MEM_VARSTORE_EMU_ENABLE and memmap defrag X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/README | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OvmfPkg/README b/OvmfPkg/README index 304e69fbe545..79b6eb6255c3 100644 --- a/OvmfPkg/README +++ b/OvmfPkg/README @@ -68,13 +68,21 @@ https://github.com/tianocore/tianocore.github.io/wiki/H= ow%20to%20build%20OVMF * Run qemu with: -pflash path/to/OVMF.fd * Note that this option is required for running SecureBoot-enabled bui= lds (-D SECURE_BOOT_ENABLE). + * When a commitment to this option (i.e., -pflash) can be made, it is + recommended to build OVMF with -D MEM_VARSTORE_EMU_ENABLE=3DFALSE. S= aid + build setting enables UEFI memory map defragmentation across boots o= f the + virtual machine. - Option 2: Use QEMU -bios parameter * Note that UEFI variables will be partially emulated, and non-volatile variables may lose their contents after a reboot + * The build option -D MEM_VARSTORE_EMU_ENABLE=3DFALSE is incompatible = with + the QEMU -bios option. * Run qemu with: -bios path/to/OVMF.fd - Option 3: Use QEMU -L parameter * Note that UEFI variables will be partially emulated, and non-volatile variables may lose their contents after a reboot + * The build option -D MEM_VARSTORE_EMU_ENABLE=3DFALSE is incompatible = with + the QEMU -L option. * Either copy, rename or symlink OVMF.fd =3D> bios.bin * Use the QEMU -L parameter to specify the directory where the bios.bin file is located. @@ -139,6 +147,8 @@ during boot (even in RELEASE builds). Both the naming o= f the flag (SMM_REQUIRE, instead of SMM_ENABLE), and this behavior are consistent with the goal described above: this is supposed to be a security feature, and fallbacks = are not allowed. Similarly, a pflash-backed variable store is a requirement. +(Accordingly, SMM_REQUIRE automatically enables all benefits of +MEM_VARSTORE_EMU_ENABLE=3DFALSE). =20 QEMU should be started with the options listed below (in addition to any o= ther guest-specific flags). The command line should be gradually composed from = the --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel