[PATCH 2/2 v4] efi: Add basic EFI_TCG2_PROTOCOL support

Ilias Apalodimas ilias.apalodimas at linaro.org
Wed Nov 11 15:46:56 CET 2020


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
> <ilias.apalodimas at linaro.org> 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 <ilias.apalodimas at linaro.org>
> > ---
> > * 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


More information about the U-Boot mailing list