Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7399450imu; Tue, 22 Jan 2019 05:31:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7rVzb0QI+vGENbF+OnEjF5A1U9ePiaCZykDkJlf/CKt4jfjknrOzHDRPSrvcCLOn+BOhd+ X-Received: by 2002:a62:1a44:: with SMTP id a65mr34057524pfa.30.1548163917718; Tue, 22 Jan 2019 05:31:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548163917; cv=none; d=google.com; s=arc-20160816; b=0ndYJmMRopxWSU82pwEHkQwn/RFtSw5Lyi3jT++tqgiVINTY3D2W6Mg77ERGInPbvq umNTePlMbk49c2pIyx4DviMC5Z7lLeY90zQA7uy2DJmklraB1FrI0TfHErvXxojp5bUJ eNBLrcxxHy6IguMrR7aPulXYsnD5EgOPSjMMXnxayzAPdb7mhgRsWnPdYzgi41VbjoxU 009Cg/fJW6bc2XhcyYHuW8lM/5/B5LwBxovCXj1YcHzxP3YtYkiN+Oyu/HMN7WBwP3xO S3EvxkaHb2ozNZ6ldul2RPo5mjnOedT/GojBMeu48jyUj0FmpycFUigPUjA8WKTw7wSO Zk7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oM1trOOsDzcpiNGRld761tfsAxM4IatDsuVGnQelS6Y=; b=aA9yDt+3fadAwbdcEDY3u4/mj2Gz6BhgudoTArxeyuSEm31fafxsr+/DZSmezLllOF hb5VcCgToX7atin8F0QedncZ60XibMcCYV+cs/oBebY3LIjdfUTqWLJDlvg4hINWqRel gxzmADpDv5YNAYy56e9mRKIhcYkQ0fDb1O6KvHnF+RRz8WLsEije9r74WF5eymsWOA55 mzPCwKcENfxo7wlqrCEQbo+EtTGrLSZLhLZseRzefFAf9kZdo2utmMK0443WOmzrMKiE OafpXQxG5DcD2oOhS3z2c82QmESmbzSU6pLyjIUrjdFDXzJR7ZgTz0beX1n4Vg5SuZkJ q7rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si15108142plz.233.2019.01.22.05.31.37; Tue, 22 Jan 2019 05:31:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728540AbfAVN3e (ORCPT + 99 others); Tue, 22 Jan 2019 08:29:34 -0500 Received: from mga01.intel.com ([192.55.52.88]:3672 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727936AbfAVN3d (ORCPT ); Tue, 22 Jan 2019 08:29:33 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2019 05:29:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,506,1539673200"; d="scan'208";a="293447219" Received: from fflynn-mobl.ger.corp.intel.com (HELO localhost) ([10.249.254.153]) by orsmga005.jf.intel.com with ESMTP; 22 Jan 2019 05:29:30 -0800 Date: Tue, 22 Jan 2019 15:29:28 +0200 From: Jarkko Sakkinen To: Jason Gunthorpe , Linus Torvalds Cc: James Bottomley , 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 Message-ID: <20190122132910.GA2720@linux.intel.com> References: <20190118142559.GA4080@linux.intel.com> <1547849358.2794.90.camel@HansenPartnership.com> <20190120160413.GB30478@linux.intel.com> <20190122010218.GA26713@linux.intel.com> <20190122025836.GH25163@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190122025836.GH25163@ziepe.ca> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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