From nobody Sat Nov 2 14:33:54 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