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: Tue, 16 Feb 2016 11:44:06 -0500 Message-ID: <201602161648.u1GGmmqj029901@d03av05.boulder.ibm.com> References: <201602111534.u1BFYvRs019573@d01av03.pok.ibm.com><20160211181208.GA6285@obsidianresearch.com><201602111911.u1BJB2nK017410@d01av03.pok.ibm.com><20160211194810.GA24211@obsidianresearch.com><201602112210.u1BMAYPe015452@d03av01.boulder.ibm.com><20160211221822.GA16304@obsidianresearch.com><201602112226.u1BMQZ59031657@d01av02.pok.ibm.com><20160211235611.GB16304@obsidianresearch.com><201602120356.u1C3usEe002034@d03av04.boulder.ibm.com><201602121813.u1CIDu4O015272@d01av01.pok.ibm.com><20160212183415.GA4289@obsidianresearch.com> <201602140637.u1E6baNX028563@d03av04.boulder.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7112190030052393490==" Return-path: In-Reply-To: <201602140637.u1E6baNX028563-2xHzGjyANq4+UXBhvPuGgqsjOiXwFzmk@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Stefan Berger 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 --===============7112190030052393490== Content-Type: multipart/alternative; boundary="=_alternative 005BF67885257F5B_=" --=_alternative 005BF67885257F5B_= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="US-ASCII" Stefan Berger/Watson/IBM@IBMUS wrote on 02/14/2016 01:37:08 AM: >=20 > Jason Gunthorpe wrote on 02/12/ > 2016 01:34:15 PM: >=20 > >=20 > > On Fri, Feb 12, 2016 at 01:13:39PM -0500, Stefan Berger wrote: > > > Stefan Berger/Watson/IBM@IBMUS wrote on 02/11/2016 10:56:47 PM: > > > > > > > > Jason Gunthorpe wrote on=20 02/11/ > > > > 2016 06:56:11 PM: > > > > > > > > > > > > > > > > > > On Thu, Feb 11, 2016 at 05:26:24PM -0500, Stefan Berger=20 wrote: > > > > > > > > > > > > What is the point of tpmm=5Fchip=5Fdev? > > > > > > So that the usage model of the chip is the same. We get=20 this > > > in the > > > > > > tpm-vtpm.c with tpm=5Falloc=5Fchip + tpmm=5Fchip=5Fdev wh= ile all > > > others can > > > > > > call tpmm=5Fchip=5Falloc, which combines the two. > > > > > > > > > > No need, just don't use devm in vtpm, that is even better.=20 The > > > > > standard devm idiom is a with and without version. > > > > > > > > Updated the branch. Are you going to upstream your patch?=20 Otherwise > > > > I would just add your Signed-off-by to it if that's ok ? > > > > > > > > [1]https://github.com/stefanberger/linux/tree/vtpm-driver.v3 > > > I converted tpm-chip.c to use IDA as well. > > > A test for 4096 vTPM instances: > > > for ((i =3D 0; i < 4096; i++)); do ./vtpmctrl & done > >=20 > > Yeah, that looks good, thanks for doing this > >=20 >=20 > With the IDR I ran into the problem that TPM core driver and backend > now share the ID and create their device names with it. What can=20 > happen is that the core driver gives up ID 123, while the vTPM=20 > driver still has the device name vtpms123 registered with sysfs. Now > the next device is created, ID 123 is recycled by the core driver,=20 > and it bombs while the vTPM driver again tries to register vtpm123=20 > that still hasn't been unregistered. One can trigger this problem=20 > with lots of concurrency (see below) and then the whole system even=20 > locks up. I don't know how to solve this ID issue in an easier way=20 > than having an IDR in the core driver and an IDA in the vTPM driver=20 > and so handling the IDs independently. This in turn makes the split=20 > of tpmm=5Fchip=5Falloc / tpm=5Fchip=5Falloc unnecessary since we don't ne= ed=20 > the ID from the chip anymore. Now the below test runs stable. Scratch that. The easier way to fix this was to release the tpm=5Fchip afte= r=20 the vtpm=5Fdev. Stefan >=20 >=20 > for pid in $(ps aux | grep vtpm | gawk '{print $2}'); do kill -9=20 > $pid; done ; for ((i =3D0; i< 8192; i++)); do ./vtpmctrl &>/dev/null &=20 done >=20 > Stefan >=20 ---------------------------------------------------------------------------= --- > 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=3D272487151&iu=3D/4140 > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F > tpmdd-devel mailing list > tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/tpmdd-devel --=_alternative 005BF67885257F5B_= Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="US-ASCII" Stefan Berger/Watson/IBM@IBMUS wrote on 02/14/2016 01:37= :08 AM:

>
> Jason Gunthorpe <= ;jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote on 02/12/
> 2016 01:34:15 = PM:
>
> >
> > On Fri, Feb 12, 2016 at 01:13:39PM = -0500, Stefan Berger wrote:
> > >    Stefan Berger/Wa= tson/IBM@IBMUS wrote on 02/11/2016 10:56:47 PM:
> > >    >
> > >   &= nbsp;> Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote on 02/11/
> > >    > 2016 06:56:11 PM:
&g= t; > >    >
> > >    >
> = > >    > >
> > >    > > O= n Thu, Feb 11, 2016 at 05:26:24PM -0500, Stefan Berger wrote:
> > >    > >
>= ; > >    > > >    > What is the point of tpmm=5Fchip=5Fdev?
> > >    > > > &= nbsp;  So that the usage model of the chip is the same. We get this
> > >    i= n the
> > >    > > >    tpm-vtpm.c= with tpm=5Falloc=5Fchip + tpmm=5Fchip=5Fdev while all
> > >   &= nbsp;others can
> > >    > > >    = call tpmm=5Fchip=5Falloc, which combines the two.
> > >    > >
> &g= t; >    > > No need, just don't use devm in vtpm, that is even better. The
> > >    > > standard = devm idiom is a with and without version.
> > >    >
> > > &nbs= p;  > Updated the branch. Are you going to upstream your patch? Otherwise
> > >    > I would just add = your Signed-off-by to it if that's ok ?
> > >    >
> > > &nb= sp;  > [1]
https://github.com/stefanberger= /linux/tree/vtpm-driver.v3
> > = >    I converted tpm-chip.c to use IDA as well.
> > &= gt;    A test for 4096 vTPM instances:
> > >   &= nbsp;for ((i =3D 0; i < 4096; i++)); do ./vtpmctrl & done
> >
> > Yeah, that looks good, thanks for doi= ng this
> >
>
> With the IDR I ran into the problem = that TPM core driver and backend
> now share the ID and create their = device names with it. What can
> happen is that the core driver give= s up ID 123, while the vTPM
> driver still has the device name vtpms= 123 registered with sysfs. Now
> the next device is created, ID 123 i= s recycled by the core driver,
> and it bombs while the vTPM driver again tries to register vtpm123
> that still hasn't been unregistered. One can trigger this problem
> with lots of concurrency (see below) and then the whole system even
> locks up. I don't know how to solve this ID issue in an easier way
> than having an IDR in the core driver and an IDA in the vTPM driver
> and so handling the IDs independently. This in turn makes the split
> of tpmm=5Fchip=5Falloc / tpm=5Fchip=5Falloc unnecessary since we d= on't need
> the ID from the chip anymore. Now the below test runs stable.


Scratch that. The easier way to fix this = was to release the tpm=5Fchip after the vtpm=5Fdev.

=    Stefan


>
>=
> for pid in $(ps aux | grep vtpm | gawk '{print $2}'); do kill -9 =
> $pid; done ; for ((i =3D0; i< 8192; i++)); do ./vtpmctrl &&= gt;/dev/null & done
>
>  Stefan
> --------------------------= ----------------------------------------------------
> Site24x7 APM I= nsight: Get Deep Visibility into Application Performance
> APM + Mobi= le APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end= -to-end web transactions and take corrective actions now
> Troublesho= ot faster and improve end-user experience. Signup Now!
>
= http://pubads.g.doubleclick.net/gampad/clk?id= =3D272487151&iu=3D/4140
> =5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
> tpm= dd-devel mailing list
> tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>
https://lists.sourceforge.net/lists/listinfo/tpmdd-de= vel

--=_alternative 005BF67885257F5B_=-- --===============7112190030052393490== 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 --===============7112190030052393490== 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 --===============7112190030052393490==--