Re: [tpmdd-devel] [PATCH v3 1/7] tpm_crb: Use the common ACPI definition of struct acpi_tpm2

2016-01-04 Thread Jarkko Sakkinen
On Mon, Jan 04, 2016 at 11:23:17AM -0700, Jason Gunthorpe wrote: > On Sun, Jan 03, 2016 at 07:09:06PM +0200, Jarkko Sakkinen wrote: > > On Thu, Dec 17, 2015 at 11:23:14AM -0700, Jason Gunthorpe wrote: > > > include/acpi/actbl2.h is the proper place for these definitions > &g

Re: [tpmdd-devel] [PATCH] tpm: remove unneeded include of actbl2.h

2016-01-04 Thread Jarkko Sakkinen
On Mon, Jan 04, 2016 at 12:19:43PM -0700, Jerry Snitselaar wrote: > tpm_tis.c already gets actbl2.h via linux/acpi.h -> acpi/acpi.h -> > acpi/actbl.h -> acpi/actbl2.h, so the direct include in tpm_tis.c > is not needed. > > Signed-off-by: Jerry Snitselaar <jsnit...@re

Re: [tpmdd-devel] [PATCH v4 7/7] tpm_crb: Use devm_ioremap_resource

2016-01-08 Thread Jarkko Sakkinen
ew changes make sense. > > Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> > Tested-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> PS. There's one cocci warning. I'll amend the fixup fo

[tpmdd-devel] Fixes for Linux 4.5

2016-01-11 Thread Jarkko Sakkinen
Hi Could you check the patches that have been authored by you that they are as you would expect them to be before I tag and merge to my next branch: https://github.com/jsakkine/linux-tpmdd/commits/master Thanks. /Jarkko

[tpmdd-devel] [PATCH 1/3] tpm_crb: fix crb_req_canceled behavior

2016-06-07 Thread Jarkko Sakkinen
t;) Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm_crb.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 1547636..b4d46ae 100644 --- a/drivers/char/tpm/tpm_crb

[tpmdd-devel] [PATCH 0/3] Runtime PM for TPM2 CRB chips

2016-06-07 Thread Jarkko Sakkinen
Support for runtime PM with TPM2 CRB chips such as PTT in Skylake. Jarkko Sakkinen (3): tpm_crb: fix crb_req_canceled behavior tpm, tpm_crb: remove wmb()'s tpm, tpm_crb: runtime power management drivers/char/tpm/tpm-interface.c | 3 ++ drivers/char/tpm/tpm_crb.c | 72

[tpmdd-devel] [PATCH 2/3] tpm, tpm_crb: remove wmb()'s

2016-06-07 Thread Jarkko Sakkinen
wmb()'s are not needed as iowrite32() is used. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm_crb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index b4d46ae..ca2cad9 100644 --- a/d

[tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management

2016-06-07 Thread Jarkko Sakkinen
for CRB start (MMIO) based devices. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm-interface.c | 3 ++ drivers/char/tpm/tpm_crb.c | 62 ++-- 2 files changed, 63 insertions(+), 2 deletions(-) diff

Re: [tpmdd-devel] TPM microconf at Linux Plumbers Conference?

2016-06-07 Thread Jarkko Sakkinen
On Mon, Jun 06, 2016 at 07:57:13PM +0100, Matthew Garrett wrote: > Hi, > > I'm looking into running a TPM microconference at the Linux Plubmers > Conference in Santa Fe the first week of November. Right now we have a > bunch of individual pieces of TPM-related technology, but little overall >

Re: [tpmdd-devel] [PATCH v3 3/4] tpm: Allow TPM chip drivers to override reported command durations

2016-06-07 Thread Jarkko Sakkinen
On Mon, Jun 06, 2016 at 08:37:28PM -0700, Ed Swierk wrote: > Some TPM chips report bogus command durations in their capabilities, > just as others report incorrect timeouts. Add an update_durations() > function and an implementation for tpm_tis, and move the existing > BCM0102 workaround out of

Re: [tpmdd-devel] [PATCH v2] tpm_tis: Increase ST19NP18 TPM command timeout to avoid chip lockup

2016-06-07 Thread Jarkko Sakkinen
On Mon, Jun 06, 2016 at 06:48:10PM -0700, Ed Swierk wrote: > On Mon, Jun 6, 2016 at 6:07 PM, Stefan Berger wrote: > > Ed Swierk wrote on 06/06/2016 06:27:59 PM: > > > The occurrence of this excessive command duration depends on the > > > sequence

Re: [tpmdd-devel] [PATCH v3 2/4] tpm: Add optional logging of TPM command durations

2016-06-07 Thread Jarkko Sakkinen
'module tpm +p' >/sys/kernel/debug/dynamic_debug/control > > on a kernel configured with DYNAMIC_DEBUG=y. > > Signed-off-by: Ed Swierk <eswi...@skyportsystems.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> > --- > drivers/char/tpm/tpm-inte

Re: [tpmdd-devel] [PATCH v3 1/4] tpm_tis: Improve reporting of IO errors

2016-06-07 Thread Jarkko Sakkinen
during init. > > Signed-off-by: Ed Swierk <eswi...@skyportsystems.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> PS. Please include at minimum also linux-ker...@vger.kernel.org and linux-security-mod...@vger.kernel.org for these patches. Thanks. > ---

Re: [tpmdd-devel] [PATCH v5 3/4] tpm: Allow TPM chip drivers to override reported command durations

2016-06-10 Thread Jarkko Sakkinen
On Wed, Jun 08, 2016 at 04:00:17PM -0700, Ed Swierk wrote: > Some TPM chips report bogus command durations in their capabilities, > just as others report incorrect timeouts. Rework tpm_get_timeouts() > to allow chip drivers to override either via a single callback. > Also clean up handling of TPMs

Re: [tpmdd-devel] [PATCH v5 3/4] tpm: Allow TPM chip drivers to override reported command durations

2016-06-10 Thread Jarkko Sakkinen
On Fri, Jun 10, 2016 at 10:34:15AM -0700, Ed Swierk wrote: > On Fri, Jun 10, 2016 at 5:19 AM, Jarkko Sakkinen > <jarkko.sakki...@linux.intel.com> wrote: > > On Wed, Jun 08, 2016 at 04:00:17PM -0700, Ed Swierk wrote: > >> Some TPM chips report bogus command dura

[tpmdd-devel] [PATCH] tpm_crb: fix crb_req_canceled behavior

2016-06-03 Thread Jarkko Sakkinen
t;) Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm_crb.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 1547636..b4d46ae 100644 --- a/drivers/char/tpm/tpm_crb

Re: [tpmdd-devel] [PATCH v8 0/7] Rework of tpm_tis to share common logic across phy's (lpc/spi/-i2c-)

2016-05-26 Thread Jarkko Sakkinen
On Thu, May 26, 2016 at 09:19:23AM -0400, Stefan Berger wrote: > Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> wrote on 05/26/2016 >08:26:35 AM: > >> >> Stefan, Peter, >> >> Would it be possible for you to smoke test this patc

Re: [tpmdd-devel] [PATCH v2] tpm: Factor out common startup code

2016-05-26 Thread Jarkko Sakkinen
On Mon, May 16, 2016 at 12:25:47PM -0600, Jason Gunthorpe wrote: > Provide some flags in tpm_class_ops to allow drivers to opt-in to the > common startup sequence. This is the sequence used by tpm_tis and > tpm_crb. > > All drivers should set this flag. > > Signed-off-by: Jason Gunthorpe

Re: [tpmdd-devel] [PATCH v8 0/7] Rework of tpm_tis to share common logic across phy's (lpc/spi/-i2c-)

2016-05-26 Thread Jarkko Sakkinen
Stefan, Peter, Would it be possible for you to smoke test this patch set? I'm very happy with the current version and have tested it myself but since this is a large infra change inside the subsystem I cannot include it to a kernel release before it is tested by multiple parties. /Jarkko On

Re: [tpmdd-devel] [PATCH v8 0/7] Rework of tpm_tis to share common logic across phy's (lpc/spi/-i2c-)

2016-05-30 Thread Jarkko Sakkinen
Thanks Peter! I'll add your and Stefans Reviewed/Tested-by's before I merge these to next (will happen around rc5). /Jarkko On Sat, May 28, 2016 at 10:59:10AM +0200, Peter Huewe wrote: > Thanks for all your efforts!!! I'm sorry I couldn't participate more. :( > So thanks a lot to all of you for

Re: [tpmdd-devel] [PATCH 1/2] tpm: Factor out common startup code

2016-06-22 Thread Jarkko Sakkinen
On Mon, Jun 20, 2016 at 03:07:57PM -0600, Jason Gunthorpe wrote: > On Sun, Jun 19, 2016 at 02:39:24PM +0200, Jarkko Sakkinen wrote: > > > Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> > > > Tested-by: Andrew Zamansky <andrew.zaman...@nuvo

[tpmdd-devel] [PATCH] tpm: unify tpm_gen_interrupt() and fix error handling

2016-06-16 Thread Jarkko Sakkinen
to the caller. * Updated tpm_tis to fail in the case of a system error. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm-interface.c | 25 +++-- drivers/char/tpm/tpm.h | 3 +-- drivers/char/tpm/tpm2-cmd.c

[tpmdd-devel] [PATCH] tpm_vtpm_proxy: fix sparse warning

2016-06-16 Thread Jarkko Sakkinen
//tpm_vtpm_proxy.c:559:34:got struct vtpm_proxy_new_dev *vtpm_new_dev_p The __user annotation was missing from the corresponding variable. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm_vtpm_proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [tpmdd-devel] [PATCH v6 4/5] tpm: Allow TPM chip drivers to override reported command durations

2016-06-16 Thread Jarkko Sakkinen
On Fri, Jun 10, 2016 at 06:55:06PM -0700, Ed Swierk wrote: > Some TPM chips report bogus command durations in their capabilities, > just as others report incorrect timeouts. Rework tpm_get_timeouts() to > allow chip drivers to override either via a single callback. Also > clean up handling of TPMs

Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management

2016-06-16 Thread Jarkko Sakkinen
On Thu, Jun 16, 2016 at 09:57:35PM +0200, Jarkko Sakkinen wrote: > Hi Thomas, > > I'm on a vacation this week but I'll give you quick answers :) > > On Tue, Jun 14, 2016 at 04:14:58PM +0300, Tomas Winkler wrote: > > On Wed, Jun 8, 2016 at 2:02 AM, Jarkko Sakki

Re: [tpmdd-devel] [PATCH] tpm: use devm_add_action_or_reset

2016-06-16 Thread Jarkko Sakkinen
function has been already called by the helper if > there was any error. > > Signed-off-by: Sudip Mukherjee <sudip.mukher...@codethink.co.uk> Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> /Jarkko > --- > drivers/char/tpm/tpm-chip.c | 8 ---

Re: [tpmdd-devel] [PATCH v6 3/5] tpm: Factor out reading of timeout and duration capabilities

2016-06-16 Thread Jarkko Sakkinen
On Fri, Jun 10, 2016 at 06:55:05PM -0700, Ed Swierk wrote: > Factor sending the TPM_GetCapability command and validating the result > from tpm_get_timeouts() into a new function. Return all errors to the > caller rather than swallowing them (e.g. when tpm_transmit_cmd() > returns nonzero). LGTM

Re: [tpmdd-devel] [PATCH] tpm_vtpm_proxy: fix sparse warning

2016-06-16 Thread Jarkko Sakkinen
On Thu, Jun 16, 2016 at 09:39:38AM -0400, Stefan Berger wrote: > On 06/16/2016 06:37 AM, Jarkko Sakkinen wrote: > >When running make C=2 M=drivers/char/tpm/ > > > > CC [M] drivers/char/tpm//tpm_crb.o > > CHECK drivers/char/tpm//tpm_vtpm_proxy.c > >drivers/

Re: [tpmdd-devel] [PATCH v7 5/5] tpm_tis: Increase ST19NP18 TPM command duration to avoid chip lockup

2016-06-21 Thread Jarkko Sakkinen
On Mon, Jun 20, 2016 at 06:54:02PM -0700, Ed Swierk wrote: > The STMicro ST19NP18-TPM sometimes takes much longer to execute > commands than it reports in its capabilities. For example, command 186 > (TPM_FlushSpecific) has been observed to take 14560 msec to complete, > far longer than the 3000

Re: [tpmdd-devel] [PATCH v6 3/5] tpm: Factor out reading of timeout and duration capabilities

2016-06-19 Thread Jarkko Sakkinen
On Fri, Jun 10, 2016 at 06:55:05PM -0700, Ed Swierk wrote: > Factor sending the TPM_GetCapability command and validating the result > from tpm_get_timeouts() into a new function. Return all errors to the > caller rather than swallowing them (e.g. when tpm_transmit_cmd() > returns nonzero). > >

Re: [tpmdd-devel] [PATCH v2 0/3] Runtime PM for TPM2 CRB chips

2016-06-19 Thread Jarkko Sakkinen
On Sat, Jun 18, 2016 at 05:10:25PM +0200, Jarkko Sakkinen wrote: > These patches implement support for runtime PM with TPM2 CRB chips such > as PTT in Skylake. > > This is very naive implementation since the TPM is resumed and supended > for every transaction thus causing tota

[tpmdd-devel] [PATCH 5/5] tpm: use tpm1_pcr_read() in tpm_do_selftest()

2016-06-17 Thread Jarkko Sakkinen
Remove ad-hoc protocol message construction and call instead tpm1_pcr_read(). Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm-interface.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/char/tpm/tpm-interfa

[tpmdd-devel] [PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe()

2016-06-17 Thread Jarkko Sakkinen
It is better to tpm_transmit_cmd() in tpm2_probe() in order to get consistent command handling throughout the subsystem. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm2-cmd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/d

Re: [tpmdd-devel] [PATCH 0/2] Fixes for sparse reported warnings

2016-06-18 Thread Jarkko Sakkinen
On Fri, Jun 17, 2016 at 04:39:27PM +0200, Jarkko Sakkinen wrote: > Jarkko Sakkinen (2): > tpm_vtpm_proxy: fix address space of a user pointer in > vtpmx_fops_ioctl() > tpm_crb: fix address space of the return pointer in crb_map_res() Merged to ne

Re: [tpmdd-devel] [PATCH 4/4 v3] add tpm2 capability test flag to tpm_tis driver

2016-06-20 Thread Jarkko Sakkinen
Isn't tpm2_probe() call now twice in tpm_tis initialization? On Mon, Jun 20, 2016 at 01:07:09PM +0300, andrew zamansky wrote: > Signed-off-by: Andrew Azmansky > --- > drivers/char/tpm/tpm_tis.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

[tpmdd-devel] [PATCH v2 2/3] tpm, tpm_crb: remove wmb()'s

2016-06-18 Thread Jarkko Sakkinen
wmb()'s are not needed as iowrite32() is used. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm_crb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 8819ef7..0c8ed7f 100644 --- a/d

[tpmdd-devel] [PATCH v2 3/3] tpm, tpm_crb: runtime power management

2016-06-18 Thread Jarkko Sakkinen
for CRB start (MMIO) based devices. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm-interface.c | 3 +++ drivers/char/tpm/tpm_crb.c | 50 ++-- 2 files changed, 51 insertions(+), 2 deletions(-) diff

[tpmdd-devel] [PATCH v2 0/3] Runtime PM for TPM2 CRB chips

2016-06-18 Thread Jarkko Sakkinen
. Jarkko Sakkinen (3): tpm_crb: fix crb_req_canceled behavior tpm, tpm_crb: remove wmb()'s tpm, tpm_crb: runtime power management drivers/char/tpm/tpm-interface.c | 3 ++ drivers/char/tpm/tpm_crb.c | 60 +++- 2 files changed, 56 insertions(+), 7

[tpmdd-devel] [PATCH 1/2] tpm_vtpm_proxy: fix address space of a user pointer in vtpmx_fops_ioctl()

2016-06-17 Thread Jarkko Sakkinen
//tpm_vtpm_proxy.c:559:34:got struct vtpm_proxy_new_dev *vtpm_new_dev_p The __user annotation was missing from the corresponding variable. Fixes: 794c38e01358 ("tpm: Proxy driver for supporting multiple emulated TPMs") Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> T

[tpmdd-devel] [PATCH 0/2] Fixes for sparse reported warnings

2016-06-17 Thread Jarkko Sakkinen
Jarkko Sakkinen (2): tpm_vtpm_proxy: fix address space of a user pointer in vtpmx_fops_ioctl() tpm_crb: fix address space of the return pointer in crb_map_res() drivers/char/tpm/tpm_crb.c| 2 +- drivers/char/tpm/tpm_vtpm_proxy.c | 2 +- 2 files changed, 2 insertions(+), 2

Re: [tpmdd-devel] TPM emulator driver status

2016-01-15 Thread Jarkko Sakkinen
On Thu, Jan 14, 2016 at 01:42:26PM +, David Howells wrote: > Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> wrote: > > > > Is the TPM emulator likely to go upstream at any point? Or is it waiting > > > for some sort of update? > > > > Saw K

[tpmdd-devel] [PATCH v2 5/6] tpm: rename tpm_pcr_read_dev() to tpm1_pcr_read()

2016-06-25 Thread Jarkko Sakkinen
Gave more consistent name tpm1_pcr_read() as the TPM2 version is called tpm2_pcr_read(). Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm-interface.c | 4 ++-- drivers/char/tpm/tpm-sysfs.c | 2 +- drivers/char/tpm/tpm.h | 2 +- 3

[tpmdd-devel] [PATCH v2 6/6] tpm: use tpm1_pcr_read() in tpm_do_selftest()

2016-06-25 Thread Jarkko Sakkinen
Remove ad-hoc protocol message construction and call instead tpm1_pcr_read(). Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm-interface.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/char/tpm/tpm-interfa

[tpmdd-devel] [PATCH v2 2/6] tpm: unify tpm_gen_interrupt()

2016-06-25 Thread Jarkko Sakkinen
Migrated into single tpm_gen_interrupt() function and cleaned up the whole construction in general because it was starting to turn into a train wreck. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm-interface.c | 23 ++- driver

[tpmdd-devel] [PATCH v2 3/6] tpm: return error code from tpm_gen_interrupt()

2016-06-25 Thread Jarkko Sakkinen
Return error code from tpm_gen_interrupt() and fail tpm_tis family of drivers on a system error. It doesn't make sense to continue if we cannot even reach the TPM. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm-interface.c | 6 +++--- drivers/ch

[tpmdd-devel] [PATCH v2 1/6] tpm: remove unnecessary externs from tpm.h

2016-06-25 Thread Jarkko Sakkinen
Removed unnecessary externs from tpm.h. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm.h | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h

[tpmdd-devel] [PATCH v2 0/6] Use tpm_transmit_cmd() consistently

2016-06-25 Thread Jarkko Sakkinen
declarations in tpm.h as suggested by Jason Gunthorpe. Jarkko Sakkinen (6): tpm: remove unnecessary externs from tpm.h tpm: unify tpm_gen_interrupt() tpm: return error code from tpm_gen_interrupt() tpm: use tpm_transmit_cmd() in tpm2_probe() tpm: rename tpm_pcr_read_dev() to tpm1_pcr_read

Re: [tpmdd-devel] [PATCH] tpm: vtpm_proxy: Introduce flag to prevent sysfs entries

2016-06-27 Thread Jarkko Sakkinen
On Fri, Jun 24, 2016 at 02:43:00PM -0400, Stefan Berger wrote: > On 06/24/2016 01:48 PM, Jason Gunthorpe wrote: > >On Fri, Jun 24, 2016 at 10:36:55AM -0400, Stefan Berger wrote: > >>Introduce TPM_VTPM_PROXY_NO_SYSFS flag that prevents a vtpm_proxy driver > >>instance from having the typical sysfs

Re: [tpmdd-devel] [PATCH v8 2/5] tpm: Add optional logging of TPM command durations

2016-06-24 Thread Jarkko Sakkinen
On Fri, Jun 24, 2016 at 12:27:27PM -0600, Jason Gunthorpe wrote: > On Tue, Jun 21, 2016 at 06:10:28PM -0700, Ed Swierk wrote: > > > if (chip->ops->req_canceled(chip, status)) { > > dev_err(chip->pdev, "Operation Canceled\n"); > > +

Re: [tpmdd-devel] [PATCH 1/5] tpm: unify tpm_gen_interrupt()

2016-06-24 Thread Jarkko Sakkinen
On Fri, Jun 24, 2016 at 01:30:24PM -0600, Jason Gunthorpe wrote: > On Fri, Jun 17, 2016 at 11:10:43PM +0200, Jarkko Sakkinen wrote: > > extern int tpm_get_timeouts(struct tpm_chip *); > > -extern void tpm_gen_interrupt(struct tpm_chip *); > > +void tpm_gen_inte

Re: [tpmdd-devel] [PATCH v8 1/5] tpm_tis: Improve reporting of IO errors

2016-06-24 Thread Jarkko Sakkinen
Hi Jason, On Fri, Jun 24, 2016 at 12:25:15PM -0600, Jason Gunthorpe wrote: > > expected = be32_to_cpu(*(__be32 *) (buf + 2)); > > if (expected > count) { > > + dev_err(chip->pdev, "Response too long (wanted %zd, got %d)\n", > > + count, expected); > > This all

Re: [tpmdd-devel] [PATCH v8 1/5] tpm_tis: Improve reporting of IO errors

2016-06-25 Thread Jarkko Sakkinen
On Sat, Jun 25, 2016 at 06:24:30PM +0300, Jarkko Sakkinen wrote: > On Fri, Jun 24, 2016 at 02:26:15PM -0600, Jason Gunthorpe wrote: > > On Fri, Jun 24, 2016 at 11:21:31PM +0300, Jarkko Sakkinen wrote: > > > Hmm... Do you mean by 4 month old stuff the stuff that is in mainline &

[tpmdd-devel] buildroot env for tpmdd

2016-02-08 Thread Jarkko Sakkinen
Hi I'm in the process of building buildroot env for testing tpmdd: http://git.infradead.org/users/jjs/buildroot-tpmdd.git This is still very much WiP so except it to be rebased often. The idea is to be able to quickly create a kernel + working user space that lives inside initramfs for testing

Re: [tpmdd-devel] resource sanity fails on ioremap

2016-02-04 Thread Jarkko Sakkinen
On Thu, Feb 04, 2016 at 04:49:47PM -0700, Jason Gunthorpe wrote: > On Wed, Feb 03, 2016 at 03:37:01PM -0800, Jarkko Sakkinen wrote: > > Hi > > > > I've been investigating this bug: > > > > https://bugzilla.kernel.org/show_bug.cgi?id=111511 > > > >

Re: [tpmdd-devel] [PATCH v5 4/5] Initialize TPM and get durations and timeouts

2016-02-10 Thread Jarkko Sakkinen
On Wed, Feb 10, 2016 at 07:38:52PM -0500, Stefan Berger wrote: >Jason Gunthorpe wrote on 02/10/2016 >05:23:13 PM: > >> >> >> >> We shouldn't artificially limit the number of devices if >> >> virtualization is the target. Use an

[tpmdd-devel] [GIT PULL] tpmdd fixes for Linux 4.5 (updated)

2016-02-09 Thread Jarkko Sakkinen
) tpmdd fixes for Linux 4.5 (updated) Jarkko Sakkinen (3): tpm: fix checks for policy digest existence in tpm2_seal_trusted() tpm: fix the rollback in tpm_chip_register() tpm: fix the cleanup of struct

Re: [tpmdd-devel] [PATCH v5 4/5] Initialize TPM and get durations and timeouts

2016-02-09 Thread Jarkko Sakkinen
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: > > > > > > > > > > On Mon, Feb 08, 2016 at 02:27:07PM -0500, Stefan

Re: [tpmdd-devel] [PATCH] tpm_eventlog.c: fix binary_bios_measurements

2016-02-09 Thread Jarkko Sakkinen
ian conversion on the size and tried > to output the event data from the copied version, which has only have > one byte of the data, resulting in garbage event data. > > Signed-off-by: Harald Hoyer <har...@redhat.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.

Re: [tpmdd-devel] [PATCH v5 4/5] Initialize TPM and get durations and timeouts

2016-02-10 Thread Jarkko Sakkinen
On Wed, Feb 10, 2016 at 12:15:44AM -0500, Stefan Berger wrote: > Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> 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

Re: [tpmdd-devel] resource sanity fails on ioremap

2016-02-10 Thread Jarkko Sakkinen
On Fri, Feb 05, 2016 at 11:28:57AM -0800, Jarkko Sakkinen wrote: > On Fri, Feb 05, 2016 at 10:42:58AM -0700, Jason Gunthorpe wrote: > > On Fri, Feb 05, 2016 at 08:47:04AM -0800, Jarkko Sakkinen wrote: > > > > > Right, thanks for the explanation and I'm able to reproduce

Re: [tpmdd-devel] resource sanity fails on ioremap

2016-02-10 Thread Jarkko Sakkinen
On Wed, Feb 10, 2016 at 02:22:27PM +0200, Jarkko Sakkinen wrote: > On Fri, Feb 05, 2016 at 11:28:57AM -0800, Jarkko Sakkinen wrote: > > On Fri, Feb 05, 2016 at 10:42:58AM -0700, Jason Gunthorpe wrote: > > > On Fri, Feb 05, 2016 at 08:47:04AM -0800, Jarkko Sakkinen wrote: &g

Re: [tpmdd-devel] [PATCH 10/12] tpm: st33zp24: Add support for acpi probing for spi device.

2016-02-11 Thread Jarkko Sakkinen
"\\_SB.GPO2", 0x00, ResourceConsumer, ,) > { // Pin list > 0x0002, > } > }) > Return (SBUF) /* \_SB_.SPI1.TPM1._CRS.SBUF */ > } > Method (_STA, 0, NotSerialized) // _STA: Status

Re: [tpmdd-devel] [PATCH 08/12] tpm/st33zp24: Extend Copyright headers

2016-02-11 Thread Jarkko Sakkinen
On Tue, Feb 09, 2016 at 10:26:57AM +0100, Christophe Ricard wrote: > Extend copyright header to 2016 > > Signed-off-by: Christophe Ricard <christophe-h.ric...@st.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> /Jarkko > --- > drivers/char/tp

Re: [tpmdd-devel] [PATCH] tpm: fix the cleanup of struct tpm_chip

2016-02-11 Thread Jarkko Sakkinen
On Thu, Feb 11, 2016 at 12:34:15PM -0700, Jason Gunthorpe wrote: > On Tue, Feb 09, 2016 at 05:30:30AM +0200, Jarkko Sakkinen wrote: > > If the initialization fails before tpm_chip_register(), put_device() > > will be not called, which causes release callback not to be called. >

[tpmdd-devel] [PATCH v2 1/4] tpm: fix: keep auth session intact after unseal operation

2016-02-13 Thread Jarkko Sakkinen
attribute to keep the session intact after a successful unseal operation thus making the behavior consistent. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> Fixes: 5beb0c435b ("keys, trusted: seal with a TPM2 authorization policy") --- drivers/char/tpm/tpm2-cmd.c |

[tpmdd-devel] [PATCH v2 3/4] tpm: Hold the kref during tpm_chip_find_get

2016-02-13 Thread Jarkko Sakkinen
From: Jason Gunthorpe <jguntho...@obsidianresearch.com> This was missed during the struct device conversion, we need to hold a kref on the chip to make sure it isn't freed. Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Reviewed-by: Jarkko Sakkinen &

[tpmdd-devel] [PATCH] tpm, tpm_crb: fix control area resource mapping

2016-01-28 Thread Jarkko Sakkinen
Control area does not always fall in the range of memory resource given by the ACPI object. This patch fixes the issue by ioremapping the buffers if this is the case. Fixes: bb76f9ba49 ("tpm_crb: Use devm_ioremap_resource") Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@li

[tpmdd-devel] moving tpmdd tree

2016-02-02 Thread Jarkko Sakkinen
I'm moving tpmdd in near future (probably soon after 4.5 has been tagged) to git.infradead.org. I guess this won't be a too big fuzz for anyone? You can expect this not to happen before Linus tags v4.5. /Jarkko --

Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-03 Thread Jarkko Sakkinen
On Tue, Feb 02, 2016 at 04:13:53PM -0700, Jason Gunthorpe wrote: > On Sat, Jan 30, 2016 at 06:05:42PM -0800, Jarkko Sakkinen wrote: > > The release-callback is not used before the device is attached to the > > device hierarchy. This caused resources not to cleanup properly if the &g

[tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-01-30 Thread Jarkko Sakkinen
device in tpmm_chip_alloc(). Fixes: 313d21eeab ("tpm: device class for tpm") Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> cc: sta...@vger.kernel.org --- drivers/char/tpm/tpm-chip.c | 43 --- 1 file changed, 24 insertions(

Re: [tpmdd-devel] [RFC PATCH 3/4] Implement driver for supporting multiple emulated TPMs

2016-01-27 Thread Jarkko Sakkinen
On Wed, Jan 27, 2016 at 11:24:48AM -0700, Jason Gunthorpe wrote: > On Wed, Jan 27, 2016 at 06:22:39AM -0800, Jarkko Sakkinen wrote: > > > Also, I'm wondering is it right to have this as a separate module or > > should this be part of the core TPM infrastructure? > >

Re: [tpmdd-devel] [PATCH v3 06/11] tpm: Split out the devm stuff from tpmm_chip_alloc

2016-02-22 Thread Jarkko Sakkinen
On Fri, Feb 19, 2016 at 07:42:03AM -0500, Stefan Berger wrote: > From: Jason Gunthorpe > > tpm_chip_alloc becomes a typical subsystem allocate call. Maybe a more verbose commit message? > > Signed-off-by: Jason Gunthorpe > ---

Re: [tpmdd-devel] [GIT PULL] remaining tpmdd fixes for Linux 4.5

2016-02-22 Thread Jarkko Sakkinen
On Mon, Feb 22, 2016 at 12:11:48PM -0700, Jason Gunthorpe wrote: > On Mon, Feb 22, 2016 at 09:08:28PM +0200, Jarkko Sakkinen wrote: > > On Mon, Feb 22, 2016 at 10:52:45AM -0700, Jason Gunthorpe wrote: > > > On Mon, Feb 22, 2016 at 04:50:23PM +0200, Jarkko Sakkinen wrote: > &

Re: [tpmdd-devel] [PATCH v3 05/11] tpm: Get rid of module locking

2016-02-22 Thread Jarkko Sakkinen
On Fri, Feb 19, 2016 at 07:42:02AM -0500, Stefan Berger wrote: > Get rid of the locking of the module > > Signed-off-by: Stefan Berger I tend to think that this should have been part of the previous patch with the description in the commit message why the

Re: [tpmdd-devel] [PATCH v3 02/11] tpm: Get rid of chip->pdev

2016-02-22 Thread Jarkko Sakkinen
y of the code. The kref on the parent is held > by the device core during device_add and dropped in device_del > > Signed-off-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> There was couple of places where I would ad

Re: [tpmdd-devel] [PATCH v3 09/11] tpm: Driver for supporting multiple emulated TPMs

2016-02-23 Thread Jarkko Sakkinen
On Tue, Feb 23, 2016 at 07:09:44AM -0500, Stefan Berger wrote: > Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> wrote on 02/23/2016 >05:22:11 AM: > >> > +struct vtpm_dev { >> > + struct tpm_chip *chip; >> > + >> > +

Re: [tpmdd-devel] [PATCH v3 09/11] tpm: Driver for supporting multiple emulated TPMs

2016-02-23 Thread Jarkko Sakkinen
On Fri, Feb 19, 2016 at 07:42:06AM -0500, Stefan Berger wrote: > This patch implements a driver for supporting multiple emulated TPMs in a > system. > > The driver implements a device /dev/vtpmx that is used to created > a client device pair /dev/tpmX (e.g., /dev/tpm10) and a server side that >

Re: [tpmdd-devel] [GIT PULL] remaining tpmdd fixes for Linux 4.5

2016-02-22 Thread Jarkko Sakkinen
On Mon, Feb 22, 2016 at 12:56:53PM +1100, James Morris wrote: > On Sat, 20 Feb 2016, Jarkko Sakkinen wrote: > > > Hi James, > > > > I'm sorry for the late pull request for 4.5. The reason for this was > > the latency in my previous one. I picked with care the ab

Re: [tpmdd-devel] [PATCH v3 06/11] tpm: Split out the devm stuff from tpmm_chip_alloc

2016-02-23 Thread Jarkko Sakkinen
On Mon, Feb 22, 2016 at 03:13:28PM -0700, Jason Gunthorpe wrote: > On Mon, Feb 22, 2016 at 11:14:14PM +0200, Jarkko Sakkinen wrote: > > On Fri, Feb 19, 2016 at 07:42:03AM -0500, Stefan Berger wrote: > > > From: Jason Gunthorpe <jguntho...@obsidianresearch.com> > > &

Re: [tpmdd-devel] [PATCH v3 04/11] tpm: Provide strong locking for device removal

2016-02-22 Thread Jarkko Sakkinen
On Fri, Feb 19, 2016 at 07:42:01AM -0500, Stefan Berger wrote: > From: Jason Gunthorpe > > Add a read/write semaphore around the ops function pointers so > ops can be set to null when the driver un-registers. > > Previously the tpm core expected module locking

Re: [tpmdd-devel] [PATCH v3 04/11] tpm: Provide strong locking for device removal

2016-02-23 Thread Jarkko Sakkinen
On Tue, Feb 23, 2016 at 12:52:46PM -0700, Jason Gunthorpe wrote: > On Tue, Feb 23, 2016 at 09:40:14PM +0200, Jarkko Sakkinen wrote: > > > > echo 1 > /sys/.../remove > > > > > > Is basically the same as a module unload without requiring module > > >

Re: [tpmdd-devel] [PATCH v3 04/11] tpm: Provide strong locking for device removal

2016-02-23 Thread Jarkko Sakkinen
On Mon, Feb 22, 2016 at 03:20:17PM -0700, Jason Gunthorpe wrote: > > I'm just thinking is the try_module_get() and module_put() even > > necessary after this change? You know that device is not unregistered > > from chip->ops field, which is protected by that RW-semaphore. > > The module locking

Re: [tpmdd-devel] [PATCH v3 04/11] tpm: Provide strong locking for device removal

2016-02-23 Thread Jarkko Sakkinen
On Mon, Feb 22, 2016 at 03:20:17PM -0700, Jason Gunthorpe wrote: > On Mon, Feb 22, 2016 at 11:08:59PM +0200, Jarkko Sakkinen wrote: > > On Fri, Feb 19, 2016 at 07:42:01AM -0500, Stefan Berger wrote: > > > From: Jason Gunthorpe <jguntho...@obsidianresearch.com> >

Re: [tpmdd-devel] [PATCH v3 00/12] tpm/st33zp24: Few code style and sanity fixes + acpi device probing support

2016-02-24 Thread Jarkko Sakkinen
On Tue, Feb 23, 2016 at 10:25:39PM +0100, Christophe Ricard wrote: > Hi Jarkko, > > kbuild robot feedbacks few issues with patch 10 & 12. I am sending back the > whole series again. > > - a set of code style or sanity cleanup > - acpi device probing support for i2c and spi phys. > > In v2, i

Re: [tpmdd-devel] [PATCH v3 09/11] tpm: Driver for supporting multiple emulated TPMs

2016-02-25 Thread Jarkko Sakkinen
On Wed, Feb 24, 2016 at 06:10:42PM -0500, Stefan Berger wrote: >Jason Gunthorpe wrote on 02/22/2016 >09:17:30 PM: > >> >> On Mon, Feb 22, 2016 at 08:45:51PM -0500, Stefan Berger wrote: >> >> > Two things: >> > - the ioctl takes flags;

Re: [tpmdd-devel] [PATCH v4 04/10] tpm: Get rid of module locking

2016-02-29 Thread Jarkko Sakkinen
On Mon, Feb 29, 2016 at 12:29:50PM -0500, Stefan Berger wrote: > Now that the tpm core has strong locking around 'ops' it is possible > to remove a TPM driver, module and all, even while user space still > has things like /dev/tpmX open. For consistency and simplicity, drop > the module locking

Re: [tpmdd-devel] [PATCH v4 00/10] Multi-instance vTPM driver

2016-02-29 Thread Jarkko Sakkinen
On Mon, Feb 29, 2016 at 03:30:35PM -0500, Stefan Berger wrote: > Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> wrote on 02/29/2016 >03:24:01 PM: > >> >> On Mon, Feb 29, 2016 at 12:29:46PM -0500, Stefan Berger wrote: >> > The following

Re: [tpmdd-devel] [PATCH v4 00/10] Multi-instance vTPM driver

2016-02-29 Thread Jarkko Sakkinen
On Mon, Feb 29, 2016 at 10:48:46PM +0200, Jarkko Sakkinen wrote: > On Mon, Feb 29, 2016 at 03:30:35PM -0500, Stefan Berger wrote: > > Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> wrote on 02/29/2016 > >03:24:01 PM: > > > >> > >> On

Re: [tpmdd-devel] [PATCH v2 10/12] tpm: st33zp24: Add support for acpi probing for spi device.

2016-02-22 Thread Jarkko Sakkinen
"\\_SB.GPO2", 0x00, ResourceConsumer, ,) > { // Pin list > 0x0002, > } > }) > Return (SBUF) /* \_SB_.SPI1.TPM1._CRS.SBUF */ > } > Method (_STA, 0, NotSerialized) // _STA: Status >

Re: [tpmdd-devel] [PATCH v2 00/12] tpm/st33zp24: Few code style and sanity fixes + acpi device probing support

2016-02-22 Thread Jarkko Sakkinen
On Sat, Feb 13, 2016 at 04:15:23PM +0100, Christophe Ricard wrote: > Hi Peter, Jarko, > > Please find in the following serie: > - a set of code style or sanity cleanup > - acpi device probing support for i2c and spi phys. > > In v2, i have: > - Added Jarkko review > - Fixed a warning on patch 12

Re: [tpmdd-devel] [RFC PATCH 1/4] New flags for TPM chip avoiding filesystem registrations

2016-01-21 Thread Jarkko Sakkinen
On Thu, Jan 14, 2016 at 11:01:55AM -0500, Stefan Berger wrote: > From: Stefan Berger > > Introduce 2 new flags that prevent the registration of TPM devices > with sysfs and securityfs. None of the exising devices set these flags. Maybe a better name for this flag

[tpmdd-devel] [PATCH 2/3] tpm: fix: return rc when devm_add_action() fails

2016-02-14 Thread Jarkko Sakkinen
Call put_device() and return error code if devm_add_action() fails. Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> Reported-by: Jason Gunthorpe <jguntho...@obsidianresearch.com> Fixes: 8e0ee3c9faed ("tpm: fix the cleanup of struct tpm_chip") --- drivers/c

[tpmdd-devel] [PATCH 3/3] tpm_eventlog.c: fix binary_bios_measurements

2016-02-14 Thread Jarkko Sakkinen
data, resulting in garbage event data. Signed-off-by: Harald Hoyer <har...@redhat.com> Fixes: 0cc698af36ff ("vTPM: support little endian guests") Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> cc: sta...@vger.kernel.org --- drivers/char/tpm/tpm_eventlo

[tpmdd-devel] [PATCH] tpm_crb: fix bad name pointer usage with struct resource

2016-02-16 Thread Jarkko Sakkinen
The memory was not zeroed for new_res, which caused devm_ioremap_resource() not to use dev_name() but instead whatever garbage was pointed by new_res->name. The problem crb_check_resource is different. There not zeroing the name pointer causes use-after-free. Signed-off-by: Jarkko Sakki

Re: [tpmdd-devel] [PATCH] tpm_crb: fix bad name pointer usage with struct resource

2016-02-17 Thread Jarkko Sakkinen
On Tue, Feb 16, 2016 at 09:52:19PM -0700, Jason Gunthorpe wrote: > On Wed, Feb 17, 2016 at 02:27:54AM +0200, Jarkko Sakkinen wrote: > > - if (acpi_dev_resource_memory(ares, )) > > + if (acpi_dev_resource_memory(ares, )) { > > + res.name = NULL; > >

[tpmdd-devel] [PATCH] tpm_crb: fix: associate to the correct device

2016-02-17 Thread Jarkko Sakkinen
-dbff : tpm0 Signed-off-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com> --- drivers/char/tpm/tpm_crb.c | 93 ++ 1 file changed, 45 insertions(+), 48 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 1

Re: [tpmdd-devel] [PATCH] tpm_crb: fix: associate to the correct device

2016-02-18 Thread Jarkko Sakkinen
On Thu, Feb 18, 2016 at 11:03:31AM -0700, Jason Gunthorpe wrote: > On Wed, Feb 17, 2016 at 01:23:31PM +0200, Jarkko Sakkinen wrote: > > At the moment for tpm_crb /proc/iomem shows the HW interface and not the > > device using the memory range. This patch fixes the issue by associa

Re: [tpmdd-devel] [PATCH 00/12] tpm/st33zp24: Few code style and sanity fixes + acpi device probing support

2016-02-19 Thread Jarkko Sakkinen
On Thu, Feb 18, 2016 at 10:03:35PM +0100, Christophe Ricard wrote: > Hi Jarkko, > > Thanks for your feedback :) > > On 18/02/2016 15:46, Jarkko Sakkinen wrote: > >On Thu, Feb 18, 2016 at 08:12:45AM +0100, Christophe Ricard wrote: > >>Hi Jarkko, > >> > &

[tpmdd-devel] [GIT PULL] remaining tpmdd fixes for Linux 4.5

2016-02-20 Thread Jarkko Sakkinen
) remaining tpmdd fixes for Linux 4.5 Harald Hoyer (1): tpm_eventlog.c: fix binary_bios_measurements Jarkko Sakkinen (4): tpm: fix: set continueSession attribute for the unseal operation tpm: fix: return rc when

Re: [tpmdd-devel] [PATCH 1/3] tpm: Hold the kref during tpm_chip_find_get

2016-02-13 Thread Jarkko Sakkinen
On Fri, Feb 12, 2016 at 05:04:29PM -0700, Jason Gunthorpe wrote: > This was missed during the struct device conversion, we > need to hold a kref on the chip to make sure it isn't freed. > > Signed-off-by: Jason Gunthorpe I'm bit confused about this patch. What

  1   2   3   4   5   6   7   8   9   10   >