qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <jejb@linux.ibm.com>
To: Stefan Berger <stefanb@linux.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH] tpm: add backend for mssim
Date: Mon, 12 Dec 2022 09:47:33 -0500	[thread overview]
Message-ID: <43465b20acc0b120ed49330d2f985534d0b2fc60.camel@linux.ibm.com> (raw)
In-Reply-To: <9cc63b28-6700-59b3-1d4d-b89a4744a09b@linux.ibm.com>

On Mon, 2022-12-12 at 09:44 -0500, Stefan Berger wrote:
> 
> 
> On 12/12/22 09:32, James Bottomley wrote:
> > On Mon, 2022-12-12 at 09:27 -0500, Stefan Berger wrote:
> > > 
> > > 
> > > On 12/12/22 08:59, James Bottomley wrote:
> > > > On Mon, 2022-12-12 at 08:43 -0500, Stefan Berger wrote:
> > > > > 
> > > > > 
> > > > > On 12/10/22 12:10, James Bottomley wrote:
> > > > > > The Microsoft Simulator (mssim) is the reference emulation
> > > > > > platform
> > > > > > for the TCG TPM 2.0 specification.
> > > > > > 
> > > > > > https://github.com/Microsoft/ms-tpm-20-ref.git
> > > > > > 
> > > > > > It exports a fairly simple network socket baset protocol on
> > > > > > two
> > > > > 
> > > > > baset -> based.
> > > > > 
> > > > > > sockets, one for command (default 2321) and one for control
> > > > > > (default 2322).  This patch adds a simple backend that can
> > > > > > speak the mssim protocol over the network.  It also allows
> > > > > > the
> > > > > > host, and two ports to be specified on the qemu command
> > > > > > line.
> > > > > > The benefits are twofold: firstly it gives us a backend
> > > > > > that
> > > > > > actually speaks a standard TPM emulation protocol instead
> > > > > > of
> > > > > > the linux specific TPM driver format of the current
> > > > > > emulated
> > > > > > TPM backend and secondly, using the microsoft protocol, the
> > > > > > end
> > > > > > point of the emulator can be anywhere on the network,
> > > > > > facilitating the cloud use case where a central TPM ervice
> > > > > > can
> > > > > > be used over a control network.
> > > > > > 
> > > > > > The implementation does basic control commands like power
> > > > > > off/on, but doesn't implement cancellation or startup.  The
> > > > > > former because cancellation is pretty much useless on a
> > > > > > fast
> > > > > > operating TPM emulator and the latter because this emulator
> > > > > > is
> > > > > > designed to be used with OVMF which itself does TPM startup
> > > > > > and
> > > > > > I wanted to validate that.
> > > > > 
> > > > > How did you implement VM suspend/resume and snapshotting
> > > > > support?
> > > > 
> > > > TPM2 doesn't need to.  The mssim follows the reference model
> > > > which
> > > 
> > > 
> > > You mean TPM2 doesn't need to resume at the point where the VM
> > > resumes (I am not talking about ACPI resume but virsh
> > > save/restore)
> > > after for example a host reboot?
> > > What does this have to do with the mssim reference model and
> > > TPM2_Shutdown protocol?
> > 
> > Running S3 suspend/resume before doing VM save/restore could fix a
> > lot of issue with passthrough PCI and when QEMU gets around to
> > doing that a TPM following the standard model should just work. 
> > It's useful to have a driver supporting this work.
> Did you test it with virsh save / restore with the mssim TPM? Does it
> work? Does it work if you reboot the host in between?

I don't actually use virsh in my harness.  I'm mostly interested in the
running the kernel TPM selftests against the reference model.  But I
anticipate it wouldn't currently work because I don't believe virsh
triggers a S3 event which is why snapshot and migration doesn't always
work with PCI passthrough.

James



  reply	other threads:[~2022-12-12 14:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-10 17:10 [PATCH] tpm: add backend for mssim James Bottomley
2022-12-12 13:43 ` Stefan Berger
2022-12-12 13:59   ` James Bottomley
2022-12-12 14:27     ` Stefan Berger
2022-12-12 14:32       ` James Bottomley
2022-12-12 14:44         ` Stefan Berger
2022-12-12 14:47           ` James Bottomley [this message]
2022-12-12 15:20             ` Stefan Berger
2022-12-12 15:28               ` James Bottomley
2022-12-12 15:46                 ` Stefan Berger
2022-12-12 15:47 ` Daniel P. Berrangé
2022-12-12 16:38   ` James Bottomley
2022-12-12 16:59     ` Stefan Berger
2022-12-12 18:48       ` James Bottomley
2022-12-12 18:58         ` Stefan Berger
2022-12-12 19:12           ` James Bottomley
2022-12-12 19:32             ` Stefan Berger
2022-12-12 20:24               ` Stefan Berger
2022-12-12 21:36               ` James Bottomley
2022-12-12 22:02                 ` Stefan Berger
2022-12-12 22:27                   ` James Bottomley
2022-12-12 22:43                     ` Stefan Berger
2022-12-14 11:52                   ` Daniel P. Berrangé
2022-12-14 12:43                     ` James Bottomley
2022-12-15  2:42                       ` Stefan Berger
2022-12-14 11:55           ` Daniel P. Berrangé
2022-12-12 22:06   ` James Bottomley
2022-12-14 11:31     ` Daniel P. Berrangé
2022-12-14 12:47       ` James Bottomley
2022-12-14 14:17         ` Markus Armbruster

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=43465b20acc0b120ed49330d2f985534d0b2fc60.camel@linux.ibm.com \
    --to=jejb@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanb@linux.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).