qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: qemu-ppc@nongnu.org, linuxram@us.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] spapr: initial implementation for H_TPM_COMM hcall
Date: Thu, 18 Jul 2019 11:53:51 +1000	[thread overview]
Message-ID: <20190718015351.GB8468@umbus.fritz.box> (raw)
In-Reply-To: <156339682748.9622.9735892189405094393@sif>

[-- Attachment #1: Type: text/plain, Size: 3966 bytes --]

On Wed, Jul 17, 2019 at 03:53:47PM -0500, Michael Roth wrote:
> Quoting David Gibson (2019-07-16 20:29:12)
> > On Tue, Jul 16, 2019 at 11:30:01AM -0500, Michael Roth wrote:
> > > Quoting David Gibson (2019-07-14 21:25:24)
> > > > On Fri, Jul 12, 2019 at 09:34:46AM -0500, Michael Roth wrote:
> > > > > Quoting David Gibson (2019-07-12 01:46:19)
> > > > > > On Thu, Jul 11, 2019 at 08:19:34PM -0500, Michael Roth wrote:
> > > > > > > This implements the H_TPM_COMM hypercall, which is used by an
> > > > > > > Ultravisor to pass TPM commands directly to the host's TPM device, or
> > > > > > > a TPM Resource Manager associated with the device.
> > > > > > > 
> > > > > > > This also introduces a new pseries machine option which is used to
> > > > > > > configure what TPM device to pass commands to, for example:
> > > > > > > 
> > > > > > >   -machine pseries,...,tpm-device-file=/dev/tmprm0
> > > > > > 
> > > > > > Bolting this into yet another machine parameter seems kind of ugly.
> > > > > > Wouldn't it make more sense to treat this as an virtual device (say
> > > > > > "spapr-vtpm").  Adding that device would enable the hcall, and would
> > > > > > have properties for the back end host device.
> > > > > 
> > > > > That does sound nicer.
> > > > > 
> > > > > Originally I had SpaprMachineClass implement the TYPE_TPM_IF interface so
> > > > > we could define a TPM backend via -tpmdev passthrough,path=..., but after
> > > > > some discussion with the TPM maintainer it didn't quite work for the main
> > > > > use-case of passing through a TPM Resource Manager since it isn't suitable
> > > > > for full vTPM front-ends (since multiple guests can interfere with each
> > > > > other's operations when running the full gamut of TPM functionality).
> > > > > 
> > > > > I hadn't consider a stand-alone -device implementation though. It's not
> > > > > a proper VIO or PCI device so there's no proper bus to attach it to. I
> > > > > guess we would just make it a direct child of SpaprMachineState (sort
> > > > > of like SpaprDrcClass), then we could define it via something like
> > > > > -object spapr-tpm-proxy,path=....
> > > > 
> > > > It should be -device not -object, but otherwise that looks ok.
> > > 
> > > Ok, for some reason I thought -device needed either a specific bus or
> > > needed to be a SysBusDevice to attach to main-system-bus, but maybe that
> > > was just for qdev-managed reset handling. I've re-worked the series to
> > > allow configuration via:
> > > 
> > >   -device spapr-tpm-proxy,host_path=/dev/tpmrmX
> > 
> > That looks good.
> > 
> > > > How does the TPM appear in the device tree?
> > > 
> > > Nothing in the guest, on the host it appears as:
> > 
> > Hrm.  That seems unwise.  I mean, I guess its being treated as a
> > hypervisor facility rather than a device per se, but what if we ever
> > need to advertise more metadata about it.
> 
> It's a little bit awkward using a device tree in this case since it's
> generally the ultravisor that will be making this hcall on behalf of
> a guest requesting switch-over to SVM mode. The TPM device itself has
> a GetCapabilities command that seems like it would cover most of the
> metadata we might need though:
> 
> https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-3-Commands-01.38.pdf
> (page 340)
> 
> and if we need to add a layer of metadata on top of that there's also
> the option of introducing support for an additional operation in
> H_TPM_COMM itself, e.g. TPM_COMM_OP_GET_CAPABILITIES. Unsupported or
> invalid operations have a unique H_PARAMETER return code so callers
> should be able to reliably probe for it in the future if they need
> more information.

Yeah, ok.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-07-18  3:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  1:19 [Qemu-devel] [RFC PATCH 0/2] spapr: Implement H_TPM_COMM for accessing host TPM device Michael Roth
2019-07-12  1:19 ` [Qemu-devel] [PATCH 1/2] docs/specs: initial spec summary for Ultravisor-related hcalls Michael Roth
2019-07-12  6:40   ` David Gibson
2019-07-12 15:13     ` Michael Roth
2019-07-15  2:25       ` David Gibson
2019-07-16 16:25         ` Michael Roth
2019-07-12  1:19 ` [Qemu-devel] [PATCH 2/2] spapr: initial implementation for H_TPM_COMM hcall Michael Roth
2019-07-12  6:46   ` David Gibson
2019-07-12 14:34     ` Michael Roth
2019-07-15  2:25       ` David Gibson
2019-07-16 16:30         ` Michael Roth
2019-07-17  1:29           ` David Gibson
2019-07-17 20:53             ` Michael Roth
2019-07-18  1:53               ` David Gibson [this message]
2019-07-12  6:40 ` [Qemu-devel] [RFC PATCH 0/2] spapr: Implement H_TPM_COMM for accessing host TPM device David Gibson
2019-07-12 15:33 ` no-reply

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=20190718015351.GB8468@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=linuxram@us.ibm.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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).