qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: imammedo@redhat.com, Kevin O'Connor <kevin@koconnor.net>,
	qemu-devel@nongnu.org, quan.xu@intel.com
Subject: Re: [Qemu-devel] [PATCH v3 3/6] Support Physical Presence Interface Spec
Date: Tue, 2 Jun 2015 11:15:25 +0200	[thread overview]
Message-ID: <20150602110702-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <556D1EDE.8060100@linux.vnet.ibm.com>

On Mon, Jun 01, 2015 at 11:11:26PM -0400, Stefan Berger wrote:
> On 05/31/2015 02:11 PM, Michael S. Tsirkin wrote:
> >On Tue, May 26, 2015 at 05:33:41PM -0400, Stefan Berger wrote:
> >>For automated management of a TPM device, implement the TCG Physical Presence
> >>Interface Specification that allows a root user on Linux (for example) to set
> >>an opcode for a sequence of TPM operations that the BIOS is supposed to execute
> >>upon reboot of the physical or virtual machine. A sequence of operations may for
> >>example involve giving up ownership of the TPM and activating and enabling the
> >>device.
> >>
> >>The sequences of operations are defined in table 2 in the specs to be found
> >>at the following link:
> >>
> >>http://www.trustedcomputinggroup.org/resources/tcg_physical_presence_interface_specification
> >>
> >>As an example, in recent versions of Linux the opcode (5) can be set as
> >>follows:
> >>
> >>cd /sys/devices/pnp0/00\:04/ppi
> >>
> >>echo 5 > request
> >>
> >>This ACPI implementation assumes that the underlying firmware (SeaBIOS)
> >>has 'thrown an anchor' into the f-segment. The anchor is identified by
> >>two signatures (TCG_MAGIC) surrounding a 64bit pointer. The structure
> >>in the f-segment is write-protected and holds a pointer to a structure
> >>in high memmory
> >memory
> >
> >>area where the ACPI code writes the opcode into and
> >>where it can read the last response from the BIOS.
> >>
> >>The supported opcodes are 1-11, 14, and 21-22. (see table 2 in spec)
> >>Also '0' is supported to 'clear' an intention.
> >>
> >>
> >No need for 2 empty spaces.
> >
> >>Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> >>Cc: Michael Tsirkin <mst@redhat.com>
> >>Cc: Kevin O'Connor <kevin@koconnor.net>
> >All this seems somewhat messy.  Is this FSEG trick what the spec says,
> >or is this a QEMU specific protocol?
> 
> Actually, the text in the patch is outdated. We now moved the area where the
> data are exchanged between ACPI and BIOS into registers provided by the TIS
> -- custom registers in an area that is vendor-specific, so yes, this is a
> QEMU specific solution. The address range for this is fixed and known to
> SeaBIOS and QEMU. Those registers also won't reset upon machine reboot.

Hmm. One way to do a machine reboot is to exit QEMU
then restart it. Where do these registers persist?

> >Would DataTableRegion not be a better way to locate things in
> >memory?
> 
> As I said, we now move that into a memory region provide by the TIS..
> Otherwise I am not very familiar with DataTableRegion.
> 
> Thanks for the comments!
> 
>     Stefan

A data table is a structure that you define (as opposed to code).
Using linker you can allocate some memory and put a pointer
there, then use DataTableRegion to read that pointer value.

-- 
MST

  reply	other threads:[~2015-06-02  9:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 21:33 [Qemu-devel] [PATCH v3 0/6] Extend TPM support with a QEMU-external TPM Stefan Berger
2015-05-26 21:33 ` [Qemu-devel] [PATCH v3 1/6] Provide support for the CUSE TPM Stefan Berger
2015-05-26 23:05   ` Eric Blake
2015-05-27  1:53     ` Stefan Berger
2015-05-26 21:33 ` [Qemu-devel] [PATCH v3 2/6] Introduce RAM location in vendor specific area in TIS Stefan Berger
2015-05-26 21:33 ` [Qemu-devel] [PATCH v3 3/6] Support Physical Presence Interface Spec Stefan Berger
2015-05-31 18:11   ` Michael S. Tsirkin
2015-06-02  3:11     ` Stefan Berger
2015-06-02  9:15       ` Michael S. Tsirkin [this message]
2015-06-02 13:22         ` Stefan Berger
2015-06-02 13:30           ` Michael S. Tsirkin
2015-06-02 14:28             ` Stefan Berger
2015-06-02 14:46               ` Michael S. Tsirkin
2015-06-02 15:06                 ` Stefan Berger
2015-06-02 15:11                   ` Michael S. Tsirkin
2015-06-02 16:28                     ` Stefan Berger
2015-06-02 15:18                 ` Kevin O'Connor
2015-06-02 16:18                   ` Stefan Berger
2015-06-02 15:00               ` Michael S. Tsirkin
2015-05-26 21:33 ` [Qemu-devel] [PATCH v3 4/6] Introduce condition to notifiy waiters of completed command Stefan Berger
2015-05-31 18:11   ` Michael S. Tsirkin
2015-05-26 21:33 ` [Qemu-devel] [PATCH v3 5/6] Introduce condition in TPM backend for notification Stefan Berger
2015-05-26 21:33 ` [Qemu-devel] [PATCH v3 6/6] Add support for VM suspend/resume for TPM TIS Stefan Berger
2015-05-31 18:11 ` [Qemu-devel] [PATCH v3 0/6] Extend TPM support with a QEMU-external TPM Michael S. Tsirkin
2015-06-02 13:17   ` Stefan Berger

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=20150602110702-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=qemu-devel@nongnu.org \
    --cc=quan.xu@intel.com \
    --cc=stefanb@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).