From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>,
edk2-devel-groups-io <devel@edk2.groups.io>
Cc: "Ard Biesheuvel" <ard.biesheuvel@arm.com>,
"Eric Auger" <eric.auger@redhat.com>,
"Jordan Justen" <jordan.l.justen@intel.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Simon Hardy" <simon.hardy@itdev.co.uk>,
"Stefan Berger" <stefanb@linux.ibm.com>
Subject: Re: [PATCH 3/3] OvmfPkg/Tcg2ConfigPei: skip TPM-1.2 detection when building for ARM/AARCH64
Date: Thu, 21 May 2020 12:34:18 +0200 [thread overview]
Message-ID: <d608002f-1132-41aa-55d3-e20a1a97bf1b@redhat.com> (raw)
In-Reply-To: <20200520225841.17793-4-lersek@redhat.com>
On 5/21/20 12:58 AM, Laszlo Ersek wrote:
> 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>
> ---
> OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf | 11 +++++++--
> OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h | 4 ++++
> OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c | 25 ++++++++++++++++++++
> 3 files changed, 38 insertions(+), 2 deletions(-)
>
> diff --git a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> index aa996b7da778..194ebfba6409 100644
> --- a/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> +++ b/OvmfPkg/Tcg/Tcg2Config/Tcg2ConfigPei.inf
> @@ -21,9 +21,14 @@ [Defines]
>
> [Sources]
> Tcg2ConfigPeim.c
> - Tpm12Support.c
> Tpm12Support.h
>
> +[Sources.IA32, Sources.X64]
> + Tpm12Support.c
> +
> +[Sources.ARM, Sources.AARCH64]
> + Tpm12SupportNull.c
> +
> [Packages]
> MdePkg/MdePkg.dec
> MdeModulePkg/MdeModulePkg.dec
> @@ -35,9 +40,11 @@ [LibraryClasses]
> BaseLib
> DebugLib
> PeiServicesLib
> - Tpm12DeviceLib
> Tpm2DeviceLib
>
> +[LibraryClasses.IA32, LibraryClasses.X64]
> + Tpm12DeviceLib
> +
> [Guids]
> gEfiTpmDeviceSelectedGuid ## PRODUCES ## GUID # Used as a PPI GUID
> gEfiTpmDeviceInstanceTpm20DtpmGuid ## SOMETIMES_CONSUMES
> diff --git a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h b/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h
> index c739775d2353..d92c43253081 100644
> --- a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h
> +++ b/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h
> @@ -15,6 +15,10 @@
> /**
> 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.
> +
> @retval EFI_SUCCESS TPM-1.2 available. The Tpm12RequestUseTpm() and
> Tpm12SubmitCommand(TPM_ORD_GetTicks) operations
> (from the Tpm12DeviceLib class) have succeeded.
> diff --git a/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c b/OvmfPkg/Tcg/Tcg2Config/Tpm12SupportNull.c
> new file mode 100644
> index 000000000000..7bb377b9b9b0
> --- /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;
> +}
>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
next prev parent reply other threads:[~2020-05-21 10:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 22:58 [PATCH 0/3] OvmfPkg/Tcg2ConfigPei: fix ARM/AARCH64 build failure Laszlo Ersek
2020-05-20 22:58 ` [PATCH 1/3] OvmfPkg/Tcg2ConfigPei: clean up some lib class dependencies Laszlo Ersek
2020-05-21 10:29 ` Philippe Mathieu-Daudé
2020-05-21 18:04 ` Laszlo Ersek
2020-05-21 18:52 ` Philippe Mathieu-Daudé
2020-05-20 22:58 ` [PATCH 2/3] OvmfPkg/Tcg2ConfigPei: factor out InternalTpm12Detect() Laszlo Ersek
2020-05-21 10:33 ` Philippe Mathieu-Daudé
2020-05-20 22:58 ` [PATCH 3/3] OvmfPkg/Tcg2ConfigPei: skip TPM-1.2 detection when building for ARM/AARCH64 Laszlo Ersek
2020-05-21 10:34 ` Philippe Mathieu-Daudé [this message]
2020-05-21 8:26 ` [edk2-devel] [PATCH 0/3] OvmfPkg/Tcg2ConfigPei: fix ARM/AARCH64 build failure Laszlo Ersek
2020-05-21 9:12 ` Laszlo Ersek
2020-05-21 11:07 ` Laszlo Ersek
2020-05-21 8:37 ` Ard Biesheuvel
2020-05-21 9:08 ` Laszlo Ersek
2020-05-21 12:26 ` [edk2-devel] " Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d608002f-1132-41aa-55d3-e20a1a97bf1b@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox