From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilias Apalodimas Date: Wed, 11 Nov 2020 16:46:56 +0200 Subject: [PATCH 2/2 v4] efi: Add basic EFI_TCG2_PROTOCOL support In-Reply-To: References: <20201111091812.400969-1-ilias.apalodimas@linaro.org> <20201111091812.400969-2-ilias.apalodimas@linaro.org> Message-ID: <20201111144656.GA469674@apalos.home> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On Wed, Nov 11, 2020 at 07:42:31AM -0700, Simon Glass wrote: > Hi Ilias, > > On Wed, 11 Nov 2020 at 02:18, Ilias Apalodimas > wrote: > > > > Since U-boot EFI implementation is getting richer it makes sense to > > add support for EFI_TCG2_PROTOCOL taking advantage of any hardware TPM > > available on the device. > > > > This is the initial implementation of the protocol which only adds > > support for GetCapability(). It's limited in the newer and safer > > TPMv2 devices. > > > > Signed-off-by: Ilias Apalodimas > > --- > > * changes since v3: > > - added check for maximum number of PCRs allowed > > - replaced multiple return Xl with goto out tags > > * changes since v2: > > - added description about include/efi_tcg2.h > > - switch bool to u8 for tpm_present_flag > > - removed superfluous 'default n' from Kconfig > > - use 'goto 'tag' when possible > > > > * changes since v1: > > - change return variable of platform_get_tpm2_device() when used > > - since more headers were included in patch #2 use them in offset > > calculations for all tpm commands > > - change the size of the response buffer regardless of what > > tpm2_get_capability() is doing > > include/efi_loader.h | 2 + > > include/efi_tcg2.h | 94 +++++++ > > lib/efi_loader/Kconfig | 7 + > > lib/efi_loader/Makefile | 1 + > > lib/efi_loader/efi_setup.c | 7 + > > lib/efi_loader/efi_tcg2.c | 539 +++++++++++++++++++++++++++++++++++++ > > 6 files changed, 650 insertions(+) > > create mode 100644 include/efi_tcg2.h > > create mode 100644 lib/efi_loader/efi_tcg2.c > > I will let Heinrich review this one. I do feel that the overly long > identifiers make the code hard to read. I completely agree. The reason I kept them that long, is that the TCG specs are quite confusing to follow, so I tried to adhere to the naming as much as possible. Regards /Ilias > > Regards, > Simon