Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote on 04/12/2016 01:54:40 PM:

>
> On Tue, Apr 12, 2016 at 11:18:20AM -0400, Stefan Berger wrote:
> >    > Stick it before the TPM_CHIP_FLAG_VIRTUAL patch and throw away most of
> >    > that patch. Just add two flag checks into tpm_add/del_legacy_sysfs()
>
> >    Here's the v10 series now. If you want a better text for that patch,
> >    please let me know.
>
> Sure. I noticed a few other things, full tidied patch below, thanks for
> taking this on.
>
> >    I had to extend it to tpm-interface.c
> >    [2]
https://github.com/stefanberger/linux/commits/vtpm-driver.v10
>
> Yes, that looks right, thanks


Updated it with your patch and the ioctl fix.


>
> >    The patches pass my test suite and tpm tis seems to also work fine.
> >    [3]
https://github.com/stefanberger/linux-vtpm-tests
>
> >    > +   rc = __compat_only_sysfs_link_entry_to_kobj(
> >    > +      &chip->dev.parent->kobj, &chip->dev.kobj, "ppi");
> >    > +   if (rc && rc != -ENOENT)
> >    > +      goto out_err;
> >    I wonder whether it is necessary to goto out_err or not just return rc
> >    here?
>
> Correct
>
> Good catch on the tpm_pm_ functions too
>
> >    Also, for tpm0 I now find the following two pcrs entries, as well as
> >    all the rest of course:
> >    /sys/devices/pnp0/00:05/tpm/tpm0/pcrs
> >    /sys/devices/pnp0/00:05/pcrs
> >    Is this intentionately?
>
> Yes, the expectation is that the legacy path
> '/sys/devices/pnp0/00:05/pcrs' is a symlink to the new path
> '/sys/devices/pnp0/00:05/tpm/tpm0/pcrs'
>
> I assume you saw that all the symlinks were working?


Yes, all are working.

   Stefan