Received: from eggs.gnu.org ([2001:4830:134:3::10]:55591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLvMC-0002MP-9U for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:11:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLvM8-0003lB-4E for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:11:40 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:55845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLvM7-0003kl-J7 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:11:36 -0500 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Jan 2016 09:07:47 -0700 Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id B1CB719D806E for ; Wed, 20 Jan 2016 08:55:45 -0700 (MST) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0KG7iMf26017904 for ; Wed, 20 Jan 2016 09:07:44 -0700 Received: from d03av03.boulder.ibm.com (localhost [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0KG7hZd008671 for ; Wed, 20 Jan 2016 09:07:44 -0700 Received: from d50lp31.co.us.ibm.com (d50lp31.boulder.ibm.com [9.17.249.32]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u0KG7NtZ004518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 20 Jan 2016 09:07:23 -0700 Message-Id: <201601201607.u0KG7NtZ004518@d03av03.boulder.ibm.com> Received: from localhost by d50lp31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Jan 2016 09:07:02 -0700 Received: from /spool/local by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Wed, 20 Jan 2016 16:06:53 -0000 In-Reply-To: <20160120155802.GA32541@redhat.com> From: "Stefan Berger" Date: Wed, 20 Jan 2016 11:06:45 -0500 References: <1451921002-8263-1-git-send-email-stefanb@us.ibm.com> <1451921002-8263-2-git-send-email-stefanb@us.ibm.com> <20160120171258-mutt-send-email-mst@redhat.com> <201601201536.u0KFanwG004844@d01av04.pok.ibm.com> <20160120155802.GA32541@redhat.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_alternative 0058838085257F40_=" Subject: Re: [Qemu-devel] [PATCH v5 1/4] Provide support for the CUSE TPM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Stefan Berger , qemu-devel@nongnu.org, jb613w@att.com, quan.xu@intel.com, silviu.vlasceanu@gmail.com, hagen.lauer@huawei.com --=_alternative 0058838085257F40_= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="US-ASCII" "Michael S. Tsirkin" wrote on 01/20/2016 10:58:02 AM: > From: "Michael S. Tsirkin" >=20 > On Wed, Jan 20, 2016 at 10:36:41AM -0500, Stefan Berger wrote: > > "Michael S. Tsirkin" wrote on 01/20/2016 10:20:58 AM: > >=20 > > > From: "Michael S. Tsirkin" > >=20 > > > > > > > > The CUSE TPM and associated tools can be found here: > > > > > > > > https://github.com/stefanberger/swtpm > > > > > > > > (please use the latest version) > > > > > > > > To use the external CUSE TPM, the CUSE TPM should be started as=20 follows: > > > > > > > > # terminate previously started CUSE TPM > > > > /usr/bin/swtpm=5Fioctl -s /dev/vtpm-test > > > > > > > > # start CUSE TPM > > > > /usr/bin/swtpm=5Fcuse -n vtpm-test > > > > > > > > QEMU can then be started using the following parameters: > > > > > > > > qemu-system-x86=5F64 \ > > > > [...] \ > > > > -tpmdev cuse-tpm,id=3Dtpm0,cancel-path=3D/dev/null,path=3D/ > dev/vtpm-test > > \ > > > > -device tpm-tis,id=3Dtpm0,tpmdev=3Dtpm0 \ > > > > [...] > > > > > > > > > > > > Signed-off-by: Stefan Berger > > > > Cc: Eric Blake > > > > > > Before we add a dependency on this interface, > > > I'd rather see this interface supported in kernel > > > and not just in CUSE. > >=20 > > For using the single hardware TPM, we have the passthrough type.=20 > It's usage is > > limited. > >=20 > > CUSE extends the TPM character device interface with ioctl's. Behind=20 the > > character device we can implement a TPM 1.2 and a TPM 2. Both TPM > > implementations require large amounts of code, which I don't=20 thinkshould go > > into the Linux kernel itself. So I don't know who would implement this > > interface inside the Linux kernel. > >=20 > > Stefan > >=20 >=20 > BTW I'm not talking about the code - I'm talking about the interfaces=20 here. >=20 > One way would be to add support for these interface support in the=20 kernel. >=20 > Maybe others can be replaced with QMP events so management > can take the necessary action. >=20 > As long as this is not the case, I suspect this code will have to stay > out of tree :( We can't depend on interfaces provided solely by cuse > devices on github. Why is that? I know that the existing ioctls cannot be modified anymore=20 once QEMU accepts the code. So I don't understand it. Some of the ioctls=20 are only useful when emulating a hardware device, so there's no need for=20 them in a kernel interface unless one was to put the vTPM code into the=20 Linux kernel, but I don't see that this is happening. What is better about = a kernel interface versus one implemented by a project on github assuming=20 that the existing ioctls are stable? What is the real reason here? Stefan >=20 >=20 >=20 > --=20 > MST >=20 --=_alternative 0058838085257F40_= Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="US-ASCII" "Michael S. Tsirkin" <mst@redhat.com> wrote on 01/20/2016 10:58:02 AM:

> From: "Michael S. Tsirkin= " <mst@redhat.com>


> > On Wed, Jan 20, 2016 at 10:36:41AM -0500, Stefan Berger wrote:
&g= t; > "Michael S. Tsirkin" <mst@redhat.com> wrote on 01/20/2016 10:20:58 AM:
> >
> > > From: "Michael= S. Tsirkin" <mst@redhat.com>
> >
> > > &g= t;
> > > > The CUSE TPM and associated tools can be found he= re:
> > > >
> > > >
https://github.com/st= efanberger/swtpm
> > > ><= br>> > > > (please use the latest version)
> > > &g= t;
> > > > To use the external CUSE TPM, the CUSE TPM should= be started as follows:
> > > >
> > > > # termina= te previously started CUSE TPM
> > > > /usr/bin/swtpm=5Fioct= l -s /dev/vtpm-test
> > > >
> > > > # start C= USE TPM
> > > > /usr/bin/swtpm=5Fcuse -n vtpm-test
> &= gt; > >
> > > > QEMU can then be started using the fol= lowing parameters:
> > > >
> > > > qemu-syste= m-x86=5F64 \
> > > >    [...] \
> > > = >         -tpmdev cuse-tpm,id=3Dtpm0,cancel-path=3D/= dev/null,path=3D/
> dev/vtpm-test
> > \
> > > &g= t;         -device tpm-tis,id=3Dtpm0,tpmdev=3Dtpm0 \
> > > >    [...]
> > > >
> = > > >
> > > > Signed-off-by: Stefan Berger <stef= anb@linux.vnet.ibm.com>
> > > > Cc: Eric Blake <eblake= @redhat.com>
> > >
> > > Before we add a depende= ncy on this interface,
> > > I'd rather see this interface supp= orted in kernel
> > > and not just in CUSE.
> >
&g= t; > For using the single hardware TPM, we have the passthrough type.
> It's usage is
> > limited.
> >
> > CUS= E extends the TPM character device interface with ioctl's. Behind the
> > character device we can implement a TPM 1.2 and a T= PM 2. Both TPM
> > implementations require large amounts of code, which I don= 't thinkshould go
> > into the Linux kernel itself. So I don't know w= ho would implement this
> > interface inside the Linux kernel.
> >
> = >   Stefan
> >
>
> BTW I'm not talking about= the code - I'm talking about the interfaces here.
>
> One way would be to add support for these interface = support in the kernel.
>
> Maybe others can be replaced with QMP events so ma= nagement
> can take the necessary action.
>
> As long as= this is not the case, I suspect this code will have to stay
> out of tree :( We can't depend on interfaces provided solely b= y cuse
> devices on github.


Why= is that? I know that the existing ioctls cannot be modified anymore once QEMU accepts the code. So I don't understand it. Some of the ioctls are only useful when emulating a hardware device, so there's no need for them in a kernel interface unless one was to put the vTPM code into the Linux kernel, but I don't see that this is happening. What is better about a kernel interface versus one implemented by a project on github assuming that the existing ioctls are stable? What is the real reason here?

   Stefan


>
>
>
> -- > MST
>

--=_alternative 0058838085257F40_=--