From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web08.439.1623081930953881743 for ; Mon, 07 Jun 2021 09:05:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=Zj1y0zIj; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 8F75F20B83EA; Mon, 7 Jun 2021 09:05:30 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8F75F20B83EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1623081930; bh=Ep4L8YR8yCxAHhDc6L7swQ+KhxCiOoPNBBRRoPOE4pE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zj1y0zIjlEkiMaOIEEGN/IhHhbSNDny1E0o8BwoRBa5UB06SA/UiXIBUNQlFRt7/m 5e2XBpgd+/YjzPYORI3YKRPj8Sg/uN8r1P7gf69a9Fji0vYZNUG0W2pDLdB68Ljjbj wmZqxjOllvF3ufd4rTLXkBN+eiCA76++n3c8Dknw= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-platforms][PATCH v2 2/4] MinPlatformPkg/TpmPlatformHierarchyLib: Add PEI support Date: Mon, 7 Jun 2021 12:05:04 -0400 Message-Id: <20210607160506.2411-3-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20210607160506.2411-1-mikuback@linux.microsoft.com> References: <20210607160506.2411-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki Expands the TpmPlatformHierarchyLib instance in MinPlatformPkg to support PEIM in addition to DXE_DRIVER. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/Tcg/Library/{TpmPlatformHierarchyLib/TpmPl= atformHierarchyLib.c =3D> PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatform= HierarchyLib.c} | 9 +++------ Platform/Intel/MinPlatformPkg/Include/Library/TpmPlatformHierarchyLib.h = = | 4 +--- Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc = = | 4 ++-- Platform/Intel/MinPlatformPkg/Tcg/Library/{TpmPlatformHierarchyLib/TpmPl= atformHierarchyLib.inf =3D> PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatfo= rmHierarchyLib.inf} | 20 +++++++------------- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Tcg/Library/TpmPlatformHierarc= hyLib/TpmPlatformHierarchyLib.c b/Platform/Intel/MinPlatformPkg/Tcg/Libra= ry/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c similarity index 93% rename from Platform/Intel/MinPlatformPkg/Tcg/Library/TpmPlatformHierarch= yLib/TpmPlatformHierarchyLib.c rename to Platform/Intel/MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHier= archyLib/PeiDxeTpmPlatformHierarchyLib.c index 41ddb26f4046..fa590089f0a0 100644 --- a/Platform/Intel/MinPlatformPkg/Tcg/Library/TpmPlatformHierarchyLib/T= pmPlatformHierarchyLib.c +++ b/Platform/Intel/MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHierarch= yLib/PeiDxeTpmPlatformHierarchyLib.c @@ -12,16 +12,13 @@ https://trustedcomputinggroup.org/resource/tcg-tpm-v2-0-provisioning= -guidance/ **/ =20 -#include +#include =20 -#include #include -#include +#include #include -#include #include -#include -#include +#include =20 // // The authorization value may be no larger than the digest produced by = the hash diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/TpmPlatformHie= rarchyLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/TpmPlatformHi= erarchyLib.h index ed9709b24a73..a872fa09dc6a 100644 --- a/Platform/Intel/MinPlatformPkg/Include/Library/TpmPlatformHierarchyL= ib.h +++ b/Platform/Intel/MinPlatformPkg/Include/Library/TpmPlatformHierarchyL= ib.h @@ -6,6 +6,7 @@ Policy (platformPolicy) can be defined through this function. =20 Copyright (c) 2019, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -13,9 +14,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef _TPM_PLATFORM_HIERARCHY_LIB_H_ #define _TPM_PLATFORM_HIERARCHY_LIB_H_ =20 -#include -#include - /** This service will perform the TPM Platform Hierarchy configuration at= the SmmReadyToLock event. =20 diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/= Intel/MinPlatformPkg/MinPlatformPkg.dsc index 7e952dfaf300..0240a803f868 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc @@ -106,7 +106,7 @@ [LibraryClasses.common.DXE_DRIVER] FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/DxeFspWrapperP= latformLib/DxeFspWrapperPlatformLib.inf TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTes= tPointCheckLib.inf TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/DxeTestPointLib.= inf - TpmPlatformHierarchyLib|MinPlatformPkg/Tcg/Library/TpmPlatformHierarch= yLib/TpmPlatformHierarchyLib.inf + TpmPlatformHierarchyLib|MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHi= erarchyLib/PeiDxeTpmPlatformHierarchyLib.inf =20 [LibraryClasses.common.DXE_SMM_DRIVER] SpiFlashCommonLib|MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/S= piFlashCommonLibNull.inf @@ -200,7 +200,7 @@ [Components] MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe.inf MinPlatformPkg/Test/TestPointDumpApp/TestPointDumpApp.inf =20 - MinPlatformPkg/Tcg/Library/TpmPlatformHierarchyLib/TpmPlatformHierarch= yLib.inf + MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlat= formHierarchyLib.inf !if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable =3D=3D TRUE MinPlatformPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf MinPlatformPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf diff --git a/Platform/Intel/MinPlatformPkg/Tcg/Library/TpmPlatformHierarc= hyLib/TpmPlatformHierarchyLib.inf b/Platform/Intel/MinPlatformPkg/Tcg/Lib= rary/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf similarity index 70% rename from Platform/Intel/MinPlatformPkg/Tcg/Library/TpmPlatformHierarch= yLib/TpmPlatformHierarchyLib.inf rename to Platform/Intel/MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHier= archyLib/PeiDxeTpmPlatformHierarchyLib.inf index 0911bdffa01f..7165cda31357 100644 --- a/Platform/Intel/MinPlatformPkg/Tcg/Library/TpmPlatformHierarchyLib/T= pmPlatformHierarchyLib.inf +++ b/Platform/Intel/MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHierarch= yLib/PeiDxeTpmPlatformHierarchyLib.inf @@ -7,6 +7,7 @@ # Policy (platformPolicy) can be defined through this function. # # Copyright (c) 2019, Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -14,23 +15,19 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D TpmPlatformHierarchyLib + BASE_NAME =3D PeiDxeTpmPlatformHierarchyLib FILE_GUID =3D 7794F92C-4E8E-4E57-9E4A-49A0764C7D7= 3 - MODULE_TYPE =3D DXE_DRIVER + MODULE_TYPE =3D PEIM VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D TpmPlatformHierarchyLib + LIBRARY_CLASS =3D TpmPlatformHierarchyLib|PEIM DXE_DR= IVER =20 [LibraryClasses] - MemoryAllocationLib BaseLib - UefiBootServicesTableLib - UefiDriverEntryPoint BaseMemoryLib DebugLib - Tpm2CommandLib - Tpm2DeviceLib + MemoryAllocationLib RngLib - UefiLib + Tpm2CommandLib =20 [Packages] MdePkg/MdePkg.dec @@ -39,7 +36,4 @@ [Packages] CryptoPkg/CryptoPkg.dec =20 [Sources] - TpmPlatformHierarchyLib.c - -[Depex] - gEfiTcg2ProtocolGuid + PeiDxeTpmPlatformHierarchyLib.c --=20 2.28.0.windows.1