public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2
@ 2024-01-16 15:42 Gerd Hoffmann
  2024-01-16 15:42 ` [edk2-devel] [PATCH 1/2] OvmfPkg: remove TPM1_ENABLE build option Gerd Hoffmann
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2024-01-16 15:42 UTC (permalink / raw)
  To: devel; +Cc: Oliver Steffen, Gerd Hoffmann



Gerd Hoffmann (2):
  OvmfPkg: remove TPM1_ENABLE build option
  OvmfPkg/Tcg2Config: remove unused TPM 1.2 support

 .../Include/Dsc/OvmfTpmComponentsDxe.dsc.inc  |  6 --
 .../Include/Dsc/OvmfTpmComponentsPei.dsc.inc  |  5 --
 OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc    |  3 -
 OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc       |  9 --
 .../Include/Dsc/OvmfTpmSecurityStub.dsc.inc   |  6 --
 OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf     | 56 -------------
 OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c         | 83 -------------------
 OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc        |  3 -
 OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc        |  5 --
 OvmfPkg/PlatformCI/ReadMe.md                  |  2 +-
 10 files changed, 1 insertion(+), 177 deletions(-)
 delete mode 100644 OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
 delete mode 100644 OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c

-- 
2.43.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113911): https://edk2.groups.io/g/devel/message/113911
Mute This Topic: https://groups.io/mt/103764204/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [edk2-devel] [PATCH 1/2] OvmfPkg: remove TPM1_ENABLE build option
  2024-01-16 15:42 [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2 Gerd Hoffmann
@ 2024-01-16 15:42 ` Gerd Hoffmann
  2024-01-17  9:35   ` Laszlo Ersek
  2024-01-16 15:42 ` [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support Gerd Hoffmann
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Gerd Hoffmann @ 2024-01-16 15:42 UTC (permalink / raw)
  To: devel; +Cc: Oliver Steffen, Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc | 6 ------
 OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc | 5 -----
 OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc       | 3 ---
 OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc          | 9 ---------
 OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc  | 6 ------
 OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc           | 3 ---
 OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc           | 5 -----
 OvmfPkg/PlatformCI/ReadMe.md                     | 2 +-
 8 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc
index 75ae09571e8c..eef20b77149a 100644
--- a/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc
+++ b/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc
@@ -15,12 +15,6 @@
       NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf
   }
   SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
-!if $(TPM1_ENABLE) == TRUE
-  SecurityPkg/Tcg/TcgDxe/TcgDxe.inf {
-    <LibraryClasses>
-      Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf
-  }
-!endif
   SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf {
     <LibraryClasses>
       TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
diff --git a/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc
index fa486eed82d2..b91f29e5a64b 100644
--- a/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc
+++ b/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc
@@ -4,12 +4,7 @@
 
 !if $(TPM2_ENABLE) == TRUE
   OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
-!if $(TPM1_ENABLE) == TRUE
-  OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
-  SecurityPkg/Tcg/TcgPei/TcgPei.inf
-!else
   OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
-!endif
   SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
     <LibraryClasses>
       HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf
diff --git a/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
index a65564d8d9d2..ad3740a4737a 100644
--- a/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
+++ b/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
@@ -3,6 +3,3 @@
 ##
 
   DEFINE TPM2_ENABLE             = FALSE
-
-  # has no effect unless TPM2_ENABLE == TRUE
-  DEFINE TPM1_ENABLE             = TRUE
diff --git a/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
index b97244695b52..e02a5d02d1a5 100644
--- a/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
+++ b/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
@@ -4,9 +4,6 @@
 
 [LibraryClasses]
 !if $(TPM2_ENABLE) == TRUE
-!if $(TPM1_ENABLE) == TRUE
-  Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf
-!endif
   Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
   Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
   Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf
@@ -27,16 +24,10 @@ [LibraryClasses]
 [LibraryClasses.common.PEIM]
 !if $(TPM2_ENABLE) == TRUE
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
-!if $(TPM1_ENABLE) == TRUE
-  Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf
-!endif
   Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf
 !endif
 
 [LibraryClasses.common.DXE_DRIVER]
 !if $(TPM2_ENABLE) == TRUE
-!if $(TPM1_ENABLE) == TRUE
-  Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.inf
-!endif
   Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf
 !endif
diff --git a/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc
index 89455feca4d9..c40d6b0a0e78 100644
--- a/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc
+++ b/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc
@@ -2,12 +2,6 @@
 #    SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 
-!if $(TPM2_ENABLE) == TRUE
-!if $(TPM1_ENABLE) == TRUE
-      NULL|SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf
-!endif
-!endif
-
 !if $(TPM2_ENABLE) == TRUE || $(CC_MEASUREMENT_ENABLE) == TRUE
       #
       # DxeTpm2MeasureBootLib provides security service of TPM2 measure boot and
diff --git a/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc b/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
index 7fc2bf8590a4..bd0be8fedbd5 100644
--- a/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
+++ b/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
@@ -3,9 +3,6 @@
 ##
 
 !if $(TPM2_ENABLE) == TRUE
-!if $(TPM1_ENABLE) == TRUE
-INF  SecurityPkg/Tcg/TcgDxe/TcgDxe.inf
-!endif
 INF  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
 INF  SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf
 INF  SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
diff --git a/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc b/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
index 9f8b9bdd5bed..add012afab67 100644
--- a/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
+++ b/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
@@ -4,12 +4,7 @@
 
 !if $(TPM2_ENABLE) == TRUE
 INF  OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
-!if $(TPM1_ENABLE) == TRUE
-INF  OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
-INF  SecurityPkg/Tcg/TcgPei/TcgPei.inf
-!else
 INF  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
-!endif
 INF  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
 INF  SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf
 !endif
diff --git a/OvmfPkg/PlatformCI/ReadMe.md b/OvmfPkg/PlatformCI/ReadMe.md
index 10fa32ac489f..33b89df17bc5 100644
--- a/OvmfPkg/PlatformCI/ReadMe.md
+++ b/OvmfPkg/PlatformCI/ReadMe.md
@@ -14,7 +14,7 @@ supported and are described below.
 | IA32                    | IA32               | OvmfPkgIa32.dsc     | None            |
 | X64                     | X64                | OvmfPkgIa64.dsc     | None            |
 | IA32 X64                | PEI-IA32 DXE-X64   | OvmfPkgIa32X64.dsc  | None            |
-| IA32 X64 Full           | PEI-IA32 DXE-X64   | OvmfPkgIa32X64.dsc  | SECURE_BOOT_ENABLE=1 SMM_REQUIRE=1 TPM1_ENABLE=1 TPM2_ENABLE=1 NETWORK_TLS_ENABLE=1 NETWORK_IP6_ENABLE=1 NETWORK_HTTP_BOOT_ENABLE=1 |
+| IA32 X64 Full           | PEI-IA32 DXE-X64   | OvmfPkgIa32X64.dsc  | SECURE_BOOT_ENABLE=1 SMM_REQUIRE=1 TPM2_ENABLE=1 NETWORK_TLS_ENABLE=1 NETWORK_IP6_ENABLE=1 NETWORK_HTTP_BOOT_ENABLE=1 |
 
 ## EDK2 Developer environment
 
-- 
2.43.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113913): https://edk2.groups.io/g/devel/message/113913
Mute This Topic: https://groups.io/mt/103764206/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support
  2024-01-16 15:42 [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2 Gerd Hoffmann
  2024-01-16 15:42 ` [edk2-devel] [PATCH 1/2] OvmfPkg: remove TPM1_ENABLE build option Gerd Hoffmann
@ 2024-01-16 15:42 ` Gerd Hoffmann
  2024-01-17  9:47   ` Laszlo Ersek
  2024-01-16 15:46 ` [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2 Ard Biesheuvel
  2024-01-16 23:38 ` Yao, Jiewen
  3 siblings, 1 reply; 10+ messages in thread
From: Gerd Hoffmann @ 2024-01-16 15:42 UTC (permalink / raw)
  To: devel; +Cc: Oliver Steffen, Gerd Hoffmann

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf | 56 ---------------
 OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c     | 83 -----------------------
 2 files changed, 139 deletions(-)
 delete mode 100644 OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
 delete mode 100644 OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c

diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
deleted file mode 100644
index e8e0b88e6058..000000000000
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file
-# Set TPM device type - supports TPM 1.2 and 2.0
-#
-# In SecurityPkg, this module initializes the TPM device type based on a UEFI
-# variable and/or hardware detection. In OvmfPkg, the module only performs TPM
-# hardware detection.
-#
-# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
-# Copyright (C) 2018, Red Hat, Inc.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-
-[Defines]
-  INF_VERSION                    = 0x00010005
-  BASE_NAME                      = Tcg2ConfigPei
-  FILE_GUID                      = 8AD3148F-945F-46B4-8ACD-71469EA73945
-  MODULE_TYPE                    = PEIM
-  VERSION_STRING                 = 1.0
-  ENTRY_POINT                    = Tcg2ConfigPeimEntryPoint
-
-[Sources]
-  Tcg2ConfigPeim.c
-  Tpm12Support.h
-  Tpm12Support.c
-
-[Packages]
-  MdePkg/MdePkg.dec
-  MdeModulePkg/MdeModulePkg.dec
-  OvmfPkg/OvmfPkg.dec
-  SecurityPkg/SecurityPkg.dec
-
-[LibraryClasses]
-  PeimEntryPoint
-  DebugLib
-  PeiServicesLib
-  Tpm2DeviceLib
-  BaseLib
-  Tpm12DeviceLib
-
-[Guids]
-  gEfiTpmDeviceSelectedGuid           ## PRODUCES ## GUID # Used as a PPI GUID
-  gEfiTpmDeviceInstanceTpm20DtpmGuid  ## SOMETIMES_CONSUMES
-  gEfiTpmDeviceInstanceTpm12Guid      ## SOMETIMES_CONSUMES
-
-[Ppis]
-  gPeiTpmInitializationDonePpiGuid    ## SOMETIMES_PRODUCES
-
-[Pcd]
-  gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid                 ## PRODUCES
-
-[Depex.IA32, Depex.X64]
-  gOvmfTpmMmioAccessiblePpiGuid
-
-[Depex.ARM, Depex.AARCH64]
-  gOvmfTpmDiscoveredPpiGuid
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c b/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c
deleted file mode 100644
index c88da5758b44..000000000000
--- a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/** @file
-  Implement the InternalTpm12Detect() function on top of the Tpm12DeviceLib
-  class.
-
-  Copyright (C) 2020, Red Hat, Inc.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#include <Library/BaseLib.h>
-#include <Library/Tpm12DeviceLib.h>
-
-#include "Tpm12Support.h"
-
-#pragma pack (1)
-typedef struct {
-  TPM_RSP_COMMAND_HDR    Hdr;
-  TPM_CURRENT_TICKS      CurrentTicks;
-} TPM_RSP_GET_TICKS;
-#pragma pack ()
-
-/**
-  Probe for the TPM for 1.2 version, by sending TPM1.2 GetTicks
-
-  Sending a TPM1.2 command to a TPM2 should return a TPM1.2
-  header (tag = 0xc4) and error code (TPM_BADTAG = 0x1e)
-
-  @retval EFI_SUCCESS  TPM version 1.2 probing successful.
-
-  @return              Error codes propagated from Tpm12SubmitCommand().
-**/
-STATIC
-EFI_STATUS
-TestTpm12 (
-  )
-{
-  EFI_STATUS           Status;
-  TPM_RQU_COMMAND_HDR  Command;
-  TPM_RSP_GET_TICKS    Response;
-  UINT32               Length;
-
-  Command.tag       = SwapBytes16 (TPM_TAG_RQU_COMMAND);
-  Command.paramSize = SwapBytes32 (sizeof (Command));
-  Command.ordinal   = SwapBytes32 (TPM_ORD_GetTicks);
-
-  Length = sizeof (Response);
-  Status = Tpm12SubmitCommand (
-             sizeof (Command),
-             (UINT8 *)&Command,
-             &Length,
-             (UINT8 *)&Response
-             );
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
-
-  return EFI_SUCCESS;
-}
-
-/**
-  Detect the presence of a TPM with interface version 1.2.
-
-  @retval EFI_SUCCESS      TPM-1.2 available. The Tpm12RequestUseTpm() and
-                           Tpm12SubmitCommand(TPM_ORD_GetTicks) operations
-                           (from the Tpm12DeviceLib class) have succeeded.
-
-  @return                  Error codes propagated from Tpm12RequestUseTpm() and
-                           Tpm12SubmitCommand().
-**/
-EFI_STATUS
-InternalTpm12Detect (
-  VOID
-  )
-{
-  EFI_STATUS  Status;
-
-  Status = Tpm12RequestUseTpm ();
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
-
-  return TestTpm12 ();
-}
-- 
2.43.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113912): https://edk2.groups.io/g/devel/message/113912
Mute This Topic: https://groups.io/mt/103764205/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2
  2024-01-16 15:42 [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2 Gerd Hoffmann
  2024-01-16 15:42 ` [edk2-devel] [PATCH 1/2] OvmfPkg: remove TPM1_ENABLE build option Gerd Hoffmann
  2024-01-16 15:42 ` [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support Gerd Hoffmann
@ 2024-01-16 15:46 ` Ard Biesheuvel
  2024-01-16 23:38 ` Yao, Jiewen
  3 siblings, 0 replies; 10+ messages in thread
From: Ard Biesheuvel @ 2024-01-16 15:46 UTC (permalink / raw)
  To: devel, kraxel, Jiewen Yao, Laszlo Ersek; +Cc: Oliver Steffen

(cc Jiewen. Laszlo)

On Tue, 16 Jan 2024 at 16:42, Gerd Hoffmann <kraxel@redhat.com> wrote:
>
>
>
> Gerd Hoffmann (2):
>   OvmfPkg: remove TPM1_ENABLE build option
>   OvmfPkg/Tcg2Config: remove unused TPM 1.2 support
>

Good riddance

Acked-by: Ard Biesheuvel <ardb@kernel.org>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113914): https://edk2.groups.io/g/devel/message/113914
Mute This Topic: https://groups.io/mt/103764204/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2
  2024-01-16 15:42 [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2 Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2024-01-16 15:46 ` [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2 Ard Biesheuvel
@ 2024-01-16 23:38 ` Yao, Jiewen
  2024-01-17 14:14   ` Gerd Hoffmann
  3 siblings, 1 reply; 10+ messages in thread
From: Yao, Jiewen @ 2024-01-16 23:38 UTC (permalink / raw)
  To: devel@edk2.groups.io, kraxel@redhat.com; +Cc: Oliver Steffen

Gerd
I am OK with the patch.

Quick question: Have you validated that the TPM2 is still working?





> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Gerd
> Hoffmann
> Sent: Tuesday, January 16, 2024 11:42 PM
> To: devel@edk2.groups.io
> Cc: Oliver Steffen <osteffen@redhat.com>; Gerd Hoffmann <kraxel@redhat.com>
> Subject: [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2
> 
> 
> 
> Gerd Hoffmann (2):
>   OvmfPkg: remove TPM1_ENABLE build option
>   OvmfPkg/Tcg2Config: remove unused TPM 1.2 support
> 
>  .../Include/Dsc/OvmfTpmComponentsDxe.dsc.inc  |  6 --
>  .../Include/Dsc/OvmfTpmComponentsPei.dsc.inc  |  5 --
>  OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc    |  3 -
>  OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc       |  9 --
>  .../Include/Dsc/OvmfTpmSecurityStub.dsc.inc   |  6 --
>  OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf     | 56 -------------
>  OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c         | 83 -------------------
>  OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc        |  3 -
>  OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc        |  5 --
>  OvmfPkg/PlatformCI/ReadMe.md                  |  2 +-
>  10 files changed, 1 insertion(+), 177 deletions(-)
>  delete mode 100644 OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
>  delete mode 100644 OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c
> 
> --
> 2.43.0
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113924): https://edk2.groups.io/g/devel/message/113924
Mute This Topic: https://groups.io/mt/103764204/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] OvmfPkg: remove TPM1_ENABLE build option
  2024-01-16 15:42 ` [edk2-devel] [PATCH 1/2] OvmfPkg: remove TPM1_ENABLE build option Gerd Hoffmann
@ 2024-01-17  9:35   ` Laszlo Ersek
  0 siblings, 0 replies; 10+ messages in thread
From: Laszlo Ersek @ 2024-01-17  9:35 UTC (permalink / raw)
  To: devel, kraxel; +Cc: Oliver Steffen

On 1/16/24 16:42, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc | 6 ------
>  OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc | 5 -----
>  OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc       | 3 ---
>  OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc          | 9 ---------
>  OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc  | 6 ------
>  OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc           | 3 ---
>  OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc           | 5 -----
>  OvmfPkg/PlatformCI/ReadMe.md                     | 2 +-
>  8 files changed, 1 insertion(+), 38 deletions(-)
> 
> diff --git a/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc
> index 75ae09571e8c..eef20b77149a 100644
> --- a/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc
> +++ b/OvmfPkg/Include/Dsc/OvmfTpmComponentsDxe.dsc.inc
> @@ -15,12 +15,6 @@
>        NULL|SecurityPkg/Library/HashInstanceLibSm3/HashInstanceLibSm3.inf
>    }
>    SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
> -!if $(TPM1_ENABLE) == TRUE
> -  SecurityPkg/Tcg/TcgDxe/TcgDxe.inf {
> -    <LibraryClasses>
> -      Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf
> -  }
> -!endif
>    SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf {
>      <LibraryClasses>
>        TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
> diff --git a/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc
> index fa486eed82d2..b91f29e5a64b 100644
> --- a/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc
> +++ b/OvmfPkg/Include/Dsc/OvmfTpmComponentsPei.dsc.inc
> @@ -4,12 +4,7 @@
>  
>  !if $(TPM2_ENABLE) == TRUE
>    OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
> -!if $(TPM1_ENABLE) == TRUE
> -  OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
> -  SecurityPkg/Tcg/TcgPei/TcgPei.inf
> -!else
>    OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> -!endif
>    SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
>      <LibraryClasses>
>        HashLib|SecurityPkg/Library/HashLibBaseCryptoRouter/HashLibBaseCryptoRouterPei.inf
> diff --git a/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
> index a65564d8d9d2..ad3740a4737a 100644
> --- a/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
> +++ b/OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
> @@ -3,6 +3,3 @@
>  ##
>  
>    DEFINE TPM2_ENABLE             = FALSE
> -
> -  # has no effect unless TPM2_ENABLE == TRUE
> -  DEFINE TPM1_ENABLE             = TRUE
> diff --git a/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
> index b97244695b52..e02a5d02d1a5 100644
> --- a/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
> +++ b/OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
> @@ -4,9 +4,6 @@
>  
>  [LibraryClasses]
>  !if $(TPM2_ENABLE) == TRUE
> -!if $(TPM1_ENABLE) == TRUE
> -  Tpm12CommandLib|SecurityPkg/Library/Tpm12CommandLib/Tpm12CommandLib.inf
> -!endif
>    Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
>    Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
>    Tcg2PpVendorLib|SecurityPkg/Library/Tcg2PpVendorLibNull/Tcg2PpVendorLibNull.inf
> @@ -27,16 +24,10 @@ [LibraryClasses]
>  [LibraryClasses.common.PEIM]
>  !if $(TPM2_ENABLE) == TRUE
>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
> -!if $(TPM1_ENABLE) == TRUE
> -  Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12DeviceLibDTpm.inf
> -!endif
>    Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.inf
>  !endif
>  
>  [LibraryClasses.common.DXE_DRIVER]
>  !if $(TPM2_ENABLE) == TRUE
> -!if $(TPM1_ENABLE) == TRUE
> -  Tpm12DeviceLib|SecurityPkg/Library/Tpm12DeviceLibTcg/Tpm12DeviceLibTcg.inf
> -!endif
>    Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibTcg2/Tpm2DeviceLibTcg2.inf
>  !endif
> diff --git a/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc b/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc
> index 89455feca4d9..c40d6b0a0e78 100644
> --- a/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc
> +++ b/OvmfPkg/Include/Dsc/OvmfTpmSecurityStub.dsc.inc
> @@ -2,12 +2,6 @@
>  #    SPDX-License-Identifier: BSD-2-Clause-Patent
>  ##
>  
> -!if $(TPM2_ENABLE) == TRUE
> -!if $(TPM1_ENABLE) == TRUE
> -      NULL|SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf
> -!endif
> -!endif
> -
>  !if $(TPM2_ENABLE) == TRUE || $(CC_MEASUREMENT_ENABLE) == TRUE
>        #
>        # DxeTpm2MeasureBootLib provides security service of TPM2 measure boot and
> diff --git a/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc b/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
> index 7fc2bf8590a4..bd0be8fedbd5 100644
> --- a/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
> +++ b/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
> @@ -3,9 +3,6 @@
>  ##
>  
>  !if $(TPM2_ENABLE) == TRUE
> -!if $(TPM1_ENABLE) == TRUE
> -INF  SecurityPkg/Tcg/TcgDxe/TcgDxe.inf
> -!endif
>  INF  SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.inf
>  INF  SecurityPkg/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf
>  INF  SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigDxe.inf
> diff --git a/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc b/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
> index 9f8b9bdd5bed..add012afab67 100644
> --- a/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
> +++ b/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
> @@ -4,12 +4,7 @@
>  
>  !if $(TPM2_ENABLE) == TRUE
>  INF  OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPei.inf
> -!if $(TPM1_ENABLE) == TRUE
> -INF  OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
> -INF  SecurityPkg/Tcg/TcgPei/TcgPei.inf
> -!else
>  INF  OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> -!endif
>  INF  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
>  INF  SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf
>  !endif
> diff --git a/OvmfPkg/PlatformCI/ReadMe.md b/OvmfPkg/PlatformCI/ReadMe.md
> index 10fa32ac489f..33b89df17bc5 100644
> --- a/OvmfPkg/PlatformCI/ReadMe.md
> +++ b/OvmfPkg/PlatformCI/ReadMe.md
> @@ -14,7 +14,7 @@ supported and are described below.
>  | IA32                    | IA32               | OvmfPkgIa32.dsc     | None            |
>  | X64                     | X64                | OvmfPkgIa64.dsc     | None            |
>  | IA32 X64                | PEI-IA32 DXE-X64   | OvmfPkgIa32X64.dsc  | None            |
> -| IA32 X64 Full           | PEI-IA32 DXE-X64   | OvmfPkgIa32X64.dsc  | SECURE_BOOT_ENABLE=1 SMM_REQUIRE=1 TPM1_ENABLE=1 TPM2_ENABLE=1 NETWORK_TLS_ENABLE=1 NETWORK_IP6_ENABLE=1 NETWORK_HTTP_BOOT_ENABLE=1 |
> +| IA32 X64 Full           | PEI-IA32 DXE-X64   | OvmfPkgIa32X64.dsc  | SECURE_BOOT_ENABLE=1 SMM_REQUIRE=1 TPM2_ENABLE=1 NETWORK_TLS_ENABLE=1 NETWORK_IP6_ENABLE=1 NETWORK_HTTP_BOOT_ENABLE=1 |
>  
>  ## EDK2 Developer environment
>  

Reviewed-by: Laszlo Ersek <lersek@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113939): https://edk2.groups.io/g/devel/message/113939
Mute This Topic: https://groups.io/mt/103764206/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support
  2024-01-16 15:42 ` [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support Gerd Hoffmann
@ 2024-01-17  9:47   ` Laszlo Ersek
  2024-01-17 14:12     ` Gerd Hoffmann
  0 siblings, 1 reply; 10+ messages in thread
From: Laszlo Ersek @ 2024-01-17  9:47 UTC (permalink / raw)
  To: devel, kraxel; +Cc: Oliver Steffen

On 1/16/24 16:42, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf | 56 ---------------
>  OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c     | 83 -----------------------
>  2 files changed, 139 deletions(-)
>  delete mode 100644 OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
>  delete mode 100644 OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c
> 
> diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
> deleted file mode 100644
> index e8e0b88e6058..000000000000
> --- a/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
> +++ /dev/null
> @@ -1,56 +0,0 @@
> -## @file
> -# Set TPM device type - supports TPM 1.2 and 2.0
> -#
> -# In SecurityPkg, this module initializes the TPM device type based on a UEFI
> -# variable and/or hardware detection. In OvmfPkg, the module only performs TPM
> -# hardware detection.
> -#
> -# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
> -# Copyright (C) 2018, Red Hat, Inc.
> -#
> -# SPDX-License-Identifier: BSD-2-Clause-Patent
> -##
> -
> -[Defines]
> -  INF_VERSION                    = 0x00010005
> -  BASE_NAME                      = Tcg2ConfigPei
> -  FILE_GUID                      = 8AD3148F-945F-46B4-8ACD-71469EA73945
> -  MODULE_TYPE                    = PEIM
> -  VERSION_STRING                 = 1.0
> -  ENTRY_POINT                    = Tcg2ConfigPeimEntryPoint
> -
> -[Sources]
> -  Tcg2ConfigPeim.c
> -  Tpm12Support.h
> -  Tpm12Support.c
> -
> -[Packages]
> -  MdePkg/MdePkg.dec
> -  MdeModulePkg/MdeModulePkg.dec
> -  OvmfPkg/OvmfPkg.dec
> -  SecurityPkg/SecurityPkg.dec
> -
> -[LibraryClasses]
> -  PeimEntryPoint
> -  DebugLib
> -  PeiServicesLib
> -  Tpm2DeviceLib
> -  BaseLib
> -  Tpm12DeviceLib
> -
> -[Guids]
> -  gEfiTpmDeviceSelectedGuid           ## PRODUCES ## GUID # Used as a PPI GUID
> -  gEfiTpmDeviceInstanceTpm20DtpmGuid  ## SOMETIMES_CONSUMES
> -  gEfiTpmDeviceInstanceTpm12Guid      ## SOMETIMES_CONSUMES
> -
> -[Ppis]
> -  gPeiTpmInitializationDonePpiGuid    ## SOMETIMES_PRODUCES
> -
> -[Pcd]
> -  gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid                 ## PRODUCES
> -
> -[Depex.IA32, Depex.X64]
> -  gOvmfTpmMmioAccessiblePpiGuid
> -
> -[Depex.ARM, Depex.AARCH64]
> -  gOvmfTpmDiscoveredPpiGuid
> diff --git a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c b/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c
> deleted file mode 100644
> index c88da5758b44..000000000000
> --- a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.c
> +++ /dev/null
> @@ -1,83 +0,0 @@
> -/** @file
> -  Implement the InternalTpm12Detect() function on top of the Tpm12DeviceLib
> -  class.
> -
> -  Copyright (C) 2020, Red Hat, Inc.
> -
> -  SPDX-License-Identifier: BSD-2-Clause-Patent
> -**/
> -
> -#include <Library/BaseLib.h>
> -#include <Library/Tpm12DeviceLib.h>
> -
> -#include "Tpm12Support.h"
> -
> -#pragma pack (1)
> -typedef struct {
> -  TPM_RSP_COMMAND_HDR    Hdr;
> -  TPM_CURRENT_TICKS      CurrentTicks;
> -} TPM_RSP_GET_TICKS;
> -#pragma pack ()
> -
> -/**
> -  Probe for the TPM for 1.2 version, by sending TPM1.2 GetTicks
> -
> -  Sending a TPM1.2 command to a TPM2 should return a TPM1.2
> -  header (tag = 0xc4) and error code (TPM_BADTAG = 0x1e)
> -
> -  @retval EFI_SUCCESS  TPM version 1.2 probing successful.
> -
> -  @return              Error codes propagated from Tpm12SubmitCommand().
> -**/
> -STATIC
> -EFI_STATUS
> -TestTpm12 (
> -  )
> -{
> -  EFI_STATUS           Status;
> -  TPM_RQU_COMMAND_HDR  Command;
> -  TPM_RSP_GET_TICKS    Response;
> -  UINT32               Length;
> -
> -  Command.tag       = SwapBytes16 (TPM_TAG_RQU_COMMAND);
> -  Command.paramSize = SwapBytes32 (sizeof (Command));
> -  Command.ordinal   = SwapBytes32 (TPM_ORD_GetTicks);
> -
> -  Length = sizeof (Response);
> -  Status = Tpm12SubmitCommand (
> -             sizeof (Command),
> -             (UINT8 *)&Command,
> -             &Length,
> -             (UINT8 *)&Response
> -             );
> -  if (EFI_ERROR (Status)) {
> -    return Status;
> -  }
> -
> -  return EFI_SUCCESS;
> -}
> -
> -/**
> -  Detect the presence of a TPM with interface version 1.2.
> -
> -  @retval EFI_SUCCESS      TPM-1.2 available. The Tpm12RequestUseTpm() and
> -                           Tpm12SubmitCommand(TPM_ORD_GetTicks) operations
> -                           (from the Tpm12DeviceLib class) have succeeded.
> -
> -  @return                  Error codes propagated from Tpm12RequestUseTpm() and
> -                           Tpm12SubmitCommand().
> -**/
> -EFI_STATUS
> -InternalTpm12Detect (
> -  VOID
> -  )
> -{
> -  EFI_STATUS  Status;
> -
> -  Status = Tpm12RequestUseTpm ();
> -  if (EFI_ERROR (Status)) {
> -    return Status;
> -  }
> -
> -  return TestTpm12 ();
> -}

This patch is good:

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

but the series shouldn't stop here. In "OvmfPkg/Tcg/Tcg2Config", we're
left with an INF file (Tcg2ConfigPei.inf) that still references
"Tpm12Support.h", and the common C source file "Tcg2ConfigPeim.c" still
calls the one API -- InternalTpm12Detect() -- declared in that header
file. The only remaining implementation of InternalTpm12Detect() is now
in "Tpm12SupportNull.c", and all it does is "return EFI_UNSUPPORTED".

Therefore, in a subsequent patch, "Tpm12SupportNull.c" and
"Tpm12Support.h" should be removed, both from the tree, and from the
remaining INF file. Furthermore, the InternalTpm12Detect() call in
"Tcg2ConfigPeim.c", and everything that depends on the success of that
call, now counts as dead code, and should be removed.

And *that* in turn means that we should also remove
"gEfiTpmDeviceInstanceTpm12Guid" from the [Guids] section of the
remaining INF file.

Thanks,
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113940): https://edk2.groups.io/g/devel/message/113940
Mute This Topic: https://groups.io/mt/103764205/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support
  2024-01-17  9:47   ` Laszlo Ersek
@ 2024-01-17 14:12     ` Gerd Hoffmann
  2024-01-18 18:45       ` Laszlo Ersek
  0 siblings, 1 reply; 10+ messages in thread
From: Gerd Hoffmann @ 2024-01-17 14:12 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: devel, Oliver Steffen

> This patch is good:
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> but the series shouldn't stop here. In "OvmfPkg/Tcg/Tcg2Config", we're
> left with an INF file (Tcg2ConfigPei.inf) that still references
> "Tpm12Support.h", and the common C source file "Tcg2ConfigPeim.c" still
> calls the one API -- InternalTpm12Detect() -- declared in that header
> file. The only remaining implementation of InternalTpm12Detect() is now
> in "Tpm12SupportNull.c", and all it does is "return EFI_UNSUPPORTED".
> 
> Therefore, in a subsequent patch, "Tpm12SupportNull.c" and
> "Tpm12Support.h" should be removed, both from the tree, and from the
> remaining INF file. Furthermore, the InternalTpm12Detect() call in
> "Tcg2ConfigPeim.c", and everything that depends on the success of that
> call, now counts as dead code, and should be removed.
> 
> And *that* in turn means that we should also remove
> "gEfiTpmDeviceInstanceTpm12Guid" from the [Guids] section of the
> remaining INF file.

Yes, I noticed there is more to cleanup, but I wanted have something
quick and proven (== identical to setting TPM1_ENABLE=FALSE) out of
the door to fix the build / CI problems.

Touching the code for additional cleanups requires a bit more attention
and testing, I'll keep that on my radar though.

thanks & take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113951): https://edk2.groups.io/g/devel/message/113951
Mute This Topic: https://groups.io/mt/103764205/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2
  2024-01-16 23:38 ` Yao, Jiewen
@ 2024-01-17 14:14   ` Gerd Hoffmann
  0 siblings, 0 replies; 10+ messages in thread
From: Gerd Hoffmann @ 2024-01-17 14:14 UTC (permalink / raw)
  To: devel, jiewen.yao; +Cc: Oliver Steffen

On Tue, Jan 16, 2024 at 11:38:12PM +0000, Yao, Jiewen wrote:
> Gerd
> I am OK with the patch.
> 
> Quick question: Have you validated that the TPM2 is still working?

TPM1_ENABLE=FALSE is known to work and this series should give identical
results.  See other replies for more details.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113953): https://edk2.groups.io/g/devel/message/113953
Mute This Topic: https://groups.io/mt/103764204/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support
  2024-01-17 14:12     ` Gerd Hoffmann
@ 2024-01-18 18:45       ` Laszlo Ersek
  0 siblings, 0 replies; 10+ messages in thread
From: Laszlo Ersek @ 2024-01-18 18:45 UTC (permalink / raw)
  To: devel, kraxel; +Cc: Oliver Steffen

On 1/17/24 15:12, Gerd Hoffmann wrote:
>> This patch is good:
>>
>> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
>>
>> but the series shouldn't stop here. In "OvmfPkg/Tcg/Tcg2Config", we're
>> left with an INF file (Tcg2ConfigPei.inf) that still references
>> "Tpm12Support.h", and the common C source file "Tcg2ConfigPeim.c" still
>> calls the one API -- InternalTpm12Detect() -- declared in that header
>> file. The only remaining implementation of InternalTpm12Detect() is now
>> in "Tpm12SupportNull.c", and all it does is "return EFI_UNSUPPORTED".
>>
>> Therefore, in a subsequent patch, "Tpm12SupportNull.c" and
>> "Tpm12Support.h" should be removed, both from the tree, and from the
>> remaining INF file. Furthermore, the InternalTpm12Detect() call in
>> "Tcg2ConfigPeim.c", and everything that depends on the success of that
>> call, now counts as dead code, and should be removed.
>>
>> And *that* in turn means that we should also remove
>> "gEfiTpmDeviceInstanceTpm12Guid" from the [Guids] section of the
>> remaining INF file.
> 
> Yes, I noticed there is more to cleanup, but I wanted have something
> quick and proven (== identical to setting TPM1_ENABLE=FALSE) out of
> the door to fix the build / CI problems.

Right, I now see that this would eliminate the symbol conflict.

Either way, Jiewen has now reviewed Doug's patches for the symbol
conflict, so I'm going to merge those (and your v3 VirtNorFlashDxe
series, too).

Laszlo

> 
> Touching the code for additional cleanups requires a bit more attention
> and testing, I'll keep that on my radar though.
> 
> thanks & take care,
>   Gerd
> 
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114005): https://edk2.groups.io/g/devel/message/114005
Mute This Topic: https://groups.io/mt/103764205/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-01-18 18:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-16 15:42 [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2 Gerd Hoffmann
2024-01-16 15:42 ` [edk2-devel] [PATCH 1/2] OvmfPkg: remove TPM1_ENABLE build option Gerd Hoffmann
2024-01-17  9:35   ` Laszlo Ersek
2024-01-16 15:42 ` [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support Gerd Hoffmann
2024-01-17  9:47   ` Laszlo Ersek
2024-01-17 14:12     ` Gerd Hoffmann
2024-01-18 18:45       ` Laszlo Ersek
2024-01-16 15:46 ` [edk2-devel] [PATCH 0/2] OvmfPkg: drop support for TPM 1.2 Ard Biesheuvel
2024-01-16 23:38 ` Yao, Jiewen
2024-01-17 14:14   ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox