[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 8/8] tpm: Added support for TPM emulator
From: |
Amarnath Valluri |
Subject: |
Re: [Qemu-devel] [PATCH v6 8/8] tpm: Added support for TPM emulator |
Date: |
Sat, 22 Jul 2017 07:52:01 +0300 |
On Tue, 2017-07-18 at 05:08 -0700, Marc-André Lureau wrote:
> Hi
>
> On Tue, Jul 18, 2017 at 1:49 AM, Amarnath Valluri
> <address@hidden> wrote:
> > This change introduces a new TPM backend driver that can communicate with
> > swtpm(software TPM emulator) using unix domain socket interface.
> >
> > Swtpm uses two unix sockets, one for plain TPM commands and responses, and
> > one
> > for out-of-band control messages.
> >
> > The swtpm and associated tools can be found here:
> > https://github.com/stefanberger/swtpm
> >
> > The swtpm's control channel protocol specification can be found here:
> > https://github.com/stefanberger/swtpm/wiki/Control-Channel-Specification
>
> I am afraid this isn't enough yet.
>
> > Usage:
> > # setup TPM state directory
> > mkdir /tmp/mytpm
> > chown -R tss:root /tmp/mytpm
> > /usr/bin/swtpm_setup --tpm-state /tmp/mytpm --createek
> >
> > # Ask qemu to use TPM emulator with given tpm state directory
> > qemu-system-x86_64 \
> > [...] \
> > -tpmdev
> > emulator,id=tpm0,tpmstatedir=/tmp/mytpm,logfile=/tmp/swtpm.log \
>
> We should rather follow the vhost-user pattern: do not deal with
> spawning the external swtpm/backend, just use chardev to connect to
> it. At least you don't have to deal with process argument details,
> management etc that may change version to version.
I made the spawning completely optional and it is useful in some
environments, especially makes life easier when multiple QEMU instances
on a system.
One can configure QEMU to connect to already running software emulator
using Unix domain socket paths:
-tpmdev emulator,id=tpm0,data-path=/path/,ctrl-path=/path
- Amarnath
- Re: [Qemu-devel] [PATCH v6 5/8] tmp backend: Add new api to read backend TpmInfo, (continued)
- [Qemu-devel] [PATCH v6 3/8] tpm-backend: Initialize and free data members in it's own methods, Amarnath Valluri, 2017/07/18
- [Qemu-devel] [PATCH v6 2/8] tpm-backend: Move thread handling inside TPMBackend, Amarnath Valluri, 2017/07/18
- [Qemu-devel] [PATCH v6 6/8] tpm-backend: Move realloc_buffer() implementation to tpm-tis model, Amarnath Valluri, 2017/07/18
- [Qemu-devel] [PATCH v6 7/8] tpm-passthrough: move reusable code to utils, Amarnath Valluri, 2017/07/18
- [Qemu-devel] [PATCH v6 8/8] tpm: Added support for TPM emulator, Amarnath Valluri, 2017/07/18
- Re: [Qemu-devel] [PATCH v6 0/8] Provide support for the software TPM emulator, no-reply, 2017/07/18