From: Jarkko Sakkinen <jarkko@kernel.org>
To: Arun Menon <armenon@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org,
Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>
Subject: Re: [RFC v2 4/5] tpm: Increase TPM_BUFSIZE to 8kB for chunking support
Date: Sat, 16 May 2026 04:20:35 +0300 [thread overview]
Message-ID: <agfGY1dtiPhi9iI-@kernel.org> (raw)
In-Reply-To: <agRbHXcRF2XI1d-x@fedora>
On Wed, May 13, 2026 at 04:36:05PM +0530, Arun Menon wrote:
> On Sat, May 09, 2026 at 06:07:11PM +0300, Jarkko Sakkinen wrote:
> > On Sat, May 09, 2026 at 05:54:25PM +0300, Jarkko Sakkinen wrote:
> > > On Tue, Mar 24, 2026 at 11:42:43PM +0530, Arun Menon wrote:
> > > > The size of the command is checked against TPM_BUFSIZE early on before
> > > > even sending it to the backend. We therefore need to increase the
> > > > TPM_BUFSIZE to allow support for larger commands.
> > > >
> > > > For now, 8KB seems sufficient for ML-KEM and ML-DSA algorithms and it is
> > > > also order-1 safe.
> > > >
> > > > Signed-off-by: Arun Menon <armenon@redhat.com>
> > > > ---
> > > > drivers/char/tpm/tpm.h | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> > > > index 87d68ddf270a7..26c3765fbd732 100644
> > > > --- a/drivers/char/tpm/tpm.h
> > > > +++ b/drivers/char/tpm/tpm.h
> > > > @@ -33,7 +33,7 @@
> > > > #endif
> > > >
> > > > #define TPM_MINOR 224 /* officially assigned */
> > > > -#define TPM_BUFSIZE 4096
> > > > +#define TPM_BUFSIZE 8192
> > > > #define TPM_NUM_DEVICES 65536
> > > > #define TPM_RETRY 50
> > > >
> > > > --
> > > > 2.53.0
> > > >
> > >
> > > Shouldn't this prepend previous patch?
> >
> > Also did you remark that tpm_buf would also need changes as it is fixed
> > to PAGE_SIZE?
>
> TPM_BUFSIZE can be increased, in its new location include/linux/tpm.h as
> per the patch : https://lore.kernel.org/linux-integrity/20260125192526.782202-12-jarkko@kernel.org/
> and I think that alone will take care of the check if (size > TPM_BUFSIZE)
> in tpm_common_write() in drivers/char/tpm/tpm-dev-common.c.
>
> However I was not able to apply the mbox file cleanly on the existing
> branches for-next-tpm and for-next-keys. I could apply them cleanly on
> the old branch (next). Please guide.
>
> I would only change the TPM_BUFSIZE set in
> [PATCH v9 11/11] tpm-buf: Implement managed allocations to 8192.
So.. why can't you just rebase them and resolve possible merge
conflicts? If you use git-am, you'll like want to use '-3' flag.
>
> >
> > I've made a patch that essentially makes tpm_buf size variable as caller
> > does kzalloc:
> >
> > https://lore.kernel.org/linux-integrity/20260125192526.782202-12-jarkko@kernel.org/
> >
> > I'd see this as pretty good long-term solution.
>
> Indeed.
>
> >
> > BR, Jarkko
> >
>
>
> Regards,
> Arun Menon
>
BR, Jarkko
next prev parent reply other threads:[~2026-05-16 1:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 18:12 [RFC v2 0/5] tpm_crb: Add command and response buffer chunking support Arun Menon
2026-03-24 18:12 ` [RFC v2 1/5] tpm_crb: Add register definitions of TPM CRB chunking fields Arun Menon
2026-05-09 14:41 ` Jarkko Sakkinen
2026-03-24 18:12 ` [RFC v2 2/5] tpm_crb: Add new wrapper function to invoke start method Arun Menon
2026-05-09 14:43 ` Jarkko Sakkinen
2026-05-13 11:08 ` Arun Menon
2026-03-24 18:12 ` [RFC v2 3/5] tpm_crb: Implement command and response chunking logic Arun Menon
2026-05-09 14:53 ` Jarkko Sakkinen
2026-05-13 11:07 ` Arun Menon
2026-03-24 18:12 ` [RFC v2 4/5] tpm: Increase TPM_BUFSIZE to 8kB for chunking support Arun Menon
2026-05-09 14:54 ` Jarkko Sakkinen
2026-05-09 15:07 ` Jarkko Sakkinen
2026-05-13 11:06 ` Arun Menon
2026-05-16 1:20 ` Jarkko Sakkinen [this message]
2026-05-13 11:09 ` Arun Menon
2026-03-24 18:12 ` [RFC v2 5/5] tpm: tis_i2c: Use local 4KB buffer to limit memory usage Arun Menon
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=agfGY1dtiPhi9iI-@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox