render / rpms / edk2

Forked from rpms/edk2 3 months ago
Clone

Blame SOURCES/edk2-OvmfPkg-create-Tcg12ConfigPei.inf.patch

7439a5
From 0ecb863aaca8d71a35763645ced278589666ada2 Mon Sep 17 00:00:00 2001
7439a5
From: Gerd Hoffmann <kraxel@redhat.com>
7439a5
Date: Wed, 15 Dec 2021 12:39:19 +0100
7439a5
Subject: [PATCH 4/6] OvmfPkg: create Tcg12ConfigPei.inf
7439a5
7439a5
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
7439a5
RH-MergeRequest: 9: backport tpm build updates, disable tpm 1.2 support
7439a5
RH-Commit: [4/6] 92926b9a05aaff38aab9a2aeee211be736863ab9 (kraxel/centos-edk2)
7439a5
RH-Bugzilla: 1935497
7439a5
RH-Acked-by: Oliver Steffen <None>
7439a5
7439a5
Split Tcg2ConfigPei.inf into two variants: Tcg12ConfigPei.inf with
7439a5
TPM 1.2 support included and Tcg2ConfigPei.inf supporting TPM 2.0 only.
7439a5
This allows x86 builds to choose whenever TPM 1.2 support should be
7439a5
included or not by picking the one or the other inf file.
7439a5
7439a5
Switch x86 builds to Tcg12ConfigPei.inf, so they continue to
7439a5
have TPM 1.2 support.
7439a5
7439a5
No functional change.
7439a5
7439a5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7439a5
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
7439a5
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
7439a5
(cherry picked from commit b81938877276e808b6535e612b320eee559c4c2f)
7439a5
---
7439a5
 OvmfPkg/OvmfTpmComponentsPei.dsc.inc      |  2 +-
7439a5
 OvmfPkg/OvmfTpmPei.fdf.inc                |  2 +-
7439a5
 OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf | 56 +++++++++++++++++++++++
7439a5
 OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf  | 11 +----
7439a5
 4 files changed, 59 insertions(+), 12 deletions(-)
7439a5
 create mode 100644 OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
7439a5
7439a5
diff --git a/OvmfPkg/OvmfTpmComponentsPei.dsc.inc b/OvmfPkg/OvmfTpmComponentsPei.dsc.inc
7439a5
index 99fa7c13b3..87d491da50 100644
7439a5
--- a/OvmfPkg/OvmfTpmComponentsPei.dsc.inc
7439a5
+++ b/OvmfPkg/OvmfTpmComponentsPei.dsc.inc
7439a5
@@ -4,7 +4,7 @@
7439a5
 
7439a5
 !if $(TPM_ENABLE) == TRUE
7439a5
   OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
7439a5
-  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
7439a5
+  OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
7439a5
   SecurityPkg/Tcg/TcgPei/TcgPei.inf
7439a5
   SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
7439a5
     <LibraryClasses>
7439a5
diff --git a/OvmfPkg/OvmfTpmPei.fdf.inc b/OvmfPkg/OvmfTpmPei.fdf.inc
7439a5
index 9aefd73d21..709a608cc3 100644
7439a5
--- a/OvmfPkg/OvmfTpmPei.fdf.inc
7439a5
+++ b/OvmfPkg/OvmfTpmPei.fdf.inc
7439a5
@@ -4,7 +4,7 @@
7439a5
 
7439a5
 !if $(TPM_ENABLE) == TRUE
7439a5
 INF  OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
7439a5
-INF  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
7439a5
+INF  OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
7439a5
 INF  SecurityPkg/Tcg/TcgPei/TcgPei.inf
7439a5
 INF  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
7439a5
 INF  SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf
7439a5
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
7439a5
new file mode 100644
7439a5
index 0000000000..e8e0b88e60
7439a5
--- /dev/null
7439a5
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
7439a5
@@ -0,0 +1,56 @@
7439a5
+## @file
7439a5
+# Set TPM device type - supports TPM 1.2 and 2.0
7439a5
+#
7439a5
+# In SecurityPkg, this module initializes the TPM device type based on a UEFI
7439a5
+# variable and/or hardware detection. In OvmfPkg, the module only performs TPM
7439a5
+# hardware detection.
7439a5
+#
7439a5
+# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
7439a5
+# Copyright (C) 2018, Red Hat, Inc.
7439a5
+#
7439a5
+# SPDX-License-Identifier: BSD-2-Clause-Patent
7439a5
+##
7439a5
+
7439a5
+[Defines]
7439a5
+  INF_VERSION                    = 0x00010005
7439a5
+  BASE_NAME                      = Tcg2ConfigPei
7439a5
+  FILE_GUID                      = 8AD3148F-945F-46B4-8ACD-71469EA73945
7439a5
+  MODULE_TYPE                    = PEIM
7439a5
+  VERSION_STRING                 = 1.0
7439a5
+  ENTRY_POINT                    = Tcg2ConfigPeimEntryPoint
7439a5
+
7439a5
+[Sources]
7439a5
+  Tcg2ConfigPeim.c
7439a5
+  Tpm12Support.h
7439a5
+  Tpm12Support.c
7439a5
+
7439a5
+[Packages]
7439a5
+  MdePkg/MdePkg.dec
7439a5
+  MdeModulePkg/MdeModulePkg.dec
7439a5
+  OvmfPkg/OvmfPkg.dec
7439a5
+  SecurityPkg/SecurityPkg.dec
7439a5
+
7439a5
+[LibraryClasses]
7439a5
+  PeimEntryPoint
7439a5
+  DebugLib
7439a5
+  PeiServicesLib
7439a5
+  Tpm2DeviceLib
7439a5
+  BaseLib
7439a5
+  Tpm12DeviceLib
7439a5
+
7439a5
+[Guids]
7439a5
+  gEfiTpmDeviceSelectedGuid           ## PRODUCES ## GUID # Used as a PPI GUID
7439a5
+  gEfiTpmDeviceInstanceTpm20DtpmGuid  ## SOMETIMES_CONSUMES
7439a5
+  gEfiTpmDeviceInstanceTpm12Guid      ## SOMETIMES_CONSUMES
7439a5
+
7439a5
+[Ppis]
7439a5
+  gPeiTpmInitializationDonePpiGuid    ## SOMETIMES_PRODUCES
7439a5
+
7439a5
+[Pcd]
7439a5
+  gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid                 ## PRODUCES
7439a5
+
7439a5
+[Depex.IA32, Depex.X64]
7439a5
+  gOvmfTpmMmioAccessiblePpiGuid
7439a5
+
7439a5
+[Depex.ARM, Depex.AARCH64]
7439a5
+  gOvmfTpmDiscoveredPpiGuid
7439a5
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
7439a5
index 39d1deeed1..51078c9813 100644
7439a5
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
7439a5
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
7439a5
@@ -1,5 +1,5 @@
7439a5
 ## @file
7439a5
-# Set TPM device type
7439a5
+# Set TPM device type - supports TPM 2.0 only
7439a5
 #
7439a5
 # In SecurityPkg, this module initializes the TPM device type based on a UEFI
7439a5
 # variable and/or hardware detection. In OvmfPkg, the module only performs TPM
7439a5
@@ -22,11 +22,6 @@
7439a5
 [Sources]
7439a5
   Tcg2ConfigPeim.c
7439a5
   Tpm12Support.h
7439a5
-
7439a5
-[Sources.IA32, Sources.X64]
7439a5
-  Tpm12Support.c
7439a5
-
7439a5
-[Sources.ARM, Sources.AARCH64]
7439a5
   Tpm12SupportNull.c
7439a5
 
7439a5
 [Packages]
7439a5
@@ -41,10 +36,6 @@
7439a5
   PeiServicesLib
7439a5
   Tpm2DeviceLib
7439a5
 
7439a5
-[LibraryClasses.IA32, LibraryClasses.X64]
7439a5
-  BaseLib
7439a5
-  Tpm12DeviceLib
7439a5
-
7439a5
 [Guids]
7439a5
   gEfiTpmDeviceSelectedGuid           ## PRODUCES ## GUID # Used as a PPI GUID
7439a5
   gEfiTpmDeviceInstanceTpm20DtpmGuid  ## SOMETIMES_CONSUMES
7439a5
-- 
7439a5
2.27.0
7439a5