public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: <konrad.wilk@oracle.com>, <tpmdd-devel@lists.sourceforge.net>,
	<linux-kernel@vger.kernel.org>, <leosilva@linux.vnet.ibm.com>,
	<shpedoikal@gmail.com>, <xen-devel@lists.xen.org>,
	<mail@srajiv.net>, <adlai@linux.vnet.ibm.com>, <tpmdd@sirrix.com>,
	<PeterHuewe@gmx.de>
Subject: Re: [PATCH v4] drivers/tpm: add xen tpmfront interface
Date: Wed, 24 Jul 2013 18:09:30 +0100	[thread overview]
Message-ID: <51F00A4A.5060005@citrix.com> (raw)
In-Reply-To: <51ED5BD2.7080601@tycho.nsa.gov>

On 22/07/13 17:20, Daniel De Graaf wrote:
> On 07/22/2013 11:18 AM, David Vrabel wrote:
>> On 01/07/13 22:34, Daniel De Graaf wrote:
>>> This is a complete rewrite of the Xen TPM frontend driver, taking
>>> advantage of a simplified frontend/backend interface and adding support
>>> for cancellation and timeouts.  The backend for this driver is provided
>>> by a vTPM stub domain using the interface in Xen 4.3.
>> [...]
>>> --- /dev/null
>>> +++ b/Documentation/xen-tpmfront.txt
>>
>> Suggest putting this in Documentation/tpm/.
> 
> OK.
> 
>>> --- /dev/null
>>> +++ b/drivers/char/tpm/xen-tpmfront.c
>> [...]
>>> +static void backend_changed(struct xenbus_device *dev,
>>> +        enum xenbus_state backend_state)
>>> +{
>>> +    int val;
>>
>> Hrm. I don't like how every front/back pair invents their own variation
>> of the state machine.
>>
>> Please document the front and back state machines in
>> xen/include/public/io/tpmif.h (and the correspoding copy in Linux).
> 
> Is there a standard state machine that would allow devices to avoid
> inventing their own?

That would be nice wouldn't it?  But, no, there isn't one -- even
netfront and blkfront are different.

> Otherwise, this is what I plan to add to the header:
> /*
>  * Xenbus state machine
>  *
>  * Device open:
>  *   1. Both ends start in XenbusStateInitialising
>  *   2. Backend transitions to InitWait (frontend does not wait on this
> step)
>  *   3. Frontend populates ring-ref, event-channel, feature-protocol-v2
>  *   4. Frontend transitions to Initialised
>  *   5. Backend maps grant and event channel, verifies feature-protocol-v2
>  *   6. Backend transitions to Connected
>  *   7. Frontend verifies feature-protocol-v2, transitions to Connected
>  *
>  * Device close:
>  *   1. State is changed to XenbusStateClosing
>  *   2. Frontend transitions to Closed
>  *   3. Backend unmaps grant and event, changes state to InitWait
>  */

That's good, thanks.

David

      reply	other threads:[~2013-07-24 17:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01 21:34 [PATCH v4] drivers/tpm: add xen tpmfront interface Daniel De Graaf
2013-07-01 22:32 ` [tpmdd-devel] " Peter Hüwe
2013-07-01 22:57   ` Konrad Rzeszutek Wilk
2013-07-22 15:18 ` David Vrabel
2013-07-22 16:20   ` Daniel De Graaf
2013-07-24 17:09     ` David Vrabel [this message]

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=51F00A4A.5060005@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=PeterHuewe@gmx.de \
    --cc=adlai@linux.vnet.ibm.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=konrad.wilk@oracle.com \
    --cc=leosilva@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@srajiv.net \
    --cc=shpedoikal@gmail.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@sirrix.com \
    --cc=xen-devel@lists.xen.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