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 08:59:28 -0500	[thread overview]
Message-ID: <b7c4c45c2bcbcf5c2b111a978297c5bb07b49498.camel@linux.ibm.com> (raw)
In-Reply-To: <b81db56b-9044-d569-7de2-5388f6958461@linux.ibm.com>

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
obeys the TPM2_Shutdown protocol, so the software does a power off with

TPM2_Shutdown(TPM_SU_STATE)

This allows poweroff to preserve the PCR state, provided the startup
does

TPM2_Startup(TPM_SU_STATE).

the edk2 SecurityPackage does this in OVMF on S3 Resume, so using this
backend allows us to check the OVMF startup for correctness.

Now getting QEMU to go through S3 suspend is another issue, but when it
does, the TPM should just work.

James



  reply	other threads:[~2022-12-12 14:14 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 [this message]
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
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=b7c4c45c2bcbcf5c2b111a978297c5bb07b49498.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).