Received: from eggs.gnu.org ([2001:4830:134:3::10]:56553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLvOy-0004pK-Hf for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:14:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLvOv-0004Qo-80 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:14:32 -0500 Received: from e32.co.us.ibm.com ([32.97.110.150]:49760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLvOu-0004Qc-Lq for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:14:29 -0500 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Jan 2016 09:14:27 -0700 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id EAF8A3E40047 for ; Wed, 20 Jan 2016 09:14:14 -0700 (MST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0KGEEcQ16122034 for ; Wed, 20 Jan 2016 16:14:14 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0KGEE9K014854 for ; Wed, 20 Jan 2016 11:14:14 -0500 Received: from d50lp31.co.us.ibm.com (d50lp31.boulder.ibm.com [9.17.249.32]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u0KGECEh014570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 20 Jan 2016 11:14:14 -0500 Message-Id: <201601201614.u0KGECEh014570@d01av04.pok.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:14:12 -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:13:59 -0000 In-Reply-To: <20160120175933-mutt-send-email-mst@redhat.com> From: "Stefan Berger" Date: Wed, 20 Jan 2016 11:13:15 -0500 References: <1451921002-8263-1-git-send-email-stefanb@us.ibm.com> <1451921002-8263-2-git-send-email-stefanb@us.ibm.com> <20160120150041.GC13215@redhat.com> <201601201532.u0KFW2q2019737@d03av03.boulder.ibm.com> <20160120154657.GF13215@redhat.com> <569FADC7.7060301@linux.vnet.ibm.com> <20160120175933-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_alternative 00591BD585257F40_=" 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 00591BD585257F40_= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="US-ASCII" "Michael S. Tsirkin" wrote on 01/20/2016 11:03:11 AM: > From: "Michael S. Tsirkin" > Subject: Re: [Qemu-devel] [PATCH v5 1/4] Provide support for the CUSE=20 TPM >=20 > On Wed, Jan 20, 2016 at 10:54:47AM -0500, Stefan Berger wrote: > > On 01/20/2016 10:46 AM, Daniel P. Berrange wrote: > > >On Wed, Jan 20, 2016 at 10:31:56AM -0500, Stefan Berger wrote: > > >>"Daniel P. Berrange" wrote on 01/20/2016=20 10:00:41 > > >>AM: > > >> > > >> > > >>>process at all - it would make sense if there was a single > > >>>swtpm=5Fcuse shared across all QEMU's, but if there's one per > > >>>QEMU device, it feels like it'd be much simpler to just have > > >>>the functionality linked in QEMU. That avoids the problem > > >>I tried having it linked in QEMU before. It was basically rejected. > > >I remember an impl you did many years(?) ago now, but don't recall > > >the results of the discussion. Can you elaborate on why it was > > >rejected as an approach ? It just doesn't make much sense to me > > >to have to create an external daemon, a CUSE device and comms > > >protocol, simply to be able to read/write a plain file containing > > >the TPM state. Its massive over engineering IMHO and adding way > > >more complexity and thus scope for failure > >=20 > > The TPM 1.2 implementation adds 10s of thousands of lines of code.The=20 TPM 2 > > implementation is in the same range. The concern was having this code=20 right > > in the QEMU address space. It's big, it can have bugs, so we don't=20 want it > > to harm QEMU. So we now put this into an external process implemented=20 by the > > swtpm project that builds on libtpms which provides TPM 1.2=20 functionality > > (to be extended with TPM 2). We cannot call APIs of libtpms directly > > anymore, so we need a control channel, which is implemented through=20 ioctls > > on the CUSE device. > >=20 > > Stefan >=20 > If that's the only reason for it, you can package it as part of QEMU > source, run it as a sub-process. I am packaging libtpms in Fedora. Once we have the CUSE interface in QEMU, = I would package the swtpm project for Fedora as well. Both projects have=20 at least been prepared for Debian packaging also. https://github.com/stefanberger/libtpms https://github.com/stefanberger/swtpm The 'dist' directory has the spec file. If I would combine things, then on the libvirt layer. Introduce an RPM=20 dependency there. I doubt I will have the possibility to go back to integrating it directly=20 into QEMU directly. Regards, Stefan --=_alternative 00591BD585257F40_= Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="US-ASCII" "Michael S. Tsirkin" <mst@redhat.com> wrote on 01/20/2016 11:03:11 AM:

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


> Su= bject: Re: [Qemu-devel] [PATCH v5 1/4] Provide support for the CUSE TPM
>
> On= Wed, Jan 20, 2016 at 10:54:47AM -0500, Stefan Berger wrote:
> > O= n 01/20/2016 10:46 AM, Daniel P. Berrange wrote:
> > >On Wed, J= an 20, 2016 at 10:31:56AM -0500, Stefan Berger wrote:
> > >>= "Daniel P. Berrange" <berrange@redhat.com> wrote on 01/20/2016 10:00:41
> > >>AM:
> > >>=
> > >>
> > >>>process at all - it would m= ake sense if there was a single
> > >>>swtpm=5Fcuse shared across all QEMU's, bu= t if there's one per
> > >>>QEMU device, it feels like it'd be much si= mpler to just have
> > >>>the functionality linked in QEMU.  = That avoids the problem
> > >>I tried having it linked in QEMU before. I= t was basically rejected.
> > >I remember an impl you did many years(?) ago now= , but don't recall
> > >the results of the discussion. Can you elaborate on= why it was
> > >rejected as an approach ? It just doesn't make much se= nse to me
> > >to have to create an external daemon, a CUSE device = and comms
> > >protocol, simply to be able to read/write a plai= n file containing
> > >the TPM state. Its massive over engineer= ing IMHO and adding way
> > >more complexity and thus scope for failure
> >= ;
> > The TPM 1.2 implementation adds 10s of thousands of lines of code.The TPM 2
> > implementation is in the same range. The concer= n was having this code right
> > in the QEMU address space. It's big, it can have bu= gs, so we don't want it
> > to harm QEMU. So we now put this into an externa= l process implemented by the
> > swtpm project that builds on libtpms which provides TPM= 1.2 functionality
> > (to be extended with TPM 2). We cannot call= APIs of libtpms directly
> > anymore, so we need a control channe= l, which is implemented through ioctls
> > on the CUSE device.
> >
> >   &= nbsp;Stefan
>
> If that's the only reason for it, you can pack= age it as part of QEMU
> source, run it as a sub-process.
=


I am packaging libtpms in Fedora. Once we ha= ve the CUSE interface in QEMU, I would package the swtpm project for Fedora as well. Both projects have at least been prepared for Debian packaging also.<= /font>

https://github.com/stefanberger/libtpms

https://github.com/stefanberger/swtpm
The 'dist' directory has the spec file.
=
If I would combine things, then on the libvirt layer. Introduce an RPM dependency there.

I = doubt I will have the possibility to go back to integrating it directly into QEMU directly.

Regards,
   Stefan

--=_alternative 00591BD585257F40_=--