From nobody Tue Feb 10 12:58:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+94338+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+94338+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1664180743; cv=none; d=zohomail.com; s=zohoarc; b=LSvzI7DQA+PcIhIWKn98oYPFEPEjHhgLz4lu6UzjTHAJYTL54vTihBKTKGQOLdxCekoZWnJQSIsNUfcNByXRP5dTaDsr25s6PX912727Kszy5OVH5CKUU6AVWSrx6WVb8YsI2wDReRmiy7AIFDiyC7tJx9SblL7cf7xnZuYpguA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664180743; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=JFSm/jQvhcV/4F2plGYF7a26cwiJPUBB5X95WlEyc0M=; b=ggC5U1y+Ns3qqcPndCZ7dTAOlCnQ6xDLr/+dhPLgbEsZ1zKACLhZOJ6fclijmh4ZA23cXVnvn7I9DPmpBAkdriTQgUMvoYTn4xknLA0PFmUsA1rocjMwleaAY0rWL78QgECzGWfaLNKdSGQ0AIVCZWbiqTlTVcHgN8uJEzMRX0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+94338+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1664180743716752.9781882784944; Mon, 26 Sep 2022 01:25:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id nAQsYY1788612xVUvrFsEVen; Mon, 26 Sep 2022 01:25:43 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web09.26238.1664180742307786920 for ; Mon, 26 Sep 2022 01:25:42 -0700 X-Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 70E2E6190B; Mon, 26 Sep 2022 08:25:41 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7155C43141; Mon, 26 Sep 2022 08:25:39 +0000 (UTC) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Alexander Graf Subject: [edk2-devel] [PATCH v3 16/16] ArmVirtPkg/ArmVirtQemu: omit PCD PEIM unless TPM support is enabled Date: Mon, 26 Sep 2022 10:25:11 +0200 Message-Id: <20220926082511.2110797-17-ardb@kernel.org> In-Reply-To: <20220926082511.2110797-1-ardb@kernel.org> References: <20220926082511.2110797-1-ardb@kernel.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ardb@kernel.org X-Gm-Message-State: MPWnHW2T9SF7vKppFU97YYffx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1664180743; bh=Bz0509mP+/EhhBX/EJxdNGIJZPHCko/y0og2HZF7HoE=; h=Cc:Date:From:Reply-To:Subject:To; b=blwEHomsbWjKP0/mRQE7XauwrypOluMb6dmv3j/ZEa1eDkRF1rs2QxdurZdjKowyk05 UZevRFT+35q3xnQybNMLhSRDonacy1JaFZ+C/aqByDQImBNwnj8cG2BaNS6YpLhphJye7 V4so/q9oT/EabtQtySoDw3PucOdTT82tDWE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1664180744410100029 Content-Type: text/plain; charset="utf-8" The TPM discovery code relies on a dynamic PCD to communicate the TPM base address to other components. But no other code relies on dynamic PCDs in the PEI phase so let's drop the PCD PEIM when TPM support is not enabled. Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtQemu.dsc | 22 +++++++++++++++----- ArmVirtPkg/ArmVirtQemu.fdf | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 43e19f605084..842a298e0435 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -287,10 +287,15 @@ [PcdsDynamicDefault.common] # # TPM2 support # - gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0 !if $(TPM2_ENABLE) =3D=3D TRUE + gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0 gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00= , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} gEfiSecurityPkgTokenSpaceGuid.PcdTpm2HashMask|0 +!else +[PcdsPatchableInModule] + # make this PCD patchable instead of dynamic when TPM support is not ena= bled + # this permits setting the PCD in unreachable code without pulling in dy= namic PCD support + gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0 !endif =20 [PcdsDynamicHii] @@ -303,6 +308,13 @@ [PcdsDynamicHii] =20 gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVar= iableGuid|0x0|5 =20 +[LibraryClasses.common.PEI_CORE, LibraryClasses.common.PEIM] +!if $(TPM2_ENABLE) =3D=3D TRUE + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf +!else + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf +!endif + ##########################################################################= ###### # # Components Section - list of all EDK II Modules needed by this Platform @@ -314,10 +326,6 @@ [Components.common] # ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf MdeModulePkg/Core/Pei/PeiMain.inf - MdeModulePkg/Universal/PCD/Pei/Pcd.inf { - - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - } ArmPlatformPkg/PlatformPei/PlatformPeim.inf ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf { @@ -328,6 +336,10 @@ [Components.common] ArmPkg/Drivers/CpuPei/CpuPei.inf =20 !if $(TPM2_ENABLE) =3D=3D TRUE + MdeModulePkg/Universal/PCD/Pei/Pcd.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + } MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf { ResetSystemLib|ArmVirtPkg/Library/ArmVirtPsciResetSystemPeiLib/ArmVi= rtPsciResetSystemPeiLib.inf diff --git a/ArmVirtPkg/ArmVirtQemu.fdf b/ArmVirtPkg/ArmVirtQemu.fdf index c85e36b185d3..764f652afd0e 100644 --- a/ArmVirtPkg/ArmVirtQemu.fdf +++ b/ArmVirtPkg/ArmVirtQemu.fdf @@ -109,10 +109,10 @@ [FV.FVMAIN_COMPACT] INF ArmPlatformPkg/PlatformPei/PlatformPeim.inf INF ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf INF ArmPkg/Drivers/CpuPei/CpuPei.inf - INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 !if $(TPM2_ENABLE) =3D=3D TRUE + INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf INF MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf --=20 2.35.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#94338): https://edk2.groups.io/g/devel/message/94338 Mute This Topic: https://groups.io/mt/93922705/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-