Jason Gunthorpe <[email protected]> wrote on 02/12/2016 
01:34:15 PM:

> 
> 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 <[email protected]> wrote on 02/11/
> >    > 2016 06:56:11 PM:
> >    >
> >    >
> >    > >
> >    > > On Thu, Feb 11, 2016 at 05:26:24PM -0500, Stefan Berger wrote:
> >    > >
> >    > > >    > What is the point of tpmm_chip_dev?
> >    > > >    So that the usage model of the chip is the same. We get 
this
> >    in the
> >    > > >    tpm-vtpm.c with tpm_alloc_chip + tpmm_chip_dev while all
> >    others can
> >    > > >    call tpmm_chip_alloc, which combines the two.
> >    > >
> >    > > No need, just don't use devm in vtpm, that is even better. The
> >    > > standard devm idiom is a with and without version.
> >    >
> >    > 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 ?
> >    >
> >    > [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 = 0; i < 4096; i++)); do ./vtpmctrl & done
> 
> Yeah, that looks good, thanks for doing 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 gives up ID 123, while the vTPM driver still has the 
device name vtpms123 registered with sysfs. Now the next device is 
created, ID 123 is 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_chip_alloc / tpm_chip_alloc unnecessary since 
we don't need the ID from the chip anymore. Now the below test runs 
stable.


for pid in $(ps aux | grep vtpm | gawk '{print $2}'); do kill -9 $pid; 
done ; for ((i =0; i< 8192; i++)); do ./vtpmctrl &>/dev/null & done

 Stefan


------------------------------------------------------------------------------
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
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to