From: Jarkko Sakkinen <jarkko@kernel.org>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com,
James.Bottomley@hansenpartnership.com, keescook@chromium.org,
jsnitsel@redhat.com, ml.linux@elloe.vision,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/4] tpm: Simplify locality handling
Date: Thu, 6 May 2021 04:47:31 +0300 [thread overview]
Message-ID: <YJNKs8bUMGOzFre+@kernel.org> (raw)
In-Reply-To: <6722bf6f-1a3f-ee9c-55e2-cf63c64266a9@gmx.de>
On Wed, May 05, 2021 at 01:15:29AM +0200, Lino Sanfilippo wrote:
> Hi,
>
> On 03.05.21 at 17:50, Jarkko Sakkinen wrote:
> > What the heck is "simplification" and what that has to do with fixing
> > anything? I don't understand your terminology.
>
>
> The intention for this patch is not to fix anything. Please read the cover
> letter and the commit message.
> This patch is about making the locality handling easier by not claiming/releasing
> it multiple times over the driver life time, but claiming it once at driver
> startup and only releasing it at driver shutdown.
>
> Right now we have locality request/release combos in
>
> - probe_itpm()
> - tpm_tis_gen_interrupt()
> - tpm_tis_core_init()
> - tpm_chip_start()
>
> and there is still one combo missing for
>
> - tpm2_get_timeouts()
>
> which is the reason why we get the "TPM returned invalid status" bug in case
> of TPM2 (and this is the bug which is _incidentally_ fixed by this patch, see
> below).
>
> And if we are going to enable interrupts, we have to introduce yet another combo,
> for accessing the status register in the interrupt handler, since TPM 2.0
> requires holding the locality for writing to the status register. That makes
> 6 different code places in which we take and release the locality.
>
> With this patch applied we only take the locality at one place. Furthermore
> with interrupts enabled we dont have to claim the locality for each handler
> execution, saving us countless claim/release combinations at runtime.
>
> Hence the term "simplification" which is perfectly justified IMO.
>
> So again, this patch is "only" in preparation for the next patch when interrupts
> are actually enabled and we would have to take the locality in the interrupt
> handler without this patch.
So: what problem this patch does solve?
/Jarkko
next prev parent reply other threads:[~2021-05-06 1:47 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-01 13:57 [PATCH v3 0/4] Fixes for TPM interrupt handling Lino Sanfilippo
2021-05-01 13:57 ` [PATCH v3 1/4] tpm: Use a threaded interrupt handler Lino Sanfilippo
2021-05-03 15:14 ` Jarkko Sakkinen
2021-05-04 22:54 ` Lino Sanfilippo
2021-05-06 1:46 ` Jarkko Sakkinen
2021-05-01 13:57 ` [PATCH v3 2/4] tpm: Simplify locality handling Lino Sanfilippo
2021-05-03 15:50 ` Jarkko Sakkinen
2021-05-04 23:15 ` Lino Sanfilippo
2021-05-06 1:47 ` Jarkko Sakkinen [this message]
2022-03-24 17:04 ` [PATCH v3 0/4] Fixes for TPM interrupt handling Michael Niewöhner
2022-03-25 2:14 ` Jarkko Sakkinen
2022-03-25 12:32 ` Michael Niewöhner
2022-03-26 3:24 ` Lino Sanfilippo
2022-03-26 8:59 ` Michael Niewöhner
2022-03-30 15:19 ` Jarkko Sakkinen
2022-04-20 5:30 ` Jarkko Sakkinen
2022-04-20 5:32 ` Jarkko Sakkinen
2022-04-24 2:22 ` Lino Sanfilippo
2022-04-25 13:57 ` Jarkko Sakkinen
2022-03-30 15:18 ` Jarkko Sakkinen
2021-05-01 13:57 ` [PATCH v3 3/4] tpm: Fix test for interrupts Lino Sanfilippo
2021-05-03 15:52 ` Jarkko Sakkinen
2021-05-04 23:18 ` Lino Sanfilippo
2021-05-01 13:57 ` [PATCH v3 4/4] tpm: Only enable supported irqs Lino Sanfilippo
2021-05-01 19:09 ` Stefan Berger
2021-05-02 3:15 ` Lino Sanfilippo
2021-05-03 15:52 ` 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=YJNKs8bUMGOzFre+@kernel.org \
--to=jarkko@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=LinoSanfilippo@gmx.de \
--cc=jgg@ziepe.ca \
--cc=jsnitsel@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ml.linux@elloe.vision \
--cc=peterhuewe@gmx.de \
--cc=stefanb@linux.vnet.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 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.