mbox series

[v5,0/7] Add vTPM 2.0 support to SLOF

Message ID 20200111012155.3350198-1-stefanb@linux.ibm.com
Headers show
Series Add vTPM 2.0 support to SLOF | expand

Message

Stefan Berger Jan. 11, 2020, 1:21 a.m. UTC
The following series of patches adds TPM support to SLOF.
In particular it adds the following:

- TPM driver for hardware interface and CRQ interface
- TPM 2.0 support; device initialization
- TPM logging area and firmware API to transfer it to the OS
- Some measurement code (Static Core Root Of Trust)
- TPM menu (accessible via 't' key during boot if TPM is available)
- Firmware API extensions following Power Firmware Doc

Having a vTPM attached to a VM provides the following benefits:

- enablement of trusted boot; this allow us to eventually extend the chain 
  of trust from the hypervisor to the guests
- enablement of attestation so that one can verify what software is 
  running on a machine
- provides TPM functionality to VMs, which includes a standardized 
  mechanism to store keys and other blobs
  (Linux trusted keys, GNU TLS's TPM extensions)

Regards,
    Stefan

v4->v5:
  - Cut down code to only support TPM 2.0

v3->v4:
  - Added TPM 2.0 support

v2->v3:
  - Addressed Thomas Huth's comments.
  - Rearranged patches and merged some patches.
  - Followed some of the changes made by K. O'Connor (SeaBIOS).

v1->v2:
  - Addressed Nikunj's comments
  - Since last post in August I added 3 more patches to the end of the series
    and one in 13th place.
Stefan Berger (7):
  slof: Implement SLOF_get_keystroke() and SLOF_reset()
  slof: Make linker script variables accessible
  qemu: Make print_version variable accessible
  tpm: Add TPM CRQ driver implementation
  tpm: Add sha1 implementation
  tcgbios: Add TPM 2.0 support and firmware API
  tcgbios: Implement menu to clear TPM 2 and activate its PCR banks

 board-qemu/Makefile                 |    2 +-
 board-qemu/include/version.h        |   19 +
 board-qemu/slof/Makefile            |   13 +-
 board-qemu/slof/OF.fs               |    3 +
 board-qemu/slof/tree.fs             |    3 +
 board-qemu/slof/vio-vtpm-cdriver.fs |  137 +++
 board-qemu/slof/vtpm-sml.fs         |  129 +++
 include/helpers.h                   |    4 +
 lib/Makefile                        |    2 +-
 lib/libtpm/Makefile                 |   50 ++
 lib/libtpm/Readme                   |   95 ++
 lib/libtpm/sha1.c                   |  204 +++++
 lib/libtpm/sha1.h                   |   20 +
 lib/libtpm/tcgbios.c                | 1240 +++++++++++++++++++++++++++
 lib/libtpm/tcgbios.h                |   33 +
 lib/libtpm/tcgbios_int.h            |  270 ++++++
 lib/libtpm/tpm.code                 |  139 +++
 lib/libtpm/tpm.in                   |   27 +
 lib/libtpm/tpm_drivers.c            |  466 ++++++++++
 lib/libtpm/tpm_drivers.h            |   82 ++
 slof/OF.h                           |   22 +
 slof/fs/packages/disk-label.fs      |   10 +-
 slof/fs/start-up.fs                 |   16 +
 slof/helpers.c                      |   17 +
 24 files changed, 2997 insertions(+), 6 deletions(-)
 create mode 100644 board-qemu/include/version.h
 create mode 100644 board-qemu/slof/vio-vtpm-cdriver.fs
 create mode 100644 board-qemu/slof/vtpm-sml.fs
 create mode 100644 lib/libtpm/Makefile
 create mode 100644 lib/libtpm/Readme
 create mode 100644 lib/libtpm/sha1.c
 create mode 100644 lib/libtpm/sha1.h
 create mode 100644 lib/libtpm/tcgbios.c
 create mode 100644 lib/libtpm/tcgbios.h
 create mode 100644 lib/libtpm/tcgbios_int.h
 create mode 100644 lib/libtpm/tpm.code
 create mode 100644 lib/libtpm/tpm.in
 create mode 100644 lib/libtpm/tpm_drivers.c
 create mode 100644 lib/libtpm/tpm_drivers.h
 create mode 100644 slof/OF.h