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

2017-09-06 Thread Jason Gunthorpe
On Wed, Sep 06, 2017 at 08:56:36AM -0400, Nayna Jain wrote: > diff --git a/Documentation/admin-guide/kernel-parameters.txt > b/Documentation/admin-guide/kernel-parameters.txt > index 4e303be83df6..3c59bb91e1ee 100644 > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -1465,6 +1465,14

Re: [tpmdd-devel] [PATCH 1/2] efi: call get_event_log before ExitBootServices

2017-09-06 Thread Ard Biesheuvel
On 6 September 2017 at 15:53, Ard Biesheuvel wrote: > Hi Thiebaud, > > On 6 September 2017 at 15:25, Thiebaud Weksteen wrote: >> With TPM 2.0, access to the event log is only possible by using the >> EFI TPM2 Boot Service. Modify the EFI stub to copy

[tpmdd-devel] [PATCH 1/2] efi: call get_event_log before ExitBootServices

2017-09-06 Thread Thiebaud Weksteen via tpmdd-devel
With TPM 2.0, access to the event log is only possible by using the EFI TPM2 Boot Service. Modify the EFI stub to copy the log area to a new Linux-specific EFI table so it remains accessible for future use. Signed-off-by: Thiebaud Weksteen --- arch/x86/boot/compressed/eboot.c

Re: [tpmdd-devel] [PATCH v2] tpm-dev-common: Reject too short writes

2017-09-06 Thread Alexander.Steffen
> On Wed, Sep 06, 2017 at 03:42:33PM +0300, Jarkko Sakkinen wrote: > > On Mon, Sep 04, 2017 at 07:36:42PM +0200, Alexander Steffen wrote: > > > tpm_transmit() does not offer an explicit interface to indicate the > > > number of valid bytes in the communication buffer. Instead, it > > > relies on

[tpmdd-devel] [RFC] tpm: Register RNG device only on tpm chip init

2017-09-06 Thread PrasannaKumar Muralidharan
RNG device is registered as soon as tpm-rng module is loaded even if there are no TPM chip available. Call hwrng_register once tpm chip has registered. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/tpm-rng.c | 50

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

2017-09-06 Thread Nayna
Please ignore these one.. My command took patches recursively from directory also. Sorry for this. Thanks & Regards, - Nayna On 09/06/2017 06:26 PM, 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

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

2017-09-06 Thread Nayna
Please ignore these one.. My command took patches recursively from directory also. Sorry for this. Thanks & Regards, - Nayna On 09/06/2017 06:26 PM, Nayna Jain wrote: The TPM burstcount status indicates the number of bytes that can be sent to the TPM without causing bus wait states.

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

2017-09-06 Thread Nayna Jain
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 returns extremely quickly. Waiting for 5 msec causes an unnecessary delay. An example is the send() call in the tpms_tis

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

2017-09-06 Thread Nayna Jain
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 maximum value, not the minimum value. After this change, performance on a TPM 1.2 with an 8 byte burstcount for

Re: [tpmdd-devel] [PATCH RESEND v2 0/3] tpm2-cmd: Improve self test execution

2017-09-06 Thread Jarkko Sakkinen
On Thu, Aug 31, 2017 at 07:18:55PM +0200, Alexander Steffen wrote: > The self test logic for TPM 2.0 was probably based on the implementation > for TPM 1.2, but did not correctly take into account some TPM 2.0 specifics. > This patch series fixes those issues. > > v2: > - Moved implementation

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

2017-09-06 Thread Nayna Jain
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. Further, some TPMs have a static burstcount, when the value remains zero until the entire FIFO is empty. This

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

2017-09-06 Thread Nayna Jain
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 longer than necessary. This patch replaces the tpm_msleep time from 5msec to 1msec. After this change,

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

2017-09-06 Thread Nayna Jain
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. Further, some TPMs have a static burstcount, when the value remains zero until the entire FIFO is empty. This

[tpmdd-devel] [PATCH v2 0/4] additional TPM performance improvements

2017-09-06 Thread Nayna Jain
After further discussions with the Device Driver working group (ddwg), the following changes were made: * Check for burstcount at least once to confirm the TPM is ready to accept the data. Similarly, query for the TPM Expect status as sanity check at the end. * Make the sleep for status check

Re: [tpmdd-devel] [PATCH v2] tpm-dev-common: Reject too short writes

2017-09-06 Thread Jarkko Sakkinen
On Mon, Sep 04, 2017 at 07:36:42PM +0200, Alexander Steffen wrote: > tpm_transmit() does not offer an explicit interface to indicate the number > of valid bytes in the communication buffer. Instead, it relies on the > commandSize field in the TPM header that is encoded within the buffer. >

Re: [tpmdd-devel] [PATCH] tpm/tpm_crb: Use start method value from ACPI table directly

2017-09-06 Thread Jarkko Sakkinen
On Fri, Aug 25, 2017 at 06:28:55PM -0500, Jiandi An wrote: > This patch gets rid of dealing with intermediate flag for start method > and use start method value from ACPI table directly. > > For ARM64, the locality is handled by Trust Zone in FW. The layout > does not have crb_regs_head. It is

Re: [tpmdd-devel] [PATCH] tpm_tis: make array cmd_getticks static const to shink object code size

2017-09-06 Thread Jarkko Sakkinen
On Fri, Aug 25, 2017 at 05:45:05PM +0100, Colin King wrote: > From: Colin Ian King > > Don't populate array cmd_getticks on the stack, instead make it static > const. Makes the object code smaller by over 160 bytes: > > Before: >text data bss dec