[edk2-devel] [PATCH v2 3/5] OvmfPkg: create Tcg12ConfigPei.inf

Gerd Hoffmann posted 5 patches 4 years, 3 months ago
There is a newer version of this series
[edk2-devel] [PATCH v2 3/5] OvmfPkg: create Tcg12ConfigPei.inf
Posted by Gerd Hoffmann 4 years, 3 months ago
Split Tcg2ConfigPei.inf into two variants: Tcg12ConfigPei.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.

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

No functional change.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 OvmfPkg/OvmfTpmComponentsPei.dsc.inc                  |  2 +-
 .../{Tcg2ConfigPei.inf => Tcg12ConfigPei.inf}         | 11 ++---------
 OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf              | 11 +----------
 OvmfPkg/OvmfTpmPei.fdf.inc                            |  2 +-
 4 files changed, 5 insertions(+), 21 deletions(-)
 copy OvmfPkg/Tcg/Tcg2Config/{Tcg2ConfigPei.inf => Tcg12ConfigPei.inf} (82%)

diff --git a/OvmfPkg/OvmfTpmComponentsPei.dsc.inc b/OvmfPkg/OvmfTpmComponentsPei.dsc.inc
index 99fa7c13b3e7..87d491da5047 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/Tcg12ConfigPei.inf
   SecurityPkg/Tcg/TcgPei/TcgPei.inf
   SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
     <LibraryClasses>
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
similarity index 82%
copy from OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
copy to OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
index 39d1deeed16b..e8e0b88e6058 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
@@ -1,5 +1,5 @@
 ## @file
-# Set TPM device type
+# 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
@@ -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/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
index 39d1deeed16b..51078c981374 100644
--- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
+++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
@@ -1,5 +1,5 @@
 ## @file
-# Set TPM device type
+# Set TPM device type - supports TPM 2.0 only
 #
 # 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
@@ -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/OvmfTpmPei.fdf.inc b/OvmfPkg/OvmfTpmPei.fdf.inc
index 9aefd73d219c..709a608cc3bd 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/Tcg12ConfigPei.inf
 INF  SecurityPkg/Tcg/TcgPei/TcgPei.inf
 INF  SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf
 INF  SecurityPkg/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf
-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82633): https://edk2.groups.io/g/devel/message/82633
Mute This Topic: https://groups.io/mt/86575360/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v2 3/5] OvmfPkg: create Tcg12ConfigPei.inf
Posted by Stefan Berger 4 years, 3 months ago
On 10/25/21 8:15 AM, Gerd Hoffmann wrote:
> Split Tcg2ConfigPei.inf into two variants: Tcg12ConfigPei.inf with TPM
> 1.2 backward compatibility included and Tcg2ConfigPei.inf supporting TPM

backward compatibility included -> support


> 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.
>
> Switch x86 builds to Tcg12ConfigPei.inf, so they continue to
> have TPM 1.2 support.
>
> No functional change.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>

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



> ---
>   OvmfPkg/OvmfTpmComponentsPei.dsc.inc                  |  2 +-
>   .../{Tcg2ConfigPei.inf => Tcg12ConfigPei.inf}         | 11 ++---------
>   OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf              | 11 +----------
>   OvmfPkg/OvmfTpmPei.fdf.inc                            |  2 +-
>   4 files changed, 5 insertions(+), 21 deletions(-)
>   copy OvmfPkg/Tcg/Tcg2Config/{Tcg2ConfigPei.inf => Tcg12ConfigPei.inf} (82%)
>
> diff --git a/OvmfPkg/OvmfTpmComponentsPei.dsc.inc b/OvmfPkg/OvmfTpmComponentsPei.dsc.inc
> index 99fa7c13b3e7..87d491da5047 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/Tcg12ConfigPei.inf
>     SecurityPkg/Tcg/TcgPei/TcgPei.inf
>     SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.inf {
>       <LibraryClasses>
> diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
> similarity index 82%
> copy from OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> copy to OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
> index 39d1deeed16b..e8e0b88e6058 100644
> --- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> +++ b/OvmfPkg/Tcg/Tcg2Config/Tcg12ConfigPei.inf
> @@ -1,5 +1,5 @@
>   ## @file
> -# Set TPM device type
> +# 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
> @@ -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/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> index 39d1deeed16b..51078c981374 100644
> --- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> +++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> @@ -1,5 +1,5 @@
>   ## @file
> -# Set TPM device type
> +# Set TPM device type - supports TPM 2.0 only
>   #
>   # 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
> @@ -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/OvmfTpmPei.fdf.inc b/OvmfPkg/OvmfTpmPei.fdf.inc
> index 9aefd73d219c..709a608cc3bd 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/Tcg12ConfigPei.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 (#82638): https://edk2.groups.io/g/devel/message/82638
Mute This Topic: https://groups.io/mt/86575360/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-