Skip to content

Add vTPM emulator support for ppc64 platform

Stefan Berger qemu-devel 2 versions – Applied

Status from this message: Applied to ppc-for-5.0, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest6 patches 2 repliesApplied
  2. v86 patches 8 repliesSuperseded

Changes in v9 from the cover letter

- Allocating buffer now so we can use VMSTATE_VBUFFER_UINT32 for the regular buffer (no more suspend buffer)

Patches in v9 Applied

#Subject and filesSizeRepliesApplied
1/6tpm: Move tpm_tis_show_buffer to tpm_util.chw/tpm/tpm_tis.c hw/tpm/tpm_util.c hw/tpm/tpm_util.h +1 more+33 -290 replies
2/6spapr: Implement get_dt_compatible() callbackhw/ppc/spapr_vio.c include/hw/ppc/spapr_vio.h+10 -20 replies
3/6tpm_spapr: Support TPM for ppc64 using CRQ based interfacedocs/specs/tpm.txt hw/tpm/Kconfig hw/tpm/Makefile.objs +4 more+423 -40 replies
4/6tpm_spapr: Support suspend and resumehw/tpm/tpm_spapr.c hw/tpm/trace-events+53 -11 reply
5/6hw/ppc/Kconfig: Enable TPM_SPAPR as part of PSERIES confighw/ppc/Kconfig+1 -00 replies
6/6docs/specs/tpm: reST-ify TPM documentationdocs/specs/index.rst docs/specs/tpm.rst docs/specs/tpm.txt+504 -4450 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchMarc-André LureauDavid GibsonPhilippe Mathieu-DaudéStefan Berger
1/6R-b R-b
2/6R-b R-b
3/6R-b
4/6R-b
5/6R-b R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v9 thread

Cover letter [PATCH v9 0/6] Add vTPM emulator support for ppc64 platform

The following series of patches adds vTPM emulator support for the ppc64 platform (pSeries).

It can be tested as follows with swtpm/libtpms:

mkdir /tmp/mytpm1
swtpm socket --tpmstate dir=/tmp/mytpm1 \
--ctrl type=unixio,path=/tmp/mytpm1/swtpm-sock \
--log level=20

If TPM 2 is desired, add --tpm2 as parameter to the above.

In another terminal start QEMU:

sudo ./ppc64-softmmu/qemu-system-ppc64 -display sdl \
	-machine pseries,accel=kvm \
	-m 1024 -bios slof.bin -boot menu=on \
	-nodefaults -device VGA -device pci-ohci -device usb-kbd \
	-chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \
	-tpmdev emulator,id=tpm0,chardev=chrtpm \
	-device tpm-spapr,tpmdev=tpm0 \
	-device spapr-vscsi,id=scsi0,reg=0x00002000 \
	-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0 \
	-drive file=test.img,format=raw,if=none,id=drive-virtio-disk0

Links:
- libtpms: https://github.com/stefanberger/libtpms/wiki
- swtpm: https://github.com/stefanberger/swtpm/wiki

Changes:
v8->v9:
- Allocating buffer now so we can use VMSTATE_VBUFFER_UINT32 for the regular buffer (no more suspend buffer)

v7->v8:
- Folded documentation patch into 3rd patch
- Added Marc-André's patch to end of series

v6->v7:
- Implemented get_dt_compatible() and using it
- Moved tpm_this_show_buffer to tpm_util.c

v5->v6:
- adjusted names of structures and simplified
- only transmitting min. necessary bytes to pass to VM after resume
- addressed other issues pointed out by D. Gibson

v4->v5:
- use runstate_check(RUN_STATE_FINISH_MIGRATE) to check whether devices are suspending; ditch 3 patches in this series that tried to do similar

v3->v4:
- addressed comments to v3
- reworked suspend/resume support that requires extensions to backends

v2->v3:
- patch 1: a TPM 2 is identified by IBM,vtpm20 in the compatible node
- patch 1: convert to tracing to display Tx and Rx buffers
- added documentation patch
- added patch to enable TPM device as part of pSeries

v1->v2:
- followed Cedric Le Goater's suggestions to patch 1
- send appropriate CRQ error responses if DMA read or write fails
- renamed tpm_spapr_got_payload to tpm_spapr_process_cmd and pass endianess-adjusted data pointer from CRQ to it

Regards,
Stefan

Marc-André Lureau (1):
docs/specs/tpm: reST-ify TPM documentation

Stefan Berger (5):
tpm: Move tpm_tis_show_buffer to tpm_util.c
spapr: Implement get_dt_compatible() callback
tpm_spapr: Support TPM for ppc64 using CRQ based interface
tpm_spapr: Support suspend and resume hw/ppc/Kconfig: Enable TPM_SPAPR as part of PSERIES config

 docs/specs/index.rst       |   1 +
 docs/specs/tpm.rst         | 503 +++++++++++++++++++++++++++++++++++++
 docs/specs/tpm.txt         | 427 -------------------------------
 hw/ppc/Kconfig             |   1 +
 hw/ppc/spapr_vio.c         |  11 +-
 hw/tpm/Kconfig             |   6 +
 hw/tpm/Makefile.objs       |   1 +
 hw/tpm/tpm_spapr.c         | 429 +++++++++++++++++++++++++++++++
 hw/tpm/tpm_tis.c           |  32 +--
 hw/tpm/tpm_util.c          |  25 ++
 hw/tpm/tpm_util.h          |   3 +
 hw/tpm/trace-events        |  16 +-
 include/hw/ppc/spapr_vio.h |   1 +
 include/sysemu/tpm.h       |   3 +
 qapi/tpm.json              |   6 +-
 15 files changed, 1004 insertions(+), 461 deletions(-)
 create mode 100644 docs/specs/tpm.rst
 delete mode 100644 docs/specs/tpm.txt
 create mode 100644 hw/tpm/tpm_spapr.c
Signature · 1 line
2.24.1