On 10/21/21 8:20 AM, Gerd Hoffmann wrote:
Split Tcg2ConfigPei.inf into two variants: Tcg2ConfigPeiCompat12.inf
with TPM 1.2 backward compatibility included and Tcg2ConfigPei.inf
supporting TPM 2.0 only.  This allows x86 builds to choose whenever
TPM 1.2 support should be included or not by picking the one or the
other inf file.

FYI: TPM 2 does not provide backwards compatibility to TPM 1.2. TPM 1.2 is its own implementation that is incompatible with TPM 2.

So the extension 'Compat12' is a bit odd in this case.

Tested-by: Stefan Berger <stef...@linux.ibm.com>

[Tested with OvmfPkg/OvmfPkgX64.dsc]


Switch x86 builds to Tcg2ConfigPeiCompat12.inf, so they continue to
have TPM 1.2 support.

No functional change.

Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
---
  OvmfPkg/OvmfTpmComponentsPei.dsc.inc                     | 2 +-
  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf                 | 9 ---------
  .../{Tcg2ConfigPei.inf => Tcg2ConfigPeiCompat12.inf}     | 9 +--------
  OvmfPkg/OvmfTpmPei.fdf.inc                               | 2 +-
  4 files changed, 3 insertions(+), 19 deletions(-)
  copy OvmfPkg/Tcg/Tcg2Config/{Tcg2ConfigPei.inf => Tcg2ConfigPeiCompat12.inf} 
(84%)

diff --git a/OvmfPkg/OvmfTpmComponentsPei.dsc.inc 
b/OvmfPkg/OvmfTpmComponentsPei.dsc.inc
index 99fa7c13b3e7..b5dc20c4858c 100644
--- a/OvmfPkg/OvmfTpmComponentsPei.dsc.inc
+++ b/OvmfPkg/OvmfTpmComponentsPei.dsc.inc
@@ -4,7 +4,7 @@
!if $(TPM_ENABLE) == TRUE
    OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
-  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeiCompat12.inf
    SecurityPkg/Tcg/TcgPei/TcgPei.inf
    SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
      <LibraryClasses>
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf 
b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
index 39d1deeed16b..bf8b12da8195 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
@@ -22,11 +22,6 @@ [Defines]
  [Sources]
    Tcg2ConfigPeim.c
    Tpm12Support.h
-
-[Sources.IA32, Sources.X64]
-  Tpm12Support.c
-
-[Sources.ARM, Sources.AARCH64]
    Tpm12SupportNull.c
[Packages]
@@ -41,10 +36,6 @@ [LibraryClasses]
    PeiServicesLib
    Tpm2DeviceLib
-[LibraryClasses.IA32, LibraryClasses.X64]
-  BaseLib
-  Tpm12DeviceLib
-
  [Guids]
    gEfiTpmDeviceSelectedGuid           ## PRODUCES ## GUID # Used as a PPI GUID
    gEfiTpmDeviceInstanceTpm20DtpmGuid  ## SOMETIMES_CONSUMES
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf 
b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeiCompat12.inf
similarity index 84%
copy from OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
copy to OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeiCompat12.inf
index 39d1deeed16b..919006f35cf1 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeiCompat12.inf
@@ -14,7 +14,7 @@
  [Defines]
    INF_VERSION                    = 0x00010005
    BASE_NAME                      = Tcg2ConfigPei
-  FILE_GUID                      = BF7F2B0C-9F2F-4889-AB5C-12460022BE87
+  FILE_GUID                      = 8AD3148F-945F-46B4-8ACD-71469EA73945
    MODULE_TYPE                    = PEIM
    VERSION_STRING                 = 1.0
    ENTRY_POINT                    = Tcg2ConfigPeimEntryPoint
@@ -22,13 +22,8 @@ [Defines]
  [Sources]
    Tcg2ConfigPeim.c
    Tpm12Support.h
-
-[Sources.IA32, Sources.X64]
    Tpm12Support.c
-[Sources.ARM, Sources.AARCH64]
-  Tpm12SupportNull.c
-
  [Packages]
    MdePkg/MdePkg.dec
    MdeModulePkg/MdeModulePkg.dec
@@ -40,8 +35,6 @@ [LibraryClasses]
    DebugLib
    PeiServicesLib
    Tpm2DeviceLib
-
-[LibraryClasses.IA32, LibraryClasses.X64]
    BaseLib
    Tpm12DeviceLib
diff --git a/OvmfPkg/OvmfTpmPei.fdf.inc b/OvmfPkg/OvmfTpmPei.fdf.inc
index 9aefd73d219c..6380d7660d40 100644
--- a/OvmfPkg/OvmfTpmPei.fdf.inc
+++ b/OvmfPkg/OvmfTpmPei.fdf.inc
@@ -4,7 +4,7 @@
!if $(TPM_ENABLE) == TRUE
  INF  OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
-INF  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+INF  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPeiCompat12.inf
  INF  SecurityPkg/Tcg/TcgPei/TcgPei.inf
  INF  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
  INF  SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82459): https://edk2.groups.io/g/devel/message/82459
Mute This Topic: https://groups.io/mt/86487985/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to