linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: Getting weird TPM error after rebasing my tree to security/next-general
Date: Tue, 22 Jan 2019 15:29:28 +0200	[thread overview]
Message-ID: <20190122132910.GA2720@linux.intel.com> (raw)
In-Reply-To: <20190122025836.GH25163@ziepe.ca>

On Mon, Jan 21, 2019 at 07:58:36PM -0700, Jason Gunthorpe wrote:
> On Tue, Jan 22, 2019 at 03:02:18AM +0200, Jarkko Sakkinen wrote:
> > On Sun, Jan 20, 2019 at 06:04:13PM +0200, Jarkko Sakkinen wrote:
> > > On Fri, Jan 18, 2019 at 02:09:18PM -0800, James Bottomley wrote:
> > > > On Fri, 2019-01-18 at 16:25 +0200, Jarkko Sakkinen wrote:
> > > > > I get this on a Geminilake NUC after rebasing my maintainer trees:
> > > > > 
> > > > > tpm tpm0: A TPM error (-1) occurred attempting the self test
> > > > > 
> > > > > I checked the latest commit ID from drivers/char/tpm to make sure
> > > > > that I did not put anything broken to my last PR [1]. It works
> > > > > without issues.
> > > > > 
> > > > > In addition [2] gives me an empty diff.
> > > > > 
> > > > > Something outside of the TPM driver must have happened that breaks
> > > > > the driver. Any ideas?
> > > > > 
> > > > > [1] commit 9488585b21bef0df1217e510c7134905d1d376a7
> > > > > [2] git diff 9488585b21bef0df1217e510c7134905d1d376a7 master
> > > > > drivers/char/tpm/
> > > > 
> > > > I'm afraid you're going to have to bisect to find the offending in-
> > > > kernel commit, which is going to be painful since it seems to depend on
> > > > physical hardware.  My first instinct is that we're getting a zero
> > > > length read somewhere, but I still can't see anything in the merge
> > > > window that would cause that behaviour.
> > > 
> > > Yeah, I've started to bisect it (still 9 rounds to go).
> > 
> > Fails on commit 170d13ca3a2fdaaa0283399247631b76b441cca2. Still works on
> > preceding commit a959dc88f9c8900296ccf13e2f3e1cbc555a8917.
> 
> This changes the IO access pattern in memcpy_to/fromio.. Presumably
> CRB HW doesn't like the new 4 byte move? Swap each one in crb to
> memcpy to confirm..
> 
> If the HW requires particular access patterns you can't use
> memcpy_to/fromio

Did not have time to look at the commit at all but your deduction
is correct. I know it without testing.

Memory controller will feed 1's on unaligned read from IO memory,
and as we can see from the TPM header, this change causes two of
those:

struct tpm_output_header {
	__be16	tag;
	__be32	length;
	__be32	return_code;
} __packed;

/Jarkko

  reply	other threads:[~2019-01-22 13:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 14:25 Getting weird TPM error after rebasing my tree to security/next-general Jarkko Sakkinen
2019-01-18 22:09 ` James Bottomley
2019-01-20 16:04   ` Jarkko Sakkinen
2019-01-22  1:02     ` Jarkko Sakkinen
2019-01-22  2:58       ` Jason Gunthorpe
2019-01-22 13:29         ` Jarkko Sakkinen [this message]
2019-01-22 18:26           ` Linus Torvalds
2019-01-23 15:36             ` Jarkko Sakkinen
2019-01-23 18:43               ` Linus Torvalds
2019-01-29 13:20                 ` Jarkko Sakkinen
2019-01-31 12:26                   ` Jarkko Sakkinen
2019-01-31 16:04                     ` Jarkko Sakkinen
2019-01-31 17:06                       ` Jarkko Sakkinen
2019-01-31 17:43                         ` Linus Torvalds
2019-01-31 18:47                           ` Jarkko Sakkinen
2019-01-31 18:35                         ` Jarkko Sakkinen
2019-01-31 18:51                           ` Linus Torvalds
2019-01-31 18:52                             ` Linus Torvalds
2019-01-31 19:10                               ` Linus Torvalds
2019-01-31 19:47                                 ` Winkler, Tomas
2019-02-01  8:12                                   ` Jarkko Sakkinen
2019-01-31 20:07                                 ` Winkler, Tomas
2019-01-31 20:47                                 ` Jarkko Sakkinen
2019-01-31 21:58                                   ` Linus Torvalds
2019-01-31 23:31                                     ` Jerry Snitselaar
2019-02-01 11:40                                       ` Jarkko Sakkinen
2019-01-31 20:45                             ` Jarkko Sakkinen
2019-02-01 18:04                               ` Linus Torvalds
2019-02-04 11:58                                 ` Jarkko Sakkinen
2019-01-23 20:11               ` 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=20190122132910.GA2720@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).