summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2020-05-21 00:58:41 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-05-21 12:23:37 +0000
commit74f90d38c446e247469e2a775970eeed89216909 (patch)
treeade08bea2778127ad5a45a70b03196cdc80311b8 /OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c
parentfc72a6ceaa4859ef3043b706100827d4fbcc3bed (diff)
downloadedk2-74f90d38c446e247469e2a775970eeed89216909.tar.gz
edk2-74f90d38c446e247469e2a775970eeed89216909.tar.bz2
edk2-74f90d38c446e247469e2a775970eeed89216909.zip
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>
Diffstat (limited to 'OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c')
-rw-r--r--OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c b/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c
new file mode 100644
index 0000000000..7bb377b9b9
--- /dev/null
+++ b/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c
@@ -0,0 +1,25 @@
+/** @file
+ Null implementation of InternalTpm12Detect(), always returning
+ EFI_UNSUPPORTED.
+
+ Copyright (C) 2020, Red Hat, Inc.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "Tpm12Support.h"
+
+/**
+ Detect the presence of a TPM with interface version 1.2.
+
+ @retval EFI_UNSUPPORTED The platform that includes this particular
+ implementation of the function does not support
+ TPM-1.2.
+**/
+EFI_STATUS
+InternalTpm12Detect (
+ VOID
+ )
+{
+ return EFI_UNSUPPORTED;
+}