Re: [tpmdd-devel] [PATCH v2 0/3] TPM2.0: Added eventlog support for TPM2.0

2016-08-29 Thread Nayna
On 08/19/2016 01:25 AM, Jason Gunthorpe wrote: > On Tue, Aug 16, 2016 at 02:21:53PM +0530, Nayna wrote: > >> I tried the suggested approach and since ACPI specific functions won't be >> available for arch using CONFIG_OF, so the compilation fails and vice versa >> for CONFIG_ACPI.. > > Right,

Re: [tpmdd-devel] [PATCH v2 2/3] TPM2.0: TPM Device Tree Documentation

2016-08-29 Thread Nayna
On 08/19/2016 01:36 AM, Jason Gunthorpe wrote: > On Tue, Aug 16, 2016 at 11:30:40PM +0530, Nayna wrote: >> Here is the description: >> >> phandle property: > > IIRC these are automatically generated by the dt compiler and are not > part of the binding. Please confirm if you need them in the

[tpmdd-devel] [PATCH v3 2/7] tpm: Replace the dynamically allocated bios_dir as struct dentry array.

2016-08-29 Thread Nayna Jain
bios_dir is defined as struct dentry **bios_dir, which results in dynamic allocation and possible memory leak. This patch replaces it with struct dentry array i.e. struct dentry *bios_dir[3] similar to what is done for sysfs groups. Suggested-by: Jason Gunthorpe

[tpmdd-devel] [PATCH v3 5/7] tpm: Replace the of_find_node_by_name() with dev of_node property

2016-08-29 Thread Nayna Jain
Using device of_node property is better way to refer to device node rather than of_find_node_by_name(). Additionally, this patch replaces all currently used pr_err() with recommended dev_dbg(). Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain

[tpmdd-devel] [PATCH v3 6/7] tpm: Moves the eventlog init functions to tpm_eventlog_init.c

2016-08-29 Thread Nayna Jain
Eventlog initialization functions are common for TPM1.2 and TPM2.0 Currently, they are defined in tpm_eventlog.c which does parsing of TPM1.2 specific eventlog. Since initialization functions are common for TPM2.0 also, have moved the init functions to tpm_eventlog_init.c. Signed-off-by: Nayna

[tpmdd-devel] [PATCH v3 4/7] tpm: Redefine the read_log method to check for ACPI/OF properties sequentially

2016-08-29 Thread Nayna Jain
Currently, the difference in read_log method for ACPI/OF based platforms is handled by defining respective read_log method and handing them using CONFIG based #ifdef condition in Makefile which is not the recommended approach. This patch cleans up the ifdef condition in Makefile by defining

[tpmdd-devel] [PATCH v3 1/7] tpm: Define a generic open() method for ascii & bios measurements.

2016-08-29 Thread Nayna Jain
Open methods for eventlog ascii and binary bios measurements file operations are very similar. This patch refactors the code into single open() call by passing seq_operations as i_node->private data. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain

[tpmdd-devel] [PATCH v3 0/7] tpm: TPM2.0 eventlog securityfs support

2016-08-29 Thread Nayna Jain
Existing TPM2.0 support lacks the support for eventlog securityfs file. This patch adds the binary_bios_measurements to TPM2.0 eventlog securityfs file. Additionally, it also includes the review feedbacks as suggested by Jason. Further, commit msg subject line is prefixed with tpm as was

[tpmdd-devel] [PATCH] Documentation: tpm: Adds the TPM device tree node documentation

2016-08-29 Thread Nayna Jain
This is documenting device tree binding for I2C based TPM, similar concept which being used for virtual TPM on POWER7 and POWER8 systems running PowerVM. Signed-off-by: Nayna Jain --- Documentation/devicetree/bindings/i2c/i2c-tpm.txt | 29 +++ 1

Re: [tpmdd-devel] [PATCH] tpm: fix invalid constant expressions in tpm.h

2016-08-29 Thread Jason Gunthorpe
On Tue, Aug 30, 2016 at 04:28:17AM +0300, Jarkko Sakkinen wrote: > The enums tpm_capabilities and tpm_sub_capabilities do not contain legit > constant expressions. This commit makes cap_id a separate parameter > in I wonder if this is a bug in sparse? the macro uses gcc magic to expand to a

[tpmdd-devel] [PATCH] tpm: fix invalid constant expressions in tpm.h

2016-08-29 Thread Jarkko Sakkinen
The enums tpm_capabilities and tpm_sub_capabilities do not contain legit constant expressions. This commit makes cap_id a separate parameter in order to provide less confusing API and cap_id and subcap_id will be u32 with the cpu byte order. The byte order conversions are handled internally by

Re: [tpmdd-devel] [p...@vmware.com: TPM2 erroring-out after tpm: Factor out common startup code]

2016-08-29 Thread Jason Gunthorpe
On Mon, Aug 29, 2016 at 11:21:26PM +0300, Jarkko Sakkinen wrote: > On Mon, Aug 29, 2016 at 02:08:28PM -0600, Jason Gunthorpe wrote: > > Looks legit to me. > > I think this is a good change as long as it is sent through the > normal process (so that it is available in patchwork). I'll send a

[tpmdd-devel] [p...@vmware.com: TPM2 erroring-out after tpm: Factor out common startup code]

2016-08-29 Thread Jason Gunthorpe
Looks legit to me. - Forwarded message from Petr Vandrovec - Date: Sat, 27 Aug 2016 23:44:46 -0700 From: Petr Vandrovec To: jguntho...@obsidianresearch.com Subject: TPM2 erroring-out after tpm: Factor out common startup code Hi Jason, your change

Re: [tpmdd-devel] [PATCH] tpm: fix a race condition in tpm2_unseal_trusted()

2016-08-29 Thread Jason Gunthorpe
On Mon, Aug 29, 2016 at 11:03:26PM +0300, Jarkko Sakkinen wrote: > I will also add documentation comments for tpm2_unseal_cmd, > tpm2_load_cmd and tpm2_flush_context_cmd. Do you think it is sufficient > to say "Return: same as with tpm_transmit_cmd"? yes Jason

Re: [tpmdd-devel] [PATCH] tpm: fix a race condition in tpm2_unseal_trusted()

2016-08-29 Thread Jarkko Sakkinen
On Mon, Aug 29, 2016 at 10:40:27PM +0300, Jarkko Sakkinen wrote: > On Mon, Aug 29, 2016 at 01:21:10PM -0600, Jason Gunthorpe wrote: > > On Mon, Aug 29, 2016 at 06:25:21PM +0300, Jarkko Sakkinen wrote: > > > On Sun, Aug 28, 2016 at 12:51:49PM -0600, Jason Gunthorpe wrote: > > > > On Sun, Aug 28,

Re: [tpmdd-devel] [PATCH] tpm: fix a race condition in tpm2_unseal_trusted()

2016-08-29 Thread Jarkko Sakkinen
On Mon, Aug 29, 2016 at 01:21:10PM -0600, Jason Gunthorpe wrote: > On Mon, Aug 29, 2016 at 06:25:21PM +0300, Jarkko Sakkinen wrote: > > On Sun, Aug 28, 2016 at 12:51:49PM -0600, Jason Gunthorpe wrote: > > > On Sun, Aug 28, 2016 at 08:36:52AM +0200, Jarkko Sakkinen wrote: > > > > > > > > @@

Re: [tpmdd-devel] [PATCH] tpm: fix a race condition in tpm2_unseal_trusted()

2016-08-29 Thread Jason Gunthorpe
On Mon, Aug 29, 2016 at 06:25:21PM +0300, Jarkko Sakkinen wrote: > On Sun, Aug 28, 2016 at 12:51:49PM -0600, Jason Gunthorpe wrote: > > On Sun, Aug 28, 2016 at 08:36:52AM +0200, Jarkko Sakkinen wrote: > > > > > > @@ -576,7 +576,8 @@ static int tpm2_load(struct tpm_chip *chip, > > >

Re: [tpmdd-devel] [PATCH] tpm: fix a race condition in tpm2_unseal_trusted()

2016-08-29 Thread Jarkko Sakkinen
On Sun, Aug 28, 2016 at 12:51:49PM -0600, Jason Gunthorpe wrote: > On Sun, Aug 28, 2016 at 08:36:52AM +0200, Jarkko Sakkinen wrote: > > > > @@ -576,7 +576,8 @@ static int tpm2_load(struct tpm_chip *chip, > > goto out; > > } > > > > - rc = tpm_transmit_cmd(chip, buf.data,

Re: [tpmdd-devel] [PATCH 2/2] TPM2.0:Adds securityfs support for TPM2.0 eventlog

2016-08-29 Thread Ken Goldman
On 7/29/2016 1:14 PM, Jason Gunthorpe wrote: > > The bios log is defined to be host endian? > > Please reference the standard in a comment that these structs are > coming from. The BIOS log is little endian. That is, all multi-byte values are little endian. Examples are the pcrIndex,