Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754379AbbBKSsV (ORCPT ); Wed, 11 Feb 2015 13:48:21 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:34999 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754222AbbBKSsG (ORCPT ); Wed, 11 Feb 2015 13:48:06 -0500 Message-ID: <54DBA3A5.7090306@linux.vnet.ibm.com> Date: Wed, 11 Feb 2015 13:47:01 -0500 From: Stefan Berger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Jarkko Sakkinen CC: =?windows-1252?Q?Peter_H=FCwe?= , Ashley Lai , Marcel Selhorst , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, josh@joshtriplett.org, christophe.ricard@gmail.com, jason.gunthorpe@obsidianresearch.com, linux-api@vger.kernel.org, trousers-tech@lists.sourceforge.net Subject: Re: [PATCH] tpm, tpm_tis: fix TPM 2.0 probing References: <1423059669-31734-1-git-send-email-jarkko.sakkinen@linux.intel.com> <201502090008.47986.PeterHuewe@gmx.de> <20150209083947.GC29987@intel.com> <54D9F6A0.9010905@linux.vnet.ibm.com> <20150210125037.GB4313@intel.com> In-Reply-To: <20150210125037.GB4313@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15021118-0021-0000-0000-0000087A22B3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1912 Lines: 39 On 02/10/2015 07:50 AM, Jarkko Sakkinen wrote: > On Tue, Feb 10, 2015 at 07:16:32AM -0500, Stefan Berger wrote: >> On 02/09/2015 03:39 AM, Jarkko Sakkinen wrote: >>> On Mon, Feb 09, 2015 at 12:08:46AM +0100, Peter H?we wrote: >>>> Am Mittwoch, 4. Februar 2015, 15:21:09 schrieb Jarkko Sakkinen: >>>>> If during transmission system error was returned, the logic was to >>>>> incorrectly deduce that chip is a TPM 1.x chip. This patch fixes this >>>>> issue. Also, this patch changes probing so that message tag is used as the >>>>> measure for TPM 2.x, which should be much more stable. >>>> Is it aware that some TPMs may respond with 0x00C1 as TAG for TPM1.2 commands? >>> I guess none of the TPM 1.2 command answer with the tag 0x8002? >> >> FYI: pdf page 26 , section 6.1 explains the predictable return value for a >> TPM1.2 command seen by a TPM2 >> >> http://www.trustedcomputinggroup.org/files/static_page_files/8C68ADA8-1A4B-B294-D0FC06D3773F7DAA/TPM%20Rev%202.0%20Part%203%20-%20Commands%2001.16-code.pdf >> >> Following this: >> >> Sending a TPM1.2 command to a TPM2 should return a TPM1.2 header (tag = >> 0xc4) and error code (TPM_BADTAG = 0x1e) >> >> Sending a TPM 2 command to a TPM 2 will give a TPM 2 tag in the header. >> Sending a TPM 2 command to a TPM 1.2 will give a TPM 1.2 tag in the header >> and an error code. > Thank you for the information. Do you think that for some reason > tpm2_probe() shoould instead check that value is not this error > instead of checking that tag is 0x80002? Following your path, you are checking for TPM2_ST_NO_SESSION (0x8001), which looks correct to me. A TPM1.2 would never send this tag back. Stefan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/