From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Jan Beulich <JBeulich@suse.com>
Cc: Matthew.Fioravante@jhuapl.edu, Ian.Campbell@citrix.com,
xen-devel@lists.xen.org
Subject: Re: [PATCH] drivers/tpm-xen: Change vTPM shared page ABI
Date: Fri, 22 Mar 2013 10:37:37 -0400 [thread overview]
Message-ID: <514C6CB1.1040701@tycho.nsa.gov> (raw)
In-Reply-To: <514C23B602000078000C7ABE@nat28.tlf.novell.com>
On 03/22/2013 04:26 AM, Jan Beulich wrote:
>>>> On 21.03.13 at 21:12, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> --- a/include/xen/interface/io/tpmif.h
>> +++ b/include/xen/interface/io/tpmif.h
>> @@ -1,7 +1,7 @@
>>
>> /******************************************************************************
>> * tpmif.h
>> *
>> - * TPM I/O interface for Xen guest OSes.
>> + * TPM I/O interface for Xen guest OSes, v2
>> *
>> * Permission is hereby granted, free of charge, to any person obtaining a copy
>> * of this software and associated documentation files (the "Software"), to
>> @@ -21,45 +21,30 @@
>> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>> * DEALINGS IN THE SOFTWARE.
>> *
>> - * Copyright (c) 2005, IBM Corporation
>> - *
>> - * Author: Stefan Berger, stefanb@us.ibm.com
>> - * Grant table support: Mahadevan Gomathisankaran
>> - *
>> - * This code has been derived from tools/libxc/xen/io/netif.h
>> - *
>> - * Copyright (c) 2003-2004, Keir Fraser
>> */
>>
>> #ifndef __XEN_PUBLIC_IO_TPMIF_H__
>> #define __XEN_PUBLIC_IO_TPMIF_H__
>>
>> -#include "../grant_table.h"
>> -
>> -struct tpmif_tx_request {
>> - unsigned long addr; /* Machine address of packet. */
>> - grant_ref_t ref; /* grant table access reference */
>> - uint16_t unused;
>> - uint16_t size; /* Packet size in bytes. */
>> +enum vtpm_shared_page_state {
>> + VTPM_STATE_IDLE, /* no contents / vTPM idle / cancel complete */
>> + VTPM_STATE_SUBMIT, /* request ready / vTPM working */
>> + VTPM_STATE_FINISH, /* response ready / vTPM idle */
>> + VTPM_STATE_CANCEL, /* cancel requested / vTPM working */
>> };
>> -struct tpmif_tx_request;
>> +/* The backend should only change state to IDLE or FINISH, while the
>> + * frontend should only change to SUBMIT or CANCEL. */
>>
>> -/*
>> - * The TPMIF_TX_RING_SIZE defines the number of pages the
>> - * front-end and backend can exchange (= size of array).
>> - */
>> -#define TPMIF_TX_RING_SIZE 1
>>
>> -/* This structure must fit in a memory page. */
>> +struct vtpm_shared_page {
>> + uint32_t length; /* request/response length in bytes */
>>
>> -struct tpmif_ring {
>> - struct tpmif_tx_request req;
>> -};
>> -struct tpmif_ring;
>> + uint8_t state; /* enum vtpm_shared_page_state */
>> + uint8_t locality; /* for the current request */
>> + uint8_t pad;
>>
>> -struct tpmif_tx_interface {
>> - struct tpmif_ring ring[TPMIF_TX_RING_SIZE];
>> + uint8_t nr_extra_pages; /* extra pages for long packets; may be zero */
>> + uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
>> };
>> -struct tpmif_tx_interface;
>>
>> #endif
>
> I'm relatively certain I said this before: For one, a patch to the
> master copy of this header is going to be needed. And you can't
> just rip out the old interface - existing consumers must continue
> to build (and work, with an old interface counterpart).
>
> Jan
>
The master copy of the header was changed in the patch series that this
message was a reply to (in patch 01/12). The changes are identical
except for whitespace conversion.
Since the structure names between the v1 and v2 interfaces do not
collide, the new shared page definition can just be added to the header
instead of replacing the old definitions; I will do that in the next
version. The reason I did not do that in the current version is that the
old interface could not have any users as it is not yet in an upstream
kernel.
--
Daniel De Graaf
National Security Agency
next prev parent reply other threads:[~2013-03-22 14:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-21 20:11 [PATCH v5 00/12] vTPM updates for 4.3 Daniel De Graaf
2013-03-21 20:11 ` [PATCH 01/12] mini-os/tpm{back, front}: Change shared page ABI Daniel De Graaf
2013-03-26 16:29 ` Matthew Fioravante
2013-03-26 16:52 ` [PATCH] drivers/tpm: add xen tpmfront interface (Re: [PATCH 01/12]...) Daniel De Graaf
2013-03-26 17:16 ` Matthew Fioravante
2013-03-21 20:11 ` [PATCH 02/12] mini-os/tpm{back, front}: Allow device repoens Daniel De Graaf
2013-03-21 20:11 ` [PATCH 03/12] mini-os/tpmback: set up callbacks before enumeration Daniel De Graaf
2013-03-21 20:11 ` [PATCH 04/12] mini-os/tpmback: Replace UUID field with opaque pointer Daniel De Graaf
2013-03-21 20:11 ` [PATCH 05/12] mini-os/tpmback: add tpmback_get_peercontext Daniel De Graaf
2013-03-21 20:11 ` [PATCH 06/12] stubdom/vtpm: correct the buffer size returned by TPM_CAP_PROP_INPUT_BUFFER Daniel De Graaf
2013-03-21 20:11 ` [PATCH 07/12] stubdom/vtpm: Support locality field Daniel De Graaf
2013-03-21 20:11 ` [PATCH 08/12] stubdom/vtpm: make state save operation atomic Daniel De Graaf
2013-03-21 20:11 ` [PATCH 09/12] stubdom/vtpm: support multiple backends Daniel De Graaf
2013-03-21 20:11 ` [PATCH 10/12] stubdom/vtpm: constrain locality by XSM label Daniel De Graaf
2013-03-21 20:11 ` [PATCH 11/12] stubdom/grub: send kernel measurements to vTPM Daniel De Graaf
2013-03-21 20:11 ` [PATCH 12/12] stubdom/Makefile: Fix gmp extract rule Daniel De Graaf
2013-04-11 14:54 ` Ian Campbell
2013-03-21 20:12 ` [PATCH] drivers/tpm-xen: Change vTPM shared page ABI Daniel De Graaf
2013-03-22 8:26 ` Jan Beulich
2013-03-22 14:37 ` Daniel De Graaf [this message]
2013-03-22 15:25 ` Jan Beulich
2013-03-22 16:46 ` Daniel De Graaf
2013-03-22 12:41 ` Konrad Rzeszutek Wilk
2013-03-22 14:37 ` Daniel De Graaf
2013-04-12 13:42 ` [PATCH v5 00/12] vTPM updates for 4.3 Ian Campbell
-- strict thread matches above, loose matches on Subject: below --
2013-01-23 18:29 [PATCH v4 00/13] vTPM new ABI, extensions Daniel De Graaf
2013-01-23 18:43 ` [PATCH] drivers/tpm-xen: Change vTPM shared page ABI Daniel De Graaf
2012-12-10 19:55 [PATCH v3 00/14] vTPM new ABI, extensions Daniel De Graaf
2012-12-10 20:00 ` [PATCH] drivers/tpm-xen: Change vTPM shared page ABI Daniel De Graaf
2012-12-11 11:52 ` Jan Beulich
2012-12-11 14:55 ` Daniel De Graaf
2012-11-20 16:16 [PATCH RFC] stubdom: " Fioravante, Matthew E.
2012-11-20 18:24 ` [PATCH] drivers/tpm-xen: " Daniel De Graaf
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=514C6CB1.1040701@tycho.nsa.gov \
--to=dgdegra@tycho.nsa.gov \
--cc=Ian.Campbell@citrix.com \
--cc=JBeulich@suse.com \
--cc=Matthew.Fioravante@jhuapl.edu \
--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;
as well as URLs for NNTP newsgroup(s).