[PATCH v5 2/3] tpm: enhance read_log_of() to support Physical TPM event log

2016-11-23 Thread Nayna Jain
Physical or Virtual TPM. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm_of.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c index 7dee42d7..646aec1 100644 --- a/drivers/char/tpm/tpm_of.c

[PATCH v5 3/3] tpm: add securityfs support for TPM 2.0 firmware event log

2016-11-23 Thread Nayna Jain
digests, which is different from TPM 1.2. This patch enables the tpm_bios_log_setup for TPM 2.0 and adds the event log parser which understand the TPM 2.0 crypto agile format. Signed-off-by: Nayna Jain --- drivers/char/tpm/Makefile| 2 +- drivers/char/tpm/tpm2_eventlog.c | 214

[PATCH v5 0/3] tpm: securityfs support for TPM 2.0 firmware event log

2016-11-23 Thread Nayna Jain
yfs entries. - Generic readlog() to check for ACPI/OF in sequence. - read_log_of() method now uses of_node propertry rather than calling find_device_by_name. - read_log differentiates vtpm/tpm using its compatible property. - Cleans pr_err with dev_dbg. - Commit msgs subject line prefixed with tpm. v2:

[PATCH v4 0/2] enhance TPM 2.0 extend function to support multiple PCR banks

2017-01-18 Thread Nayna Jain
M2_MAX_PCR_BANKS is defined. - renamed tpm2_get_active_pcr_banks() to tpm2_get_pcr_allocation() - removed generic function tpm2_get_capability(). - Patch "tpm: enchance TPM 2.0 PCR extend to support multiple banks" - Removed tpm2.h, and defined structs common for extend and even

[PATCH v4 2/2] tpm: enhance TPM 2.0 PCR extend to support multiple banks

2017-01-18 Thread Nayna Jain
"TCG PC Client Specific Platform Firmware Profile for TPM 2.0" Signed-off-by: Nayna Jain --- drivers/char/tpm/Kconfig | 1 + drivers/char/tpm/tpm-interface.c | 15 ++- drivers/char/tpm/tpm.h | 3 +- drivers/char/tpm/tpm2-

[PATCH v4 1/2] tpm: implement TPM 2.0 capability to get active PCR banks

2017-01-18 Thread Nayna Jain
This patch implements the TPM 2.0 capability TPM_CAP_PCRS to retrieve the active PCR banks from the TPM. This is needed to enable extending all active banks as recommended by TPM 2.0 TCG Specification. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm.h | 4 drivers/char/tpm/tpm2

[PATCH v5 1/2] tpm: implement TPM 2.0 capability to get active PCR banks

2017-01-19 Thread Nayna Jain
This patch implements the TPM 2.0 capability TPM_CAP_PCRS to retrieve the active PCR banks from the TPM. This is needed to enable extending all active banks as recommended by TPM 2.0 TCG Specification. Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm.h | 4

[PATCH v5 2/2] tpm: enhance TPM 2.0 PCR extend to support multiple banks

2017-01-19 Thread Nayna Jain
"TCG PC Client Specific Platform Firmware Profile for TPM 2.0" Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/Kconfig | 1 + drivers/char/tpm/tpm-interface.c | 15 ++- drivers/char/tpm/tpm.h | 3 +- drivers/char/tpm/tpm2-

[PATCH v5 0/2] enhance TPM 2.0 extend function to support multiple PCR banks

2017-01-19 Thread Nayna Jain
on() - removed generic function tpm2_get_capability(). - Patch "tpm: enchance TPM 2.0 PCR extend to support multiple banks" - Removed tpm2.h, and defined structs common for extend and event log in tpm_eventlog.h - uses tpm_buf in tpm2_pcr_extend(). Nayna Jain (2): tpm: implement T

[PATCH] tpm: fix TPM error handling in tpm2_get_pcr_allocation

2017-01-26 Thread Nayna Jain
Fixes: 75768b4(tpm: enhance TPM 2.0 PCR extend to support multiple banks) Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm2-cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c index 4aad84c..fa52309 100644 --- a

[PATCH v6 0/2] enhance TPM 2.0 extend function to support multiple PCR banks

2017-01-20 Thread Nayna Jain
tion tpm2_get_capability(). - Patch "tpm: enchance TPM 2.0 PCR extend to support multiple banks" - Removed tpm2.h, and defined structs common for extend and event log in tpm_eventlog.h - uses tpm_buf in tpm2_pcr_extend(). Nayna Jain (2): tpm: implement TPM 2.0 capability to get act

[PATCH v6 1/2] tpm: implement TPM 2.0 capability to get active PCR banks

2017-01-20 Thread Nayna Jain
This patch implements the TPM 2.0 capability TPM_CAP_PCRS to retrieve the active PCR banks from the TPM. This is needed to enable extending all active banks as recommended by TPM 2.0 TCG Specification. Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm.h | 5

[PATCH v6 2/2] tpm: enhance TPM 2.0 PCR extend to support multiple banks

2017-01-20 Thread Nayna Jain
"TCG PC Client Specific Platform Firmware Profile for TPM 2.0" Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/Kconfig | 1 + drivers/char/tpm/tpm-interface.c | 15 ++- drivers/char/tpm/tpm.h | 3 +- drivers/char/tpm/tpm2-

[PATCH v9 0/2] securityfs support for TPM 2.0 firmware event log

2017-01-22 Thread Nayna Jain
tiates vtpm/tpm using its compatible property. - Cleans pr_err with dev_dbg. - Commit msgs subject line prefixed with tpm. v2: - Fixes issues as given in feedback by Jason. - Adds documentation for device tree. Nayna Jain (2): tpm: enhance read_log_of() to support Physical TPM event log tpm:

[PATCH v9 1/2] tpm: enhance read_log_of() to support Physical TPM event log

2017-01-22 Thread Nayna Jain
Physical or Virtual TPM. Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_of.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c index 7dee42d7..de57d4a 100644

[PATCH v9 2/2] tpm: add securityfs support for TPM 2.0 firmware event log

2017-01-22 Thread Nayna Jain
digests, which is different from TPM 1.2. This patch enables the tpm_bios_log_setup for TPM 2.0 and adds the event log parser which understand the TPM 2.0 crypto agile format. Signed-off-by: Nayna Jain --- drivers/char/tpm/Makefile | 2 +- .../char/tpm/{tpm_eventlog.c

[PATCH] tpm: add buffer access validation in tpm2_get_pcr_allocation()

2017-01-27 Thread Nayna Jain
This patch add validation in tpm2_get_pcr_allocation to avoid access beyond response buffer length. Suggested-by: Stefan Berger Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm2-cmd.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH v7 1/2] tpm: implement TPM 2.0 capability to get active PCR banks

2017-01-30 Thread Nayna Jain
This patch implements the TPM 2.0 capability TPM_CAP_PCRS to retrieve the active PCR banks from the TPM. This is needed to enable extending all active banks as recommended by TPM 2.0 TCG Specification. Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen Tested-by: Kenneth Goldman

[PATCH v7 0/2] enhance TPM 2.0 extend function to support multiple PCR banks

2017-01-30 Thread Nayna Jain
tead, constant TPM2_MAX_PCR_BANKS is defined. - renamed tpm2_get_active_pcr_banks() to tpm2_get_pcr_allocation() - removed generic function tpm2_get_capability(). - Patch "tpm: enchance TPM 2.0 PCR extend to support multiple banks" - Removed tpm2.h, and defined structs common for

[PATCH v7 2/2] tpm: enhance TPM 2.0 PCR extend to support multiple banks

2017-01-30 Thread Nayna Jain
"TCG PC Client Specific Platform Firmware Profile for TPM 2.0" Signed-off-by: Nayna Jain --- drivers/char/tpm/Kconfig | 1 + drivers/char/tpm/tpm-interface.c | 15 ++- drivers/char/tpm/tpm.h | 9 +++- drivers/char/tpm/tpm2-

[PATCH v6 0/9] tpm: cleanup/fixes in existing event log support

2016-11-14 Thread Nayna Jain
ice_by_name. - read_log differentiates vtpm/tpm using its compatible property. - Cleans pr_err with dev_dbg. - Commit msgs subject line prefixed with tpm. v2: - Fixes issues as given in feedback by Jason. - Adds documentation for device tree. Nayna Jain (9): tpm: define a generic open() method for

[PATCH v6 4/9] tpm: drop tpm1_chip_register(/unregister)

2016-11-14 Thread Nayna Jain
Check for TPM2 chip in tpm_sysfs_add_device, tpm_bios_log_setup and tpm_bios_log_teardown in order to make code flow cleaner and to enable to implement TPM 2.0 support later on. This is partially derived from the commit by Nayna Jain with the extension that also tpm1_chip_register is dropped

[PATCH v6 9/9] tpm: cleanup of printk error messages

2016-11-14 Thread Nayna Jain
This patch removes the unnecessary error messages on failing to allocate memory and replaces pr_err/printk with dev_dbg/dev_info as applicable. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm_acpi.c | 16 drivers/char/tpm/tpm_of.c | 29

[PATCH v6 5/9] tpm: have event log use the tpm_chip

2016-11-14 Thread Nayna Jain
searching. This is straightfoward except for the issue of passing a kref through i_private with securityfs. Since securityfs_remove does not have any removal fencing like sysfs we use the inode lock to safely get a kref on the tpm_chip. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain

[PATCH v6 7/9] tpm: redefine read_log() to handle ACPI/OF at runtime

2016-11-14 Thread Nayna Jain
defining a single read_log() method, which checks for ACPI/OF event log properties at runtime. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain Reviewed-by: Jason Gunthorpe Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/Makefile | 14 -- drivers/char/tpm/tpm_acpi.c

[PATCH v6 6/9] tpm: fix the missing .owner in tpm_bios_measurements_ops

2016-11-14 Thread Nayna Jain
This patch fixes the missing .owner field in tpm_bios_measurements_ops definition. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm_eventlog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c

[PATCH v6 1/9] tpm: define a generic open() method for ascii & bios measurements

2016-11-14 Thread Nayna Jain
open() method for event log ascii and binary bios measurements file operations are very similar. This patch refactors the code into a single open() call by passing seq_operations as i_node->private data. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakki

[PATCH v6 8/9] tpm: replace of_find_node_by_name() with dev of_node property

2016-11-14 Thread Nayna Jain
Using the device of_node property is a better way to refer to the device tree node rather than of_find_node_by_name(). Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_of.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions

[PATCH v6 2/9] tpm: replace symbolic permission with octal for securityfs files

2016-11-14 Thread Nayna Jain
checkpatch.pl flags warning for symbolic permissions and suggests to replace with octal value. This patch changes securityfs pseudo files permission to octal values in tpm_bios_log_setup(). Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm_eventlog.c | 4 ++-- 1 file changed, 2 insertions

[PATCH v6 3/9] tpm: replace dynamically allocated bios_dir with a static array

2016-11-14 Thread Nayna Jain
This commit is based on a commit by Nayna Jain. Replaced dynamically allocated bios_dir with a static array as the size is always constant. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-chip.c | 9 --- drivers/char/tpm

[PATCH v6 1/2] tpm: enhance read_log_of() to support Physical TPM event log

2016-11-26 Thread Nayna Jain
Physical or Virtual TPM. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm_of.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c index 7dee42d7..4b0d5e6 100644 --- a/drivers/char/tpm/tpm_of.c

[PATCH v6 2/2] tpm: add securityfs support for TPM 2.0 firmware event log

2016-11-26 Thread Nayna Jain
digests, which is different from TPM 1.2. This patch enables the tpm_bios_log_setup for TPM 2.0 and adds the event log parser which understand the TPM 2.0 crypto agile format. Signed-off-by: Nayna Jain --- drivers/char/tpm/Makefile | 2 +- .../char/tpm/{tpm_eventlog.c

[PATCH v6 0/2] securityfs support for TPM 2.0 firmware event log

2016-11-26 Thread Nayna Jain
curityfs entries. - Generic readlog() to check for ACPI/OF in sequence. - read_log_of() method now uses of_node propertry rather than calling find_device_by_name. - read_log differentiates vtpm/tpm using its compatible property. - Cleans pr_err with dev_dbg. - Commit msgs subject line prefixe

[PATCH v2 0/2] tpm: enhance TPM 2.0 extend function to support multiple PCR banks

2016-12-30 Thread Nayna Jain
ion() - removed generic function tpm2_get_capability(). - Patch "tpm: enchance TPM 2.0 PCR extend to support multiple banks" - Removed tpm2.h, and defined structs common for extend and event log in tpm_eventlog.h - uses tpm_buf in tpm2_pcr_extend(). Nayna Jain (2): tpm: implement T

[PATCH v2 1/2] tpm: implement TPM 2.0 capability to get active PCR banks

2016-12-30 Thread Nayna Jain
This patch implements the TPM 2.0 capability TPM_CAP_PCRS to retrieve the active PCR banks from the TPM. This is needed to enable extending all active banks as recommended by TPM 2.0 TCG Specification. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm.h | 5 +++ drivers/char/tpm/tpm2

[PATCH v2 2/2] tpm: enhance TPM 2.0 PCR extend to support multiple banks

2016-12-30 Thread Nayna Jain
only a SHA1 digest. To extend all active PCR banks with differing digest sizes, the SHA1 digest is padded with trailing 0's as needed. [1] TPM 2.0 Specification referred here is "TCG PC Client Specific Platform Firmware Profile for TPM 2.0" Signed-off-by: Nayna Jain --- drive

[PATCH v7 0/2] securityfs support for TPM 2.0 firmware event log

2016-12-10 Thread Nayna Jain
atible property. - Cleans pr_err with dev_dbg. - Commit msgs subject line prefixed with tpm. v2: - Fixes issues as given in feedback by Jason. - Adds documentation for device tree. Nayna Jain (2): tpm: enhance read_log_of() to support Physical TPM event log tpm: add securityfs support for TPM

[PATCH v7 1/2] tpm: enhance read_log_of() to support Physical TPM event log

2016-12-10 Thread Nayna Jain
Physical or Virtual TPM. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm_of.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c index 7dee42d7..de57d4a 100644 --- a/drivers/char/tpm/tpm_of.c

[PATCH v7 2/2] tpm: add securityfs support for TPM 2.0 firmware event log

2016-12-10 Thread Nayna Jain
digests, which is different from TPM 1.2. This patch enables the tpm_bios_log_setup for TPM 2.0 and adds the event log parser which understand the TPM 2.0 crypto agile format. Signed-off-by: Nayna Jain --- drivers/char/tpm/Makefile | 2 +- .../char/tpm/{tpm_eventlog.c

[PATCH v1 1/2] tpm: msleep() delays - replace with usleep_range() in i2c nuvoton driver

2017-03-10 Thread Nayna Jain
:954s | 0:040 - 4:096s0:016 - 0:816s This patch replaces the msleep() with usleep_range() calls in the i2c nuvoton driver with a consistent max range value. Signed-of-by: Mimi Zohar Cc: sta...@vger.kernel.org (linux-4.8) Signed-off-by: Nayna Jain --- Changelog v1: - Included Jason's feed

[PATCH 2/2] tpm: add sleep only for retry in i2c_nuvoton_write_status()

2017-03-10 Thread Nayna Jain
done. Signed-off-by: Nayna Jain Cc: sta...@vger.kernel.org (linux-4.8) Reviewed-by: Mimi Zohar --- drivers/char/tpm/tpm_i2c_nuvoton.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c index 0c98c42

[PATCH v8 1/2] tpm: enhance read_log_of() to support Physical TPM event log

2017-01-10 Thread Nayna Jain
Physical or Virtual TPM. Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_of.c | 27 +++ 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c index 7dee42d7..de57d4a 100644

[PATCH v8 0/2] securityfs support for TPM 2.0 firmware event log

2017-01-10 Thread Nayna Jain
log differentiates vtpm/tpm using its compatible property. - Cleans pr_err with dev_dbg. - Commit msgs subject line prefixed with tpm. v2: - Fixes issues as given in feedback by Jason. - Adds documentation for device tree. Nayna Jain (2): tpm: enhance read_log_of() to support Physical TPM even

[PATCH v8 2/2] tpm: add securityfs support for TPM 2.0 firmware event log

2017-01-10 Thread Nayna Jain
digests, which is different from TPM 1.2. This patch enables the tpm_bios_log_setup for TPM 2.0 and adds the event log parser which understand the TPM 2.0 crypto agile format. Signed-off-by: Nayna Jain --- drivers/char/tpm/Makefile | 2 +- .../char/tpm/{tpm_eventlog.c

[PATCH v3 0/2] tpm: enhance TPM 2.0 extend function to support multiple PCR banks

2017-01-12 Thread Nayna Jain
tpm2_get_active_pcr_banks() to tpm2_get_pcr_allocation() - removed generic function tpm2_get_capability(). - Patch "tpm: enchance TPM 2.0 PCR extend to support multiple banks" - Removed tpm2.h, and defined structs common for extend and event log in tpm_eventlog.h - uses tpm_bu

[PATCH v3 1/2] tpm: implement TPM 2.0 capability to get active PCR banks

2017-01-12 Thread Nayna Jain
This patch implements the TPM 2.0 capability TPM_CAP_PCRS to retrieve the active PCR banks from the TPM. This is needed to enable extending all active banks as recommended by TPM 2.0 TCG Specification. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm.h | 4 +++ drivers/char/tpm/tpm2

[PATCH v3 2/2] tpm: enhance TPM 2.0 PCR extend to support multiple banks

2017-01-12 Thread Nayna Jain
only a SHA1 digest. To extend all active PCR banks with differing digest sizes, the SHA1 digest is padded with trailing 0's as needed. [1] TPM 2.0 Specification referred here is "TCG PC Client Specific Platform Firmware Profile for TPM 2.0" Signed-off-by: Nayna Jain --- drivers/c

[PATCH] powerpc/pseries: detect secure and trusted boot state of the system.

2020-07-04 Thread Nayna Jain
The device-tree property to check secure and trusted boot state is different for guests(pseries) compared to baremetal(powernv). This patch updates the existing is_ppc_secureboot_enabled() and is_ppc_trustedboot_enabled() function to add support for pseries. Signed-off-by: Nayna Jain --- arch

[PATCH v3] powerpc/pseries: detect secure and trusted boot state of the system.

2020-07-15 Thread Nayna Jain
supported for Linux. 2 - Enabled and enforced. 3-9 - Enabled and enforcing; requirements are at the discretion of the operating system. The values of ibm,trusted-boot under pseries are interpreted as: 0 - Disabled 1 - Enabled Signed-off-by: Nayna Jain Reviewed-by: Daniel Axtens --- v3: * fixed

[PATCH v2] powerpc/pseries: detect secure and trusted boot state of the system.

2020-07-10 Thread Nayna Jain
The device-tree property to check secure and trusted boot state is different for guests(pseries) compared to baremetal(powernv). This patch updates the existing is_ppc_secureboot_enabled() and is_ppc_trustedboot_enabled() function to add support for pseries. Signed-off-by: Nayna Jain Reviewed

Re: [PATCH] tpm: migrate tpm2_do_selftest() to use struct tpm_buf

2018-02-12 Thread Nayna Jain
tpm_transmit_cmd(chip, NULL, buf.data, PAGE_SIZE, 0, 0, + "continue selftest"); + tpm_buf_destroy(&buf); if (rc != TPM2_RC_TESTING || delay_msec >= duration) break; Tested-By: Nayna Jain Thanks & Regards, - Nayna

Re: [PATCH v4 2/4] tpm: ignore burstcount to improve tpm_tis send() performance

2017-11-23 Thread Nayna Jain
On Wed, Nov 22, 2017 at 06:52:03AM +, alexander.stef...@infineon.com wrote: > > > > > This seems to fail reliably with my SPI TPM 2.0. I get EIO when > > > > > trying to > > > > send large amounts of data, e.g. with TPM2_Hash, and subsequent tests > > > > seem to take an unusual amount of time

Re: [PATCH v2 4/4] tpm: use tpm_msleep() value as max delay

2017-09-14 Thread Nayna Jain
On 09/13/2017 06:17 AM, Jarkko Sakkinen wrote: On Wed, Sep 06, 2017 at 08:56:39AM -0400, Nayna Jain wrote: Currently, tpm_msleep() uses delay_msec as the minimum value in usleep_range. However, that is the maximum time we want to wait. The function is modified to use the delay_msec as the

Re: [PATCH v2 1/4] tpm: ignore burstcount to improve tpm_tis send() performance.

2017-09-15 Thread Nayna Jain
On 09/14/2017 04:40 AM, Jarkko Sakkinen wrote: On Wed, Sep 13, 2017 at 11:39:03AM -0700, Peter Huewe wrote: Am 12. September 2017 17:45:08 GMT-07:00 schrieb Jarkko Sakkinen : On Wed, Sep 06, 2017 at 08:56:36AM -0400, Nayna Jain wrote: The TPM burstcount status indicates the number of

Re: [PATCH v2 2/4] tpm: define __wait_for_tpm_stat to specify variable polling sleep time

2017-09-15 Thread Nayna Jain
On 09/13/2017 06:28 AM, Jarkko Sakkinen wrote: On Wed, Sep 06, 2017 at 08:56:37AM -0400, Nayna Jain wrote: The existing wait_for_tpm_stat() checks the chip status before sleeping for 5 msec in a polling loop. For some functions although the status isn't ready immediately, the status re

Re: [PATCH v2 3/4] tpm: reduce tpm_msleep() time in get_burstcount()

2017-09-15 Thread Nayna Jain
On 09/13/2017 06:30 AM, Jarkko Sakkinen wrote: On Wed, Sep 06, 2017 at 08:56:38AM -0400, Nayna Jain wrote: Currently, get_burstcount() function sleeps for 5msec in a loop before retrying for next query to burstcount. However, if it takes lesser time for TPM to return, this 5 msec delay is

[PATCH v2 3/4] tpm: reduce tpm_msleep() time in get_burstcount()

2017-09-06 Thread Nayna Jain
, performance on a TPM 1.2 with an 8 byte burstcount for 1000 extends improved from ~10sec to ~9sec. Signed-off-by: Nayna Jain Acked-by: Mimi Zohar --- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm

[PATCH 2/4] tpm: define __wait_for_tpm_stat to specify variable polling sleep time

2017-09-06 Thread Nayna Jain
s_tis driver. This patch defines __wait_for_tpm_stat(), allowing the caller to specify the polling sleep timeout value within the loop. The existing wait_for_tpm_stat() becomes a wrapper for this function. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm-interface.c | 15 --- dr

[PATCH 1/4] tpm: ignore burstcount to improve tpm_tis send() performance.

2017-09-06 Thread Nayna Jain
parameter ignore_burst_count=1. By default, this parameter is disabled. Suggested-by: Ken Goldman in conjunction with the TPM Device Driver work group. Signed-off-by: Nayna Jain Acked-by: Mimi Zohar --- Documentation/admin-guide/kernel-parameters.txt | 8 drivers/char/tpm

[PATCH v2 2/4] tpm: define __wait_for_tpm_stat to specify variable polling sleep time

2017-09-06 Thread Nayna Jain
roved from ~14sec to ~10sec. Signed-off-by: Nayna Jain Acked-by: Mimi Zohar --- drivers/char/tpm/tpm-interface.c | 15 --- drivers/char/tpm/tpm.h | 3 +++ drivers/char/tpm/tpm_tis_core.c | 11 ++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/dr

[PATCH v2 1/4] tpm: ignore burstcount to improve tpm_tis send() performance.

2017-09-06 Thread Nayna Jain
parameter ignore_burst_count=1. By default, this parameter is disabled. After this change, performance on a TPM 1.2 with an 8 byte burstcount for 1000 extends improved from ~41sec to ~14sec. Suggested-by: Ken Goldman in conjunction with the TPM Device Driver work group. Signed-off-by: Nayna Jain

[PATCH v2 0/4] additional TPM performance improvements

2017-09-06 Thread Nayna Jain
to have| ~9 - ~8 max range Changelog v2: * Add module parameter to handle ignoring of burst count during tpm tis send() operation. * Add improvements over sleep time to reduce delays. Nayna Jain (4): tpm: ignore burstcount to improve tpm_tis send() performance. tpm: define

[PATCH v2 4/4] tpm: use tpm_msleep() value as max delay

2017-09-06 Thread Nayna Jain
1000 extends improved from ~9sec to ~8sec. Signed-off-by: Nayna Jain Acked-by: Mimi Zohar --- drivers/char/tpm/tpm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index eb2f8818eded..ff5a8b7b80b9 100644 --- a/drivers/char

[PATCH v3 4/5] tpm: reduce tpm_msleep() time in get_burstcount()

2017-10-04 Thread Nayna Jain
on a TPM 1.2 with an 8 byte burstcount for 1000 extends improved from ~10sec to ~9sec. Signed-off-by: Nayna Jain Acked-by: Mimi Zohar --- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm

[PATCH v3 1/5] tpm: move wait_for_tpm_stat() to respective driver files

2017-10-04 Thread Nayna Jain
The function wait_for_tpm_stat() is currently defined in tpm-interface file. It is a hardware specific function used only by tpm_tis and xen-tpmfront, so it is removed from tpm-interface.c and defined in respective driver files. Suggested-by: Jarkko Sakkinen Signed-off-by: Nayna Jain

[PATCH v3 5/5] tpm: use tpm_msleep() value as max delay

2017-10-04 Thread Nayna Jain
1000 extends improved from ~9sec to ~8sec. Fixes: 3b9af007869("tpm: replace msleep() with usleep_range() in TPM 1.2/ 2.0 generic drivers") Signed-off-by: Nayna Jain Acked-by: Mimi Zohar --- drivers/char/tpm/tpm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH v3 2/5] tpm: ignore burstcount to improve tpm_tis send() performance

2017-10-04 Thread Nayna Jain
, performance on a TPM 1.2 with an 8 byte burstcount for 1000 extends improved from ~41sec to ~14sec. Suggested-by: Ken Goldman in conjunction with the TPM Device Driver work group. Signed-off-by: Nayna Jain Acked-by: Mimi Zohar --- drivers/char/tpm/tpm_tis_core.c | 42

[PATCH v3 3/5] tpm: reduce polling delay in tpm_tis wait_for_tpm_stat()

2017-10-04 Thread Nayna Jain
from ~14sec to ~10sec. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm_tis_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 8da425e1783f..224842e06105 100644 --- a/drivers/char/tpm

[PATCH v3 0/4] additional TPM performance improvements

2017-10-04 Thread Nayna Jain
me to reduce delays. Nayna Jain (5): tpm: move wait_for_tpm_stat() to respective driver files tpm: ignore burstcount to improve tpm_tis send() performance tpm: reduce polling delay in tpm_tis wait_for_tpm_stat() tpm: reduce tpm_msleep() time in get_burstcount() tpm: use tpm_msleep() value a

Re: [PATCH v3 2/5] tpm: ignore burstcount to improve tpm_tis send() performance

2017-10-11 Thread Nayna Jain
On 10/10/2017 08:34 PM, Jarkko Sakkinen wrote: On Wed, Oct 04, 2017 at 06:29:21AM -0400, Nayna Jain wrote: The TPM burstcount status indicates the number of bytes that can be sent to the TPM without causing bus wait states. Effectively, it is the number of empty bytes in the command FIFO

Re: [PATCH v3 4/5] tpm: reduce tpm_msleep() time in get_burstcount()

2017-10-12 Thread Nayna Jain
On 10/12/2017 04:48 PM, Jarkko Sakkinen wrote: On Wed, Oct 04, 2017 at 06:29:23AM -0400, Nayna Jain wrote: Currently, get_burstcount() function sleeps for 5msec in a loop before retrying for next query to burstcount. However, if it takes lesser time for TPM to return, this 5msec delay is

[PATCH] tpm: improve tpm_tis send() performance by ignoring burstcount

2017-08-07 Thread Nayna Jain
: Nayna Jain Acked-by: Mimi Zohar --- drivers/char/tpm/tpm_tis_core.c | 45 ++--- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index b617b2eeb080..478cbc0f61c3 100644 --- a/drivers

Re: [PATCH v4 1/4] tpm: move wait_for_tpm_stat() to respective driver files

2017-10-23 Thread Nayna Jain
On 10/20/2017 02:26 PM, Jarkko Sakkinen wrote: On Thu, Oct 19, 2017 at 05:00:29PM +, alexander.stef...@infineon.com wrote: On Tue, Oct 17, 2017 at 04:32:29PM -0400, Nayna Jain wrote: The function wait_for_tpm_stat() is currently defined in tpm-interface file. It is a hardware specific

Re: [PATCH v4 2/4] tpm: ignore burstcount to improve tpm_tis send() performance

2017-11-07 Thread Nayna Jain
the TPM Device Driver work group. Signed-off-by: Nayna Jain Acked-by: Mimi Zohar --- drivers/char/tpm/tpm_tis_core.c | 42 +++-- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c

<    1   2