audk/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf

55 lines
1.5 KiB
INI
Raw Normal View History

## @file
# 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
# 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 = BF7F2B0C-9F2F-4889-AB5C-12460022BE87
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
ENTRY_POINT = Tcg2ConfigPeimEntryPoint
[Sources]
Tcg2ConfigPeim.c
Tpm12Support.h
OvmfPkg/Tcg2ConfigPei: skip TPM-1.2 detection when building for ARM/AARCH64 Dating back to commits f5cb3767038e and ddd34a818315d, the "ArmVirtPkg/ArmVirtQemu.dsc" platform includes the "OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf" module when the TPM2_ENABLE build flag is defined. This was regressed in commit 89236992913f, which added a Tpm12DeviceLib dependency to Tcg2ConfigPei. "ArmVirtQemu.dsc" does not resolve that class to any instance, so now we get a build failure: > build.py... > ArmVirtPkg/ArmVirtQemu.dsc(...): error 4000: Instance of library class > [Tpm12DeviceLib] is not found > in [OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf] [AARCH64] > consumed by module [OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf] The TPM-1.2 code in OvmfPkg/Tcg2ConfigPei is limited to a special use case (a kind of physical TPM-1.2 assignment), and that has never applied to "ArmVirtQemu.dsc". Short-circuit the TPM-1.2 detection in the ARM/AARCH64 builds of OvmfPkg/Tcg2ConfigPei, removing the Tpm12DeviceLib dependency. Functionally, this patch is a no-op on IA32 / X64. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Eric Auger <eric.auger@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Simon Hardy <simon.hardy@itdev.co.uk> Cc: Stefan Berger <stefanb@linux.ibm.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2728 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200520225841.17793-4-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-05-21 00:58:41 +02:00
Tpm12SupportNull.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
OvmfPkg/OvmfPkg.dec
SecurityPkg/SecurityPkg.dec
[LibraryClasses]
PeimEntryPoint
DebugLib
PeiServicesLib
Tpm2DeviceLib
[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