From nobody Fri Apr 26 21:36:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54358+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54358+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581599713713152.54291809279016; Thu, 13 Feb 2020 05:15:13 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id tFQrYY1788612x2mUlExxSUI; Thu, 13 Feb 2020 05:15:12 -0800 X-Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.6025.1581599557450100985 for ; Thu, 13 Feb 2020 05:12:37 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-227-7l8u3H0mPQOi2p-WU5h9Tg-1; Thu, 13 Feb 2020 08:12:33 -0500 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA508107ACC5; Thu, 13 Feb 2020 13:12:31 +0000 (UTC) X-Received: from localhost (ovpn-112-66.ams2.redhat.com [10.36.112.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6121D5C1C3; Thu, 13 Feb 2020 13:12:28 +0000 (UTC) From: marcandre.lureau@redhat.com To: edk2-devel@lists.01.org, devel@edk2.groups.io Cc: stefanb@linux.ibm.com, lersek@redhat.com, simon.hardy@itdev.co.uk, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [edk2-devel] [PATCH v2 1/3] Ovmf: rename TPM2 config prefix to TPM Date: Thu, 13 Feb 2020 14:12:20 +0100 Message-Id: <20200213131222.157700-2-marcandre.lureau@redhat.com> In-Reply-To: <20200213131222.157700-1-marcandre.lureau@redhat.com> References: <20200213131222.157700-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 7l8u3H0mPQOi2p-WU5h9Tg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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,marcandre.lureau@redhat.com X-Gm-Message-State: mHt2P0RrFacr6RTx1XukxyUsx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581599712; bh=5oGOhwPSY7dqco35METTye5t4Yu3kQYrCsvge1N+PXM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=SRb1zUEo4HZw4n09BB7Vv2VEakPJMyS4jxkbNroFwqBCMPG0Ec0az+n/b7ms/qk5pMB c7ArlrXkBirxGT3PoEh3sAMl7ODRWfotvgLWezZ04Mldu0d73JE7tR8z/jlVbCcEXmMr7 iQHbZ+jouf8NomPvYuMuLkaIaGDLcHWrHpg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau A following patch is going to use the same configuration for TPM1.2 and TPM2.0, and it's simpler to support both than variable configurations. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 24 ++++++++++++------------ OvmfPkg/OvmfPkgIa32.fdf | 8 ++++---- OvmfPkg/OvmfPkgIa32X64.dsc | 24 ++++++++++++------------ OvmfPkg/OvmfPkgIa32X64.fdf | 8 ++++---- OvmfPkg/OvmfPkgX64.dsc | 24 ++++++++++++------------ OvmfPkg/OvmfPkgX64.fdf | 8 ++++---- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 19728f20b34e..38b013ad9543 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -31,8 +31,8 @@ DEFINE SECURE_BOOT_ENABLE =3D FALSE DEFINE SMM_REQUIRE =3D FALSE DEFINE SOURCE_DEBUG_ENABLE =3D FALSE - DEFINE TPM2_ENABLE =3D FALSE - DEFINE TPM2_CONFIG_ENABLE =3D FALSE + DEFINE TPM_ENABLE =3D FALSE + DEFINE TPM_CONFIG_ENABLE =3D FALSE =20 # # Network definition @@ -205,7 +205,7 @@ XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -279,7 +279,7 @@ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf !endif @@ -360,7 +360,7 @@ PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf !endif =20 @@ -575,12 +575,12 @@ =20 gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00 =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00= , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} !endif =20 [PcdsDynamicHii] -!if $(TPM2_ENABLE) =3D=3D TRUE && $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE && $(TPM_CONFIG_ENABLE) =3D=3D TRUE gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_= VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev|L"TCG2_VERSION"|gTcg2C= onfigFormSetGuid|0x8|3|NV,BS !endif @@ -631,7 +631,7 @@ !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf { @@ -667,7 +667,7 @@ !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificatio= nLib.inf !endif -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib= .inf !endif } @@ -910,9 +910,9 @@ !endif =20 # - # TPM2 support + # TPM support # -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf { Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibR= outerDxe.inf @@ -924,7 +924,7 @@ NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512= .inf NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf } -!if $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf !endif !endif diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index 63607551ed75..2c7d6cccdfb0 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -159,7 +159,7 @@ INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf !endif @@ -344,11 +344,11 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/Varia= bleRuntimeDxe.inf !endif =20 # -# TPM2 support +# TPM support # -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf -!if $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf !endif !endif diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 3c0c229e3a72..e075f0766935 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -31,8 +31,8 @@ DEFINE SECURE_BOOT_ENABLE =3D FALSE DEFINE SMM_REQUIRE =3D FALSE DEFINE SOURCE_DEBUG_ENABLE =3D FALSE - DEFINE TPM2_ENABLE =3D FALSE - DEFINE TPM2_CONFIG_ENABLE =3D FALSE + DEFINE TPM_ENABLE =3D FALSE + DEFINE TPM_CONFIG_ENABLE =3D FALSE =20 # # Network definition @@ -210,7 +210,7 @@ XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -284,7 +284,7 @@ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf !endif @@ -365,7 +365,7 @@ PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf !endif =20 @@ -587,12 +587,12 @@ =20 gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00 =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00= , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} !endif =20 [PcdsDynamicHii] -!if $(TPM2_ENABLE) =3D=3D TRUE && $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE && $(TPM_CONFIG_ENABLE) =3D=3D TRUE gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_= VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev|L"TCG2_VERSION"|gTcg2C= onfigFormSetGuid|0x8|3|NV,BS !endif @@ -643,7 +643,7 @@ !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf { @@ -680,7 +680,7 @@ !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificatio= nLib.inf !endif -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib= .inf !endif } @@ -924,9 +924,9 @@ !endif =20 # - # TPM2 support + # TPM support # -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf { Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibR= outerDxe.inf @@ -938,7 +938,7 @@ NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512= .inf NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf } -!if $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf !endif !endif diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 0488e5d95ffe..6a4c9089ab58 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -159,7 +159,7 @@ INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf !endif @@ -351,11 +351,11 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/Varia= bleRuntimeDxe.inf !endif =20 # -# TPM2 support +# TPM support # -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf -!if $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf !endif !endif diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index f6c1d8d228c6..3b1ebf123b51 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -31,8 +31,8 @@ DEFINE SECURE_BOOT_ENABLE =3D FALSE DEFINE SMM_REQUIRE =3D FALSE DEFINE SOURCE_DEBUG_ENABLE =3D FALSE - DEFINE TPM2_ENABLE =3D FALSE - DEFINE TPM2_CONFIG_ENABLE =3D FALSE + DEFINE TPM_ENABLE =3D FALSE + DEFINE TPM_CONFIG_ENABLE =3D FALSE =20 # # Network definition @@ -210,7 +210,7 @@ XenHypercallLib|OvmfPkg/Library/XenHypercallLib/XenHypercallLib.inf XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -284,7 +284,7 @@ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf !endif @@ -365,7 +365,7 @@ PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf !endif =20 @@ -586,12 +586,12 @@ =20 gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00 =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00= , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} !endif =20 [PcdsDynamicHii] -!if $(TPM2_ENABLE) =3D=3D TRUE && $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE && $(TPM_CONFIG_ENABLE) =3D=3D TRUE gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_= VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableRev|L"TCG2_VERSION"|gTcg2C= onfigFormSetGuid|0x8|3|NV,BS !endif @@ -642,7 +642,7 @@ !endif UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf { @@ -678,7 +678,7 @@ !if $(SECURE_BOOT_ENABLE) =3D=3D TRUE NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificatio= nLib.inf !endif -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib= .inf !endif } @@ -922,9 +922,9 @@ !endif =20 # - # TPM2 support + # TPM support # -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf { Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibRouter/Tpm2DeviceLibR= outerDxe.inf @@ -936,7 +936,7 @@ NULL|SecurityPkg/Library/HashInstanceLibSha512/HashInstanceLibSha512= .inf NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf } -!if $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf !endif !endif diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 0488e5d95ffe..6a4c9089ab58 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -159,7 +159,7 @@ INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf !endif @@ -351,11 +351,11 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/Varia= bleRuntimeDxe.inf !endif =20 # -# TPM2 support +# TPM support # -!if $(TPM2_ENABLE) =3D=3D TRUE +!if $(TPM_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf -!if $(TPM2_CONFIG_ENABLE) =3D=3D TRUE +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf !endif !endif --=20 2.25.0.rc2.1.g09a9a1a997 -=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 (#54358): https://edk2.groups.io/g/devel/message/54358 Mute This Topic: https://groups.io/mt/71240873/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 21:36:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54359+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54359+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581599714354110.58549220381713; Thu, 13 Feb 2020 05:15:14 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Xpe3YY1788612xwTCoZ5M5ta; Thu, 13 Feb 2020 05:15:12 -0800 X-Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web11.5995.1581599560694474269 for ; Thu, 13 Feb 2020 05:12:40 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-321-4qrIR0XjNGOgfTw-PbyLcg-1; Thu, 13 Feb 2020 08:12:37 -0500 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C22513FA; Thu, 13 Feb 2020 13:12:36 +0000 (UTC) X-Received: from localhost (ovpn-112-66.ams2.redhat.com [10.36.112.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 319051001B07; Thu, 13 Feb 2020 13:12:32 +0000 (UTC) From: marcandre.lureau@redhat.com To: edk2-devel@lists.01.org, devel@edk2.groups.io Cc: stefanb@linux.ibm.com, lersek@redhat.com, simon.hardy@itdev.co.uk, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [edk2-devel] [PATCH v2 2/3] SecurityPkg: export Tpm12GetPtpInterfaceType() Date: Thu, 13 Feb 2020 14:12:21 +0100 Message-Id: <20200213131222.157700-3-marcandre.lureau@redhat.com> In-Reply-To: <20200213131222.157700-1-marcandre.lureau@redhat.com> References: <20200213131222.157700-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 4qrIR0XjNGOgfTw-PbyLcg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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,marcandre.lureau@redhat.com X-Gm-Message-State: r8L8u7GHVyD0cgOinBWtxYV9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581599712; bh=Ie9YQ3+zgg5bLovNHbXAXwtzgArESZEV5JUKB4646ws=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=XFDIbMFXVMr1+93FQNh4YXsQAcTLA6A1SNlFxuQ+OuXS4HGjwd/b3z9WTDqm0I1Q+lI OX5b34CSFDYfmYYYkGEKJ8RGQQ+CwQ1cyG5HdtHQ3lqgk3r5qMOWASV1iGJOlVX6W/Mb1 boWBDg2BDJzj1ZoCASsyUIT1VuGIGOG0SKE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- SecurityPkg/Include/Library/Tpm12DeviceLib.h | 13 +++++++++++++ .../Library/Tpm12DeviceLibDTpm/Tpm12Tis.c | 17 ++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/SecurityPkg/Include/Library/Tpm12DeviceLib.h b/SecurityPkg/Inc= lude/Library/Tpm12DeviceLib.h index eac7885ca3d8..bcdfbdac76b5 100644 --- a/SecurityPkg/Include/Library/Tpm12DeviceLib.h +++ b/SecurityPkg/Include/Library/Tpm12DeviceLib.h @@ -11,6 +11,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #include =20 +typedef enum { + PtpInterfaceTis, + PtpInterfaceFifo, + PtpInterfaceCrb, + PtpInterfaceMax, +} PTP_INTERFACE_TYPE; + /** This service enables the sending of commands to the TPM12. =20 @@ -45,4 +52,10 @@ Tpm12RequestUseTpm ( VOID ); =20 +EFIAPI +PTP_INTERFACE_TYPE +Tpm12GetPtpInterfaceType ( + VOID + ); + #endif diff --git a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c b/SecurityPk= g/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c index 1caa076203ba..381915130b7f 100644 --- a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c +++ b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c @@ -15,18 +15,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include =20 #include #include =20 -typedef enum { - PtpInterfaceTis, - PtpInterfaceFifo, - PtpInterfaceCrb, - PtpInterfaceMax, -} PTP_INTERFACE_TYPE; - // // Max TPM command/reponse length // @@ -542,3 +536,12 @@ Tpm12RequestUseTpm ( return EFI_NOT_FOUND; } } + +EFIAPI +PTP_INTERFACE_TYPE +Tpm12GetPtpInterfaceType ( + VOID + ) +{ + return Tpm12GetPtpInterface ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddres= s)); +} --=20 2.25.0.rc2.1.g09a9a1a997 -=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 (#54359): https://edk2.groups.io/g/devel/message/54359 Mute This Topic: https://groups.io/mt/71240874/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 26 21:36:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54360+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54360+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1581599713229848.8220761417256; Thu, 13 Feb 2020 05:15:13 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id fPuJYY1788612xEDiR1d3nit; Thu, 13 Feb 2020 05:15:12 -0800 X-Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web11.6000.1581599565676137978 for ; Thu, 13 Feb 2020 05:12:45 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-j-EmUaUfPc-5Qb2gtVqfrA-1; Thu, 13 Feb 2020 08:12:42 -0500 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D17E13E5; Thu, 13 Feb 2020 13:12:41 +0000 (UTC) X-Received: from localhost (ovpn-112-66.ams2.redhat.com [10.36.112.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACCA75C101; Thu, 13 Feb 2020 13:12:37 +0000 (UTC) From: marcandre.lureau@redhat.com To: edk2-devel@lists.01.org, devel@edk2.groups.io Cc: stefanb@linux.ibm.com, lersek@redhat.com, simon.hardy@itdev.co.uk, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [edk2-devel] [PATCH v2 3/3] Ovmf: enable TPM 1.2 support Date: Thu, 13 Feb 2020 14:12:22 +0100 Message-Id: <20200213131222.157700-4-marcandre.lureau@redhat.com> In-Reply-To: <20200213131222.157700-1-marcandre.lureau@redhat.com> References: <20200213131222.157700-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: j-EmUaUfPc-5Qb2gtVqfrA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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,marcandre.lureau@redhat.com X-Gm-Message-State: nY4n9VAd9F5wYeBjN1IAFbXcx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1581599712; bh=EDuM4U+nsTkYhFI883Qcn3G4rcT2Pj7Ohkir6o0b6gM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=IJwprQeglFE6CgcuFAll79FjqOuVUPCtXk6aoE8XJDNEQluPz+bCdhQFGuLEqdE9hHi z0V0cvrtcT3y7jfiXTVgPIFCA88RHcvcyMetrGxzEcxVqxprRFSScnsKtj3baH4tD1ShW XX1cjC/43IQkMhqZDNpMb2tRu9PnamGxrXM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Enable TcgPei & TcgDxe modules to initialize a TPM 1.2 device and measure boot environment. Tpm12RequestUseTpm() returns success on any TPM interface, including FIFO & CRB which are TPM 2.0. Check the actual interface with Tpm12GetPtpInterfaceType(), and only detect 1.2 if it's a TIS. Signed-off-by: Marc-Andr=C3=A9 Lureau --- OvmfPkg/OvmfPkgIa32.dsc | 15 +++++++++++++++ OvmfPkg/OvmfPkgIa32.fdf | 2 ++ OvmfPkg/OvmfPkgIa32X64.dsc | 15 +++++++++++++++ OvmfPkg/OvmfPkgIa32X64.fdf | 2 ++ OvmfPkg/OvmfPkgX64.dsc | 15 +++++++++++++++ OvmfPkg/OvmfPkgX64.fdf | 2 ++ OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 3 +++ OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c | 17 ++++++++++++++++- 8 files changed, 70 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 38b013ad9543..02300886563e 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -206,6 +206,7 @@ XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE + Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -281,6 +282,7 @@ =20 !if $(TPM_ENABLE) =3D=3D TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm= .inf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf !endif =20 @@ -361,6 +363,7 @@ MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf !if $(TPM_ENABLE) =3D=3D TRUE + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.i= nf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf !endif =20 @@ -633,6 +636,7 @@ =20 !if $(TPM_ENABLE) =3D=3D TRUE OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf + SecurityPkg/Tcg/TcgPei/TcgPei.inf SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf { HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCrypt= oRouterPei.inf @@ -668,6 +672,7 @@ NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificatio= nLib.inf !endif !if $(TPM_ENABLE) =3D=3D TRUE + NULL|SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.i= nf NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib= .inf !endif } @@ -926,5 +931,15 @@ } !if $(TPM_CONFIG_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf +!endif + SecurityPkg/Tcg/TcgDxe/TcgDxe.inf { + + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLib= DTpm.inf + } +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE + SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf { + + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + } !endif !endif diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index 2c7d6cccdfb0..b0ddc5a4ae73 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -161,6 +161,7 @@ INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf +INF SecurityPkg/Tcg/TcgPei/TcgPei.inf INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf !endif =20 @@ -347,6 +348,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/Variabl= eRuntimeDxe.inf # TPM support # !if $(TPM_ENABLE) =3D=3D TRUE +INF SecurityPkg/Tcg/TcgDxe/TcgDxe.inf INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf !if $(TPM_CONFIG_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index e075f0766935..3adc75223d05 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -211,6 +211,7 @@ XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE + Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -286,6 +287,7 @@ =20 !if $(TPM_ENABLE) =3D=3D TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm= .inf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf !endif =20 @@ -366,6 +368,7 @@ MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf !if $(TPM_ENABLE) =3D=3D TRUE + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.i= nf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf !endif =20 @@ -645,6 +648,7 @@ =20 !if $(TPM_ENABLE) =3D=3D TRUE OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf + SecurityPkg/Tcg/TcgPei/TcgPei.inf SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf { HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCrypt= oRouterPei.inf @@ -681,6 +685,7 @@ NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificatio= nLib.inf !endif !if $(TPM_ENABLE) =3D=3D TRUE + NULL|SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.i= nf NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib= .inf !endif } @@ -940,5 +945,15 @@ } !if $(TPM_CONFIG_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf +!endif + SecurityPkg/Tcg/TcgDxe/TcgDxe.inf { + + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLib= DTpm.inf + } +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE + SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf { + + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + } !endif !endif diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 6a4c9089ab58..dffbfaa5fc4f 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -161,6 +161,7 @@ INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf +INF SecurityPkg/Tcg/TcgPei/TcgPei.inf INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf !endif =20 @@ -354,6 +355,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/Variabl= eRuntimeDxe.inf # TPM support # !if $(TPM_ENABLE) =3D=3D TRUE +INF SecurityPkg/Tcg/TcgDxe/TcgDxe.inf INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf !if $(TPM_CONFIG_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 3b1ebf123b51..5f3740ae890a 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -211,6 +211,7 @@ XenPlatformLib|OvmfPkg/Library/XenPlatformLib/XenPlatformLib.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE + Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeT= cg2PhysicalPresenceLib.inf Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibN= ull.inf @@ -286,6 +287,7 @@ =20 !if $(TPM_ENABLE) =3D=3D TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm= .inf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf !endif =20 @@ -366,6 +368,7 @@ MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf !if $(TPM_ENABLE) =3D=3D TRUE + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.i= nf Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf !endif =20 @@ -644,6 +647,7 @@ =20 !if $(TPM_ENABLE) =3D=3D TRUE OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf + SecurityPkg/Tcg/TcgPei/TcgPei.inf SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf { HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCrypt= oRouterPei.inf @@ -679,6 +683,7 @@ NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificatio= nLib.inf !endif !if $(TPM_ENABLE) =3D=3D TRUE + NULL|SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.i= nf NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib= .inf !endif } @@ -938,5 +943,15 @@ } !if $(TPM_CONFIG_ENABLE) =3D=3D TRUE SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf +!endif + SecurityPkg/Tcg/TcgDxe/TcgDxe.inf { + + Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLib= DTpm.inf + } +!if $(TPM_CONFIG_ENABLE) =3D=3D TRUE + SecurityPkg/Tcg/TcgConfigDxe/TcgConfigDxe.inf { + + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + } !endif !endif diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 6a4c9089ab58..dffbfaa5fc4f 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -161,6 +161,7 @@ INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf =20 !if $(TPM_ENABLE) =3D=3D TRUE INF OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf +INF SecurityPkg/Tcg/TcgPei/TcgPei.inf INF SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf !endif =20 @@ -354,6 +355,7 @@ INF MdeModulePkg/Universal/Variable/RuntimeDxe/Variabl= eRuntimeDxe.inf # TPM support # !if $(TPM_ENABLE) =3D=3D TRUE +INF SecurityPkg/Tcg/TcgDxe/TcgDxe.inf INF SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf !if $(TPM_CONFIG_ENABLE) =3D=3D TRUE INF SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Con= fig/Tcg2ConfigPei.inf index e34cd6210611..15f9b7cda099 100644 --- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf +++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf @@ -31,17 +31,20 @@ PeimEntryPoint DebugLib PeiServicesLib + Tpm12DeviceLib Tpm2DeviceLib =20 [Guids] gEfiTpmDeviceSelectedGuid ## PRODUCES ## GUID # Used as a PPI = GUID gEfiTpmDeviceInstanceTpm20DtpmGuid ## SOMETIMES_CONSUMES + gEfiTpmDeviceInstanceTpm12Guid ## SOMETIMES_CONSUMES =20 [Ppis] gPeiTpmInitializationDonePpiGuid ## SOMETIMES_PRODUCES =20 [Pcd] gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid ## PROD= UCES + gEfiSecurityPkgTokenSpaceGuid.PcdActiveTpmInterfaceType ## SOME= TIMES_CONSUMES =20 [Depex] TRUE diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c b/OvmfPkg/Tcg/Tcg2Conf= ig/Tcg2ConfigPeim.c index 99d571d9fa6d..ae3d4fc2c380 100644 --- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c +++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c @@ -18,6 +18,7 @@ #include #include #include +#include #include =20 STATIC CONST EFI_PEI_PPI_DESCRIPTOR mTpmSelectedPpi =3D { @@ -50,6 +51,19 @@ Tcg2ConfigPeimEntryPoint ( =20 DEBUG ((DEBUG_INFO, "%a\n", __FUNCTION__)); =20 + Status =3D Tpm12RequestUseTpm (); + if (!EFI_ERROR (Status) && Tpm12GetPtpInterfaceType () =3D=3D PtpInterfa= ceTis) { + DEBUG ((DEBUG_INFO, "%a: TPM1.2 detected\n", __FUNCTION__)); + Size =3D sizeof (gEfiTpmDeviceInstanceTpm12Guid); + Status =3D PcdSetPtrS ( + PcdTpmInstanceGuid, + &Size, + &gEfiTpmDeviceInstanceTpm12Guid + ); + ASSERT_EFI_ERROR (Status); + goto done; + } + Status =3D Tpm2RequestUseTpm (); if (!EFI_ERROR (Status)) { DEBUG ((DEBUG_INFO, "%a: TPM2 detected\n", __FUNCTION__)); @@ -61,7 +75,7 @@ Tcg2ConfigPeimEntryPoint ( ); ASSERT_EFI_ERROR (Status); } else { - DEBUG ((DEBUG_INFO, "%a: no TPM2 detected\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: no TPM detected\n", __FUNCTION__)); // // If no TPM2 was detected, we still need to install // TpmInitializationDonePpi. Namely, Tcg2Pei will exit early upon seei= ng @@ -73,6 +87,7 @@ Tcg2ConfigPeimEntryPoint ( ASSERT_EFI_ERROR (Status); } =20 +done: // // Selection done // --=20 2.25.0.rc2.1.g09a9a1a997 -=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 (#54360): https://edk2.groups.io/g/devel/message/54360 Mute This Topic: https://groups.io/mt/71240875/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-