Re: [tpmdd-devel] [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-17 Thread Nayna
On 11/15/2016 05:14 AM, Jarkko Sakkinen wrote: > Use atomic bitops for chip->flags so that we do not need chip->is_open > and chip->duration_adjusted anymore. > > Signed-off-by: Jarkko Sakkinen > --- > drivers/char/tpm/st33zp24/st33zp24.c | 6 +++--- > drivers/char/tpm/tpm-chip.c | 14

Re: [tpmdd-devel] [PATCH RFC 2/2] tpm: refactor tpm2_get_tpm_pt to tpm2_getcap_cmd

2016-11-17 Thread Nayna
On 11/12/2016 05:32 AM, Jarkko Sakkinen wrote: > On Fri, Nov 11, 2016 at 09:51:45AM +0530, Nayna wrote: >> >> >> On 10/09/2016 03:44 PM, Jarkko Sakkinen wrote: >>> Refactored tpm2_get_tpm_pt to tpm2_getcap_cmd, which means that it also >>> takes capability ID as input. This is required to access

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-17 Thread Stefan Berger
On 11/16/2016 03:07 PM, Jason Gunthorpe wrote: > On Wed, Nov 16, 2016 at 12:07:23PM -0500, Stefan Berger wrote: >> The culprit seems to be 'tpm: fix the missing .owner in >> tpm_bios_measurements_ops' > That is unlikely, it is probably the patch before which calls read_log > unconditionally now. Th

Re: [tpmdd-devel] [PATCH] tpm: drop chip->is_open and chip->duration_adjusted

2016-11-17 Thread Jarkko Sakkinen
On Thu, Nov 17, 2016 at 04:10:29PM +0530, Nayna wrote: > On 11/15/2016 05:14 AM, Jarkko Sakkinen wrote: > > - if (chip->flags & (TPM_CHIP_FLAG_TPM2 | TPM_CHIP_FLAG_VIRTUAL)) > > - return 0; > > + if (test_bit(TPM_CHIP_FLAG_TPM2, &chip->flags) || > > + test_bit(TPM_CHIP_FLAG_VIRT

Re: [tpmdd-devel] [PATCH RFC 2/2] tpm: refactor tpm2_get_tpm_pt to tpm2_getcap_cmd

2016-11-17 Thread Jarkko Sakkinen
On Thu, Nov 17, 2016 at 05:20:36PM +0530, Nayna wrote: > I tested this for capability TPM2_CAP_PCRS. It seems TPM2_CAP_PCRS > capability always returns full PCR allocation, and more_data as 0, So, I > think the idea of looping over based on more_data may not work for this > capability. You can a

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-17 Thread Jason Gunthorpe
1;2802;0cOn Thu, Nov 17, 2016 at 07:35:05AM -0500, Stefan Berger wrote: > I ran the vtpm driver test suite (with -j32) a few times at that patch and > it didn't crash. It crashes severely with later patches applied. Here's the > current experimental patch that fixes these problems: I can't see how

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-17 Thread Stefan Berger
On 11/17/2016 01:10 PM, Jason Gunthorpe wrote: > 1;2802;0cOn Thu, Nov 17, 2016 at 07:35:05AM -0500, Stefan Berger wrote: >> I ran the vtpm driver test suite (with -j32) a few times at that patch and >> it didn't crash. It crashes severely with later patches applied. Here's the >> current experiment

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-17 Thread Jason Gunthorpe
On Thu, Nov 17, 2016 at 01:25:54PM -0500, Stefan Berger wrote: > > In the case of x86, tpm_read_log_of() is a stub return -ENODEV, which in > turn fails the whole device: Somehow this got screwed up during the lengthy review. ENODEV is the right return from the leaf routines but the tests in tpm_

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-17 Thread Jarkko Sakkinen
On Wed, Nov 16, 2016 at 01:07:59PM -0700, Jason Gunthorpe wrote: > On Wed, Nov 16, 2016 at 12:07:23PM -0500, Stefan Berger wrote: > > The culprit seems to be 'tpm: fix the missing .owner in > > tpm_bios_measurements_ops' > > That is unlikely, it is probably the patch before which calls read_log >

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-17 Thread Jarkko Sakkinen
On Thu, Nov 17, 2016 at 07:35:05AM -0500, Stefan Berger wrote: > On 11/16/2016 03:07 PM, Jason Gunthorpe wrote: > > On Wed, Nov 16, 2016 at 12:07:23PM -0500, Stefan Berger wrote: > > > The culprit seems to be 'tpm: fix the missing .owner in > > > tpm_bios_measurements_ops' > > That is unlikely, it

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-17 Thread Stefan Berger
On 11/17/2016 01:33 PM, Jason Gunthorpe wrote: > On Thu, Nov 17, 2016 at 01:25:54PM -0500, Stefan Berger wrote: >> In the case of x86, tpm_read_log_of() is a stub return -ENODEV, which in >> turn fails the whole device: > Somehow this got screwed up during the lengthy review. ENODEV is the > right

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Do not access host's event log

2016-11-17 Thread Jarkko Sakkinen
On Thu, Nov 17, 2016 at 06:15:20PM -0500, Stefan Berger wrote: > On 11/17/2016 01:33 PM, Jason Gunthorpe wrote: > > On Thu, Nov 17, 2016 at 01:25:54PM -0500, Stefan Berger wrote: > > > In the case of x86, tpm_read_log_of() is a stub return -ENODEV, which in > > > turn fails the whole device: > > So

[tpmdd-devel] [PATCH 1/2] tpm: Check for parent device being NULL

2016-11-17 Thread Stefan Berger
Check for the parent device being NULL before accessing it. This prevents crashed with the vtpm_proxy driver, since this driver does not have a parent device. Signed-off-by: Stefan Berger --- drivers/char/tpm/tpm_of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ch

[tpmdd-devel] [PATCH 2/2] tpm: Fix error code handling after tpm_bios_log_setup

2016-11-17 Thread Stefan Berger
tpm_bios_log_setup() may return -ENODEV in case no log was found. In this case we do not need to fail the device. Signed-off-by: Stefan Berger --- drivers/char/tpm/tpm-chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-ch