From: Jarkko Sakkinen <jarkko@kernel.org>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: linux-kernel@vger.kernel.org, keyrings@vger.kernel.org,
Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>,
Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
Mimi Zohar <zohar@linux.ibm.com>,
David Howells <dhowells@redhat.com>,
Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
"open list:TPM DEVICE DRIVER" <linux-integrity@vger.kernel.org>,
"open list:SECURITY SUBSYSTEM"
<linux-security-module@vger.kernel.org>
Subject: Re: [PATCH v2] tpm: Cleanup class for tpm_buf
Date: Thu, 26 Jun 2025 21:11:00 +0300 [thread overview]
Message-ID: <aF2NNHilFfZwBoxA@kernel.org> (raw)
In-Reply-To: <6a70dbdba3cef9f7ec580ce0147b1c89feb28074.camel@HansenPartnership.com>
On Thu, Jun 26, 2025 at 10:50:22AM -0400, James Bottomley wrote:
> On Thu, 2025-06-26 at 13:19 +0300, Jarkko Sakkinen wrote:
> > From: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>
> >
> > Create a cleanup class for struct tpm_buf using DEFINE_CLASS(), which
> > will guarantee that the heap allocated memory will be freed
> > automatically for the transient instances of this structure, when
> > they go out of scope.
> >
> > Wrap this all into help macro CLASS_TPM_BUF().
> >
> > A TPM buffer can now be declared trivially:
> >
> > CLASS_TPM_BUF(buf, buf_size);
>
> Well, that's not all ... you're also adding a size to the API that we
> didn't have before, which should at least be documented in the commit
> message and probably be a separate patch.
>
> What is the reason for this, though? The reason we currently use a
> page is that it's easy for the OS to manage (no slab fragmentation
> issues). The TCG reference platform defines this to be just under 4k
> (actually 4096-0x80) precisely because TPM implementations don't do
> scatter gather, so they don't want it going over an ARM page, so
> there's no danger of us ever needing more than a page.
Thanks for the valuable feedback.
I can drop "buf_size" parameter. It is not a priority, and I also
agree with your comments.
>
> Regards,
>
> James
BR, Jarkko
next prev parent reply other threads:[~2025-06-26 18:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 10:19 [PATCH v2] tpm: Cleanup class for tpm_buf Jarkko Sakkinen
2025-06-26 14:50 ` James Bottomley
2025-06-26 18:11 ` Jarkko Sakkinen [this message]
2025-06-26 22:35 ` Jarkko Sakkinen
2025-06-28 2:14 ` Jarkko Sakkinen
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=aF2NNHilFfZwBoxA@kernel.org \
--to=jarkko@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=dhowells@redhat.com \
--cc=jarkko.sakkinen@opinsys.com \
--cc=jgg@ziepe.ca \
--cc=jmorris@namei.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=peterhuewe@gmx.de \
--cc=serge@hallyn.com \
--cc=zohar@linux.ibm.com \
/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