All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Arun Menon <armenon@redhat.com>
Cc: linux-kernel@vger.kernel.org, Jason Gunthorpe <jgg@ziepe.ca>,
	Peter Huewe <peterhuewe@gmx.de>,
	linux-integrity@vger.kernel.org
Subject: Re: [PATCH v5 0/7] tpm_crb: Add command and response buffer chunking support
Date: Fri, 30 Oct 2026 18:02:11 +0200	[thread overview]
Message-ID: <auS_g_hMiDZIjSb5@kernel.org> (raw)
In-Reply-To: <auPXDdXZ8L8KOwUW@kernel.org>

On Fri, Oct 30, 2026 at 01:30:21AM +0200, Jarkko Sakkinen wrote:
> On Thu, Oct 29, 2026 at 11:45:34PM +0530, Arun Menon wrote:
> > 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] and
> > already merged into the mainline.
> > 
> > The whole series applied on top of for-next-tpm (including 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/20260601215410.517009-1-stefanb@linux.ibm.com/
> > 
> > v5
> > --
> > - Split [PATCH v4 06/06] into 2. The preparation patch separates the
> >   no-chunking send() and recv() from chunking.
> > - Fixed block comments to respect kernel's preferred multi-line style.
> > - Added citations to the TCG TPM and NIST FIPS documentations. Explained
> >   the logic and newly introduced registers in brief in the git commit
> >   message.
> > 
> > v4
> > --
> > - Rebased on master (or for-next-tpm, both point to the same commit).
> > - Resolved one conflict in PATCH v3 05/06, as TPM_BUFSIZE is declared in
> >   include/linux/tpm_command.h.
> > 
> > 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 (7):
> >   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: Factor crb_send()/crb_recv() bodies into helpers
> >   tpm_crb: Implement command and response chunking logic
> > 
> >  drivers/char/tpm/tpm_crb.c     | 226 +++++++++++++++++++++++++++------
> >  drivers/char/tpm/tpm_tis_i2c.c |   6 +-
> >  include/linux/tpm_command.h    |   2 +-
> >  3 files changed, 189 insertions(+), 45 deletions(-)
> > 
> > -- 
> > 2.56.0
> > 
> 
> Applied, thank you.

Could you send +1 version that:

1. Applies to my master.
2. There was one issue that kernel test bot complained.

The issue:

>> drivers/char/tpm/tpm_crb.c:464:34: sparse: sparse: cast removes address space '__iomem' of expression

No worries, just every other day stuff  but would help me if you carry
out these, thanks. And yeah, the first one is not even a real issue,
just unfortuate coincident :-)

I'll apply it as soon as I get it.

Br, Jarkko

      reply	other threads:[~2026-10-30 16:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 18:15 [PATCH v5 0/7] tpm_crb: Add command and response buffer chunking support Arun Menon
2026-10-29 18:15 ` [PATCH v5 1/7] tpm_crb: Add register definitions of TPM CRB chunking fields Arun Menon
2026-10-29 18:15 ` [PATCH v5 2/7] tpm_crb: Split start method into a separate header Arun Menon
2026-10-29 18:15 ` [PATCH v5 3/7] tpm_crb: Add start_cmd parameter to tpm_crb_start wrapper Arun Menon
2026-10-29 18:15 ` [PATCH v5 4/7] tpm: tis_i2c: Use local 4KB buffer to limit memory usage Arun Menon
2026-10-29 18:15 ` [PATCH v5 5/7] tpm: Increase TPM_BUFSIZE to 8KB for chunking support Arun Menon
2026-10-29 18:55   ` Jarkko Sakkinen
2026-10-29 18:15 ` [PATCH v5 6/7] tpm_crb: Factor crb_send()/crb_recv() bodies into helpers Arun Menon
2026-10-29 19:27   ` Jarkko Sakkinen
2026-10-29 18:15 ` [PATCH v5 7/7] tpm_crb: Implement command and response chunking logic Arun Menon
2026-10-29 19:28   ` Jarkko Sakkinen
2026-10-29 23:30 ` [PATCH v5 0/7] tpm_crb: Add command and response buffer chunking support Jarkko Sakkinen
2026-10-30 16:02   ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auS_g_hMiDZIjSb5@kernel.org \
    --to=jarkko@kernel.org \
    --cc=armenon@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.