From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Stefan Berger" Subject: Re: [PATCH v5 4/5] Initialize TPM and get durations and timeouts Date: Wed, 10 Feb 2016 00:15:44 -0500 Message-ID: <201602100515.u1A5FpPD018814@d03av05.boulder.ibm.com> References: <1454959628-30582-1-git-send-email-stefanb@linux.vnet.ibm.com> <1454959628-30582-5-git-send-email-stefanb@linux.vnet.ibm.com> <20160209053323.GD12657@obsidianresearch.com> <201602091626.u19GQpga021574@d01av02.pok.ibm.com> <20160209165228.GA14611@obsidianresearch.com> <20160210035620.GB7161@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0856431288534685511==" Return-path: In-Reply-To: <20160210035620.GB7161-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jarkko Sakkinen Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net --===============0856431288534685511== Content-Type: multipart/alternative; boundary="=_alternative 001CF00885257F55_=" --=_alternative 001CF00885257F55_= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="US-ASCII" Jarkko Sakkinen wrote on 02/09/2016=20 10:56:20 PM: >=20 > On Tue, Feb 09, 2016 at 09:52:28AM -0700, Jason Gunthorpe wrote: > > On Tue, Feb 09, 2016 at 11:19:15AM -0500, Stefan Berger wrote: > > > Jason Gunthorpe wrote on 02/ > 09/2016 12:33:23 > > > AM: > > >=20 > > >=20 > > > > > > > > On Mon, Feb 08, 2016 at 02:27:07PM -0500, Stefan Berger wrote: > > > > > Add the retrieval of TPM 1.2 durations and timeouts. Since=20 > this requires > > > > > the startup of the TPM, do this for TPM 1.2 and TPM 2. > > > > > > > > > > To not allow to interleave with commands from user space, so=20 send the > > > > > TPM=5FStartup as the first command. The timeouts can then be=20 > gotten at any > > > > > later time, even interleaved with commands from user space. > > > > > > > > Do not call tpm=5Fregister until get=5Ftimeouts has completed and t= his > > > > will naturally be avoided the same way every other TPM driver=20 does. > > >=20 > > > Getting the timeouts cannot complete before the TPM emulator has > started, which > > > in turn cannot start before the ioctl returns. We don't know=20 > whether user space > > > starts a client first on /dev/tpm1 or the TPM emulator starts=20 > first on the file > > > descriptor. We can control which command gets *queued* for the=20 > TPM emulator and > > > that's what I am doing by having the kernel queue the startup=20 > command first. > >=20 > > I keep saying this same solution - start a work queue just before the > > ioctl returns and do the get=5Ftimeouts and registration in there. >=20 > *Maybe* it would be worth to check David's patch: >=20 > https://github.com/PeterHuewe/linux-tpmdd/commit/ > 9329f13c403daf1f4bd1e715d2ba0866e089fb1d Redid that now. https://github.com/stefanberger/linux/commit/83019eaab2cf5eb33f2665efdf9d2a= 117ed703b2 Stefan >=20 > /Jarkko >=20 --=_alternative 001CF00885257F55_= Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="US-ASCII" Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> wrote on 02/09/2016 10:56:20 PM:

>
> On Tue, Feb 09, 2016 = at 09:52:28AM -0700, Jason Gunthorpe wrote:
> > On Tue, Feb 09, 20= 16 at 11:19:15AM -0500, Stefan Berger wrote:
> > > Jason Guntho= rpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote on 02/
> 09/2016 12:33:23
> > > AM:
> > &g= t;
> > >
> > > >
> > > > On Mon= , Feb 08, 2016 at 02:27:07PM -0500, Stefan Berger wrote:
> > > > > Add the retrieval of TPM 1.2 durations a= nd timeouts. Since
> this requires
> > > > > the startup of the= TPM, do this for TPM 1.2 and TPM 2.
> > > > >
> > > > > To not allow= to interleave with commands from user space, so send the
> > > > > TPM=5FStartup as the fi= rst command. The timeouts can then be
> gotten at any
> > > > > later time, = even interleaved with commands from user space.
> > > >
> > > > Do not call tpm= =5Fregister until get=5Ftimeouts has completed and this
> > > > will naturally be avoided the same way ever= y other TPM driver does.
> > >
> > > Getting the timeouts = cannot complete before the TPM emulator has
> started, which
> > > in turn cannot start before th= e ioctl returns. We don't know
> whether user space
> > > starts a client first on= /dev/tpm1 or the TPM emulator starts
> first on the file
> > > descriptor. We can control whi= ch command gets *queued* for the
> TPM emulator and
> > > that's what I am doing by h= aving the kernel queue the startup
> command first.
> >
> > I keep saying this same = solution - start a work queue just before the
> > ioctl returns and do the get=5Ftimeouts and registration i= n there.
>
> *Maybe* it would be worth to check David's patch:=
>
>
https://github.com/PeterHuewe/linux-tpm= dd/commit/
> 9329f13c403daf1f4bd1e= 715d2ba0866e089fb1d



Redid that no= w.

= https://github.com/stefanberger/linux/commit/83019eaab2cf5eb33f2665efdf9d2a= 117ed703b2
   Stefan
>= ;
> /Jarkko
>

--=_alternative 001CF00885257F55_=-- --===============0856431288534685511== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 --===============0856431288534685511== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ tpmdd-devel mailing list tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/tpmdd-devel --===============0856431288534685511==--