From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: "Michal Suchánek" <msuchanek-l3A5Bk7waGM@public.gmane.org>
Cc: Christophe Ricard
<christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: tpm: read burstcount from TPM_STS in one 32-bit transaction
Date: Tue, 1 Aug 2017 16:31:45 +0300 [thread overview]
Message-ID: <20170801133145.mqfen3bskzwwabwp@linux.intel.com> (raw)
In-Reply-To: <20170725201758.230de968-6hIufAJW0g4CVLCxKZUutA@public.gmane.org>
On Tue, Jul 25, 2017 at 08:17:58PM +0200, Michal Suchánek wrote:
> On Tue, 25 Jul 2017 10:36:11 -0700
> James Bottomley <jejb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> wrote:
>
> > On Tue, 2017-07-25 at 15:04 +0200, Michal Suchánek wrote:
> > > Hello,
> > >
> > > in commit 9754d45e9970 ("tpm: read burstcount from TPM_STS in one
> > > 32-bit transaction") you change reading of two 8-bit values to one
> > > 32bit read. This is obviously wrong wrt endianess unless the
> > > underlying tpm_tis_read32 does endian conversion.
> >
> > Some of the bus read primitives do do endianness conversions. The
> > problem is with the SPI attachment, which has unclear endianness. A
> > standard PCI bus attachment uses ioread32() which automatically
> > transforms from a little endian bus to the cpu endianness, however SPI
> > is forced to transfer the bytes one at a time over the serial bus and
> > then transform. The assumption seems to be that the TIS TPM is
> > replying in little endian format when SPI connected.
> >
>
> Yes, that makes sense.
>
> Thanks for clarification.
>
> Michal
Thank you for reporting this and thanks James for explaining this.
I do not have access to PPC hardware with SPI-TPM.
/Jarkko
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: James Bottomley <jejb@linux.vnet.ibm.com>,
Christophe Ricard <christophe.ricard@gmail.com>,
linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net,
apronin@chromium.org
Subject: Re: [tpmdd-devel] tpm: read burstcount from TPM_STS in one 32-bit transaction
Date: Tue, 1 Aug 2017 16:31:45 +0300 [thread overview]
Message-ID: <20170801133145.mqfen3bskzwwabwp@linux.intel.com> (raw)
In-Reply-To: <20170725201758.230de968@kitsune.suse.cz>
On Tue, Jul 25, 2017 at 08:17:58PM +0200, Michal Suchánek wrote:
> On Tue, 25 Jul 2017 10:36:11 -0700
> James Bottomley <jejb@linux.vnet.ibm.com> wrote:
>
> > On Tue, 2017-07-25 at 15:04 +0200, Michal Suchánek wrote:
> > > Hello,
> > >
> > > in commit 9754d45e9970 ("tpm: read burstcount from TPM_STS in one
> > > 32-bit transaction") you change reading of two 8-bit values to one
> > > 32bit read. This is obviously wrong wrt endianess unless the
> > > underlying tpm_tis_read32 does endian conversion.
> >
> > Some of the bus read primitives do do endianness conversions. The
> > problem is with the SPI attachment, which has unclear endianness. A
> > standard PCI bus attachment uses ioread32() which automatically
> > transforms from a little endian bus to the cpu endianness, however SPI
> > is forced to transfer the bytes one at a time over the serial bus and
> > then transform. The assumption seems to be that the TIS TPM is
> > replying in little endian format when SPI connected.
> >
>
> Yes, that makes sense.
>
> Thanks for clarification.
>
> Michal
Thank you for reporting this and thanks James for explaining this.
I do not have access to PPC hardware with SPI-TPM.
/Jarkko
next prev parent reply other threads:[~2017-08-01 13:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 13:04 tpm: read burstcount from TPM_STS in one 32-bit transaction Michal Suchánek
2017-07-25 17:36 ` [tpmdd-devel] " James Bottomley
2017-07-25 18:17 ` Michal Suchánek
[not found] ` <20170725201758.230de968-6hIufAJW0g4CVLCxKZUutA@public.gmane.org>
2017-08-01 13:31 ` Jarkko Sakkinen [this message]
2017-08-01 13:31 ` Jarkko Sakkinen
[not found] ` <1501004171.3689.25.camel-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2017-08-01 15:59 ` George Wilson
2017-08-01 15:59 ` [tpmdd-devel] " George Wilson
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=20170801133145.mqfen3bskzwwabwp@linux.intel.com \
--to=jarkko.sakkinen-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=msuchanek-l3A5Bk7waGM@public.gmane.org \
--cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/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.