Linux Integrity Measurement development
 help / color / mirror / Atom feed
* [PATCH v3 0/6] tpm_crb: Add command and response buffer chunking support
@ 2026-05-18 15:17 Arun Menon
  2026-05-18 15:17 ` [PATCH v3 1/6] tpm_crb: Add register definitions of TPM CRB chunking fields Arun Menon
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Arun Menon @ 2026-05-18 15:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jarkko Sakkinen, linux-integrity, Jason Gunthorpe, Peter Huewe,
	Arun Menon

The new version of TCG TPM v185 [1] supports sending data/commands in
chunks for the CRB (Command Response Buffer) interface. This is in line
with the initiative to support PQC algorithms.

This series implements the logic to send and receive larger TPM
cmd/rsp between the linux guest and the TPM backend in chunks.
Currently, the TPM CRB driver is limited by the physical size of the
MMIO window. When userspace attempts to send a payload that exceeds this
size, the driver rejects it.

This series introduces chunking support. The driver now checks the CRB
interface capability for CRB_INTF_CAP_CRB_CHUNK. If supported by the
backend, the driver will slice oversized commands into MMIO-sized
chunks, signalling the backend via CRB_START_NEXT_CHUNK, and finalizing
with CRB_START_INVOKE. Responses are also read back in a similar chunked
manner.

If the backend does not support chunking, the driver retains its legacy
behaviour and enforces the standard size limits.

This feature also requires the QEMU to interpret the data in chunks and
forward it to the TPM backend and subsequently dispatch the TPM response
in chunks back to the linux guest. This is implemented in [2]

This series depends on Jarkko's unmerged patch from the mailing list:
[PATCH v9 11/11] tpm-buf: Implement managed allocations.

Depends-on: <http://lore.kernel.org/20260125192526.782202-12-jarkko@kernel.org>

The whole series applied on top of for-next-tpm branch (with prerequisite)
can be found here:
https://github.com/armenon-rh/linux/tree/tpm-crb-linux

[1] https://trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-Platform-TPM-Profile-for-TPM-2p0-v1p07_Pub.pdf
[2] https://lore.kernel.org/qemu-devel/20260506075813.120781-1-armenon@redhat.com/

v3
--
- Split patch 2, so that the code is cleaner.
- Re-order the buffer size adjustment patch.
- Rename crb_trigger_tpm to tpm_crb_start.
- Add dispatching logic in send and recv functions. Chunking is
  separated from no-chunking for clarity.
- Increase TPM_BUFSIZE in the common file include/linux/tpm.h following,
  [PATCH v9 11/11] tpm-buf: Implement managed allocations
  https://lore.kernel.org/linux-integrity/20260125192526.782202-12-jarkko@kernel.org/

v2
--
- Add size checks before copying memory.
- Update TPM_BUFSIZE to 8KB.
- Commit messages updated to indicate motivation and logic of the change.

Arun Menon (6):
  tpm_crb: Add register definitions of TPM CRB chunking fields
  tpm_crb: Split start method into a separate header
  tpm_crb: Add start_cmd parameter to tpm_crb_start wrapper
  tpm: tis_i2c: Use local 4KB buffer to limit memory usage
  tpm: Increase TPM_BUFSIZE to 8kB for chunking support
  tpm_crb: Implement command and response chunking logic

 drivers/char/tpm/tpm_crb.c     | 257 +++++++++++++++++++++++++--------
 drivers/char/tpm/tpm_tis_i2c.c |   6 +-
 include/linux/tpm.h            |   2 +-
 3 files changed, 204 insertions(+), 61 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-05-21 23:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 15:17 [PATCH v3 0/6] tpm_crb: Add command and response buffer chunking support Arun Menon
2026-05-18 15:17 ` [PATCH v3 1/6] tpm_crb: Add register definitions of TPM CRB chunking fields Arun Menon
2026-05-18 15:17 ` [PATCH v3 2/6] tpm_crb: Split start method into a separate header Arun Menon
2026-05-21 23:17   ` Jarkko Sakkinen
2026-05-18 15:17 ` [PATCH v3 3/6] tpm_crb: Add start_cmd parameter to tpm_crb_start wrapper Arun Menon
2026-05-21 22:43   ` Jarkko Sakkinen
2026-05-18 15:17 ` [PATCH v3 4/6] tpm: tis_i2c: Use local 4KB buffer to limit memory usage Arun Menon
2026-05-21 23:23   ` Jarkko Sakkinen
2026-05-18 15:17 ` [PATCH v3 5/6] tpm: Increase TPM_BUFSIZE to 8kB for chunking support Arun Menon
2026-05-18 15:17 ` [PATCH v3 6/6] tpm_crb: Implement command and response chunking logic Arun Menon
2026-05-21 23:28   ` Jarkko Sakkinen
2026-05-21 21:53 ` [PATCH v3 0/6] tpm_crb: Add command and response buffer chunking support Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox