Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751812AbdHAP73 (ORCPT ); Tue, 1 Aug 2017 11:59:29 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47734 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751368AbdHAP71 (ORCPT ); Tue, 1 Aug 2017 11:59:27 -0400 Date: Tue, 1 Aug 2017 10:59:19 -0500 From: George Wilson To: James Bottomley Cc: Michal =?iso-8859-1?Q?Such=E1nek?= , Christophe Ricard , linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net, Jarkko Sakkinen , apronin@chromium.org Subject: Re: [tpmdd-devel] tpm: read burstcount from TPM_STS in one 32-bit transaction References: <20170725150443.7cf8fc91@kitsune.suse.cz> <1501004171.3689.25.camel@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1501004171.3689.25.camel@linux.vnet.ibm.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-TM-AS-GCONF: 00 x-cbid: 17080115-0040-0000-0000-00000388E6D4 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007465; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000215; SDB=6.00896063; UDB=6.00448221; IPR=6.00676250; BA=6.00005506; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016482; XFM=3.00000015; UTC=2017-08-01 15:59:25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080115-0041-0000-0000-0000077D10B4 Message-Id: <20170801155919.GA26008@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-01_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708010263 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1530 Lines: 35 On Tue, Jul 25, 2017 at 10:36:11AM -0700, James Bottomley 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. > > We can probably get the PPC people to confirm this, I believe they have > a SPI attached TPM. All the current OpenPOWER hardware designs I'm aware of have the TPM on I2C. Trusted Computing support in OpenPOWER firmware depends on it being on I2C. > > James > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > tpmdd-devel mailing list > tpmdd-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tpmdd-devel