mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Peter Huewe <peterhuewe@gmx.de>,
	Ashley Lai <ashley@ashleylai.com>,
	Marcel Selhorst <tpmdd@selhorst.net>,
	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,
	Will Arthur <will.c.arthur@intel.com>
Subject: Re: [PATCH v10 8/8] tpm: TPM 2.0 FIFO Interface
Date: Sun, 14 Dec 2014 11:09:18 -0500	[thread overview]
Message-ID: <548DB62E.7060504@linux.vnet.ibm.com> (raw)
In-Reply-To: <20141214154003.GA13338@intel.com>

On 12/14/2014 10:40 AM, Jarkko Sakkinen wrote:
> On Sun, Dec 14, 2014 at 09:48:26AM -0500, Stefan Berger wrote:
>> On 12/12/2014 02:46 PM, Jarkko Sakkinen wrote:
>>> Detect TPM 2.0 by sending idempotent TPM 2.x command. Ordinals for
>>> TPM 2.0 are higher than TPM 1.x commands so this should be fail-safe.
>>> Using STS3 is unreliable because some chips just report 0xff and not
>>> what the spec says.
>> TPM TIS 1.2 can report either 0xff or 0x00 for sts3 since that part of
>> register was not defined for this version but only for a later version. So,
>> unless the TIS 1.3 for TPM 2.0 is broken, it should report a bit _pattern_
>> (not plain 0x00 or 0xff) that you could apply the suggested mask to and
>> check then.
> I propose this: lets keep the bit ugly but approach for now and when
> there are TPM2 FIFOs available in the market move to your workaround.
> I think that would be the most reasonable middle road here.

You are now calling tpm2_gen_interrupt and are looking at the rc, which 
is the rc from tpm_transmit_cmd, which seems to make sure that the 
sending of the command went alright and the reception of the response. 
Is this good enough to distinguish between a TPM 2 and a TPM 1.2? If you 
send a valid TPM 2 command to a TPM 1.2 this will at least transmit the 
data ok, but the TPM will respond with a TPM 1.2 tag in the response. 
The way I understand the code, the rc does not include whether the 
response packet is a valid TPM 2 response packet and lets you conclude 
to a TPM2. I do something similar in upcoming QEMU patches where I send 
a valid TPM2 command for probing and if the tag(!) in the response is a 
TPM2 tag (0x8001 = TPM_ST_NO_SESSIONS), then it's a TPM 2, otherwise a 
TPM 1.2.

Did you test this with a TPM 1.2 ?

    Stefan

>
>>      Stefan
> /Jarkko
>


  reply	other threads:[~2014-12-14 16:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-12 19:46 [PATCH v10 0/8] TPM 2.0 support Jarkko Sakkinen
2014-12-12 19:46 ` [PATCH v10 1/8] tpm: merge duplicate transmit_cmd() functions Jarkko Sakkinen
2014-12-14 14:03   ` Stefan Berger
2014-12-14 14:57     ` Jarkko Sakkinen
2014-12-14 15:31       ` peterhuewe
2014-12-14 15:42         ` Jarkko Sakkinen
2014-12-12 19:46 ` [PATCH v10 2/8] tpm: two-phase chip management functions Jarkko Sakkinen
2014-12-12 19:46 ` [PATCH v10 3/8] tpm: fix raciness of PPI interface lookup Jarkko Sakkinen
2014-12-12 19:46 ` [PATCH v10 4/8] tpm: rename chip->dev to chip->pdev Jarkko Sakkinen
2014-12-12 19:46 ` [PATCH v10 5/8] tpm: device class for tpm Jarkko Sakkinen
2014-12-12 19:46 ` [PATCH v10 6/8] tpm: TPM 2.0 baseline support Jarkko Sakkinen
2014-12-12 19:46 ` [PATCH v10 7/8] tpm: TPM 2.0 CRB Interface Jarkko Sakkinen
2014-12-12 19:46 ` [PATCH v10 8/8] tpm: TPM 2.0 FIFO Interface Jarkko Sakkinen
2014-12-14 14:48   ` Stefan Berger
2014-12-14 15:40     ` Jarkko Sakkinen
2014-12-14 16:09       ` Stefan Berger [this message]
2014-12-14 18:27         ` Scot Doyle
2014-12-14 20:40           ` Stefan Berger
2014-12-14 23:13             ` Jarkko Sakkinen
2014-12-13 17:53 ` [tpmdd-devel] [PATCH v10 0/8] TPM 2.0 support Scot Doyle
2014-12-14 14:56   ` Jarkko Sakkinen
2014-12-15 20:17 ` Jarkko Sakkinen
2014-12-16 21:19   ` Aw: " Peter Huewe
2014-12-16 21:31     ` Jarkko Sakkinen
     [not found]     ` <trinity-c704c9fe-b92f-48bd-80cc-a452bd18cc28-1418765537847@3capp-gmx-bs15>
2014-12-16 21:34       ` Re: [tpmdd-devel] " 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=548DB62E.7060504@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=ashley@ashleylai.com \
    --cc=christophe.ricard@gmail.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jason.gunthorpe@obsidianresearch.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    --cc=trousers-tech@lists.sourceforge.net \
    --cc=will.c.arthur@intel.com \
    /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

Powered by JetHome