From: Jarkko Sakkinen <jarkko@kernel.org>
To: tpm-protocol@lists.linux.dev
Cc: tpm2@lists.linux.dev
Subject: Re: [PATCH] perf(message): avoid buffer copy during command parsing
Date: Sun, 31 Aug 2025 18:35:09 +0300 [thread overview]
Message-ID: <aLRrrYwWAaPt8XcG@kernel.org> (raw)
In-Reply-To: <aLRn9pHieGfsxeeM@kernel.org>
On Sun, Aug 31, 2025 at 06:19:22PM +0300, Jarkko Sakkinen wrote:
> On Sun, Aug 31, 2025 at 06:01:45PM +0300, Jarkko Sakkinen wrote:
> > `tpm_parse_command` copies handles and parameters to a fixed-size temporary
> > 4 KiB buffer on the stack before invoking a command parser.
> >
> > Introduce `TpmParseCommandBody` trait implemented by `tpm_struct!`,
> > providing accessors for handles and parameters in the original command
> > buffer, thus zeroing out the large stack allocation.
> >
> > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> > ---
> > I plan to backport this also to 0.10.x branch, given signficancy.
>
> This is something left out of initial stretch, which I've had in my mind
> for some time. I postponed this change because stability was a priority
> over performance at the time.
>
> For the sake of symmetry I want to also rename `TpmHeaderCommand` as
> `TpmCommandBuild`, make `TpmHeader` decoupled from that trait, and
> finally change the constraint in `tpm_build_command` from `C:
> TpmHeaderCommand` to `C: TpmHeader + TpmCommandBuild`.
>
> This patch does not include that style change, given that it is first of
> all logically distinct and further cannot be backported to the 0.10.x
> branch.
As this is just backlog and dead obvious fix, I'll also apply this to
the main branch and backport to the 0.11.x branch.
BR, Jarkko
prev parent reply other threads:[~2025-08-31 15:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-31 15:01 [PATCH] perf(message): avoid buffer copy during command parsing Jarkko Sakkinen
2025-08-31 15:19 ` Jarkko Sakkinen
2025-08-31 15:35 ` 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=aLRrrYwWAaPt8XcG@kernel.org \
--to=jarkko@kernel.org \
--cc=tpm-protocol@lists.linux.dev \
--cc=tpm2@lists.linux.dev \
/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