From: Jarkko Sakkinen <jarkko@kernel.org>
To: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Srish Srinivasan <ssrish@linux.ibm.com>,
Jarkko Sakkinen <jarkko.sakkinen@iki.fi>,
linux-integrity@vger.kernel.org, keyrings@vger.kernel.org,
James.Bottomley@hansenpartnership.com, zohar@linux.ibm.com,
stefanb@linux.ibm.com, linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, nayna@linux.ibm.com,
rnsastry@linux.ibm.com
Subject: Re: [PATCH v2] keys/trusted_keys: reuse TPM version in option handling
Date: Mon, 5 Oct 2026 22:38:26 +0300 [thread overview]
Message-ID: <asP8sl912TVaCEIE@kernel.org> (raw)
In-Reply-To: <asO7zHFE3C6W8TV/@hallyn.com>
On Mon, Oct 05, 2026 at 10:01:32AM -0500, Serge E. Hallyn wrote:
> On Mon, Oct 05, 2026 at 11:31:46AM +0530, Srish Srinivasan wrote:
> > Hi Jarkko,
> >
> > On 10/5/26 8:54 AM, Jarkko Sakkinen wrote:
> > > On Fri, Oct 02, 2026 at 12:40:50PM +0530, Srish Srinivasan wrote:
> > > > Determine the TPM version once in the seal and unseal paths and reuse it
> > > > when allocating and parsing trusted key options. This avoids redundant TPM
> > > > version checks.
> > > So this is a bit nitpicking perhaps but a patch that would just clean
> > > the code up a bit would not be be worth of applying. Almost anything
> > > that "does nothing" goes to that bin.
> > >
> > > What I'm saying is that the conclusion in the last sentence goes to
> > > wrong direction but luckily the change has also feasible effects that
> > > we care about.
> > >
> > > By caching tpm_is_tpm2() there are less fallible sites in the key
> > > creation process, and reduced number of roundtrips with the TPM chip.
> > >
> > > Or from blackbox perspective it reduces I/O traffic between kernel
> > > and the hardware platform.
> >
> >
> > Yes, that makes sense. Thank you for pointing this out.
> >
> > I will revise the commit message to highlight the reduced failure
> > surface and I/O between the kernel and the TPM, and
> > send v3.
>
> And I've seen chips where every round trip is a roll of the dice as
> to whether the chip will become useless till next reboot, so that is
> a bigger win than I was first thinking.
This is true and happens quite often. And in CPU companies in fact all
the time with early FPGA implementations and very early ASIC based
software development platforms.
We also have opt-in bus encryption feature where extra roundtrips have
a horrible time cost.
Roundtrip removals are high value patches for both R&D and production,
and they are always most welcome.
Br, Jarkko
next prev parent reply other threads:[~2026-10-05 19:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 7:10 Srish Srinivasan
2026-10-05 3:24 ` Jarkko Sakkinen
2026-10-05 6:01 ` Srish Srinivasan
2026-10-05 15:01 ` Serge E. Hallyn
2026-10-05 19:38 ` Jarkko Sakkinen [this message]
2026-10-05 21:57 ` 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=asP8sl912TVaCEIE@kernel.org \
--to=jarkko@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=jarkko.sakkinen@iki.fi \
--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=nayna@linux.ibm.com \
--cc=rnsastry@linux.ibm.com \
--cc=serge@hallyn.com \
--cc=ssrish@linux.ibm.com \
--cc=stefanb@linux.ibm.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
all inboxes | Powered by JetHome®