All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] tpm: add support for nonblocking operation
@ 2018-06-12 17:58 ` Tadeusz Struk
  0 siblings, 0 replies; 29+ messages in thread
From: Tadeusz Struk @ 2018-06-12 17:58 UTC (permalink / raw)
  To: jarkko.sakkinen
  Cc: jgg, linux-integrity, tadeusz.struk, linux-security-module, linux-kernel

The TCG SAPI specification [1] defines a set of functions, which allows
applications to use the TPM device in either blocking or non-blocking fashion.
Each command defined by the specification has a corresponding
Tss2_Sys_<COMMAND>_Prepare() and Tss2_Sys_<COMMAND>_Complete() call, which
together with Tss2_Sys_ExecuteAsync() is designed to allow asynchronous
mode of operation. Currently the TPM driver supports only blocking calls,
which doesn't allow asynchronous IO operations.
This patch changes it and adds support for nonblocking write and a new poll
function to enable applications, which want to take advantage of this feature.
The new functionality can be tested using standard TPM tools implemented
in [2], together with modified TCTI from [3].

[1] https://trustedcomputinggroup.org/wp-content/uploads/TSS_SAPI_Version-1.1_Revision-22_review_030918.pdf
[2] https://github.com/tpm2-software/tpm2-tools
[3] https://github.com/tstruk/tpm2-tss/tree/async

---
Changes in v3:
- Fixed problem reported by 0-dey kbuild test robot around __exitcall.
  It complained because there is a module_exit() in another file already.

Changes in v2:
- Split the change into two separate patches. First patch adds a pointer
  to the space to the struct file_priv to have access to it from the async job.
  This is to avoid memory allocations on every write call. Now everything
  what's needed is in the file_priv struct.
- Renamed the 'work' member of the timer to avoid confusion.
  Now there are 'timeout_work' and 'async_work'.
- Removed the global wait queue and moved it to file_priv.
- Only creating the work queue when the first file is opened.

Tadeusz Struk (2):
      tpm: add ptr to the tpm_space struct to file_priv
      tpm: add support for nonblocking operation

 drivers/char/tpm/tpm-dev-common.c |  150 +++++++++++++++++++++++++++----------
 drivers/char/tpm/tpm-dev.c        |   22 +++--
 drivers/char/tpm/tpm-dev.h        |   19 +++--
 drivers/char/tpm/tpm-interface.c  |    1 
 drivers/char/tpm/tpm.h            |    1 
 drivers/char/tpm/tpmrm-dev.c      |   31 ++++----
 6 files changed, 152 insertions(+), 72 deletions(-)

--
TS

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2018-06-21 17:36 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 17:58 [PATCH v3 0/2] tpm: add support for nonblocking operation Tadeusz Struk
2018-06-12 17:58 ` Tadeusz Struk
2018-06-12 17:58 ` [PATCH v3 1/2] tpm: add ptr to the tpm_space struct to file_priv Tadeusz Struk
2018-06-12 17:58   ` Tadeusz Struk
2018-06-12 17:58 ` [PATCH v3 2/2] tpm: add support for nonblocking operation Tadeusz Struk
2018-06-12 17:58   ` Tadeusz Struk
2018-06-13 17:55   ` J Freyensee
2018-06-13 17:55     ` J Freyensee
2018-06-13 17:55     ` J Freyensee
2018-06-13 18:05     ` Tadeusz Struk
2018-06-13 18:05       ` Tadeusz Struk
2018-06-13 18:05       ` Tadeusz Struk
2018-06-19 13:10 ` [PATCH v3 0/2] " Jarkko Sakkinen
2018-06-19 13:10   ` Jarkko Sakkinen
2018-06-20  0:45   ` Tadeusz Struk
2018-06-20  0:45     ` Tadeusz Struk
2018-06-20 23:59     ` James Bottomley
2018-06-20 23:59       ` James Bottomley
2018-06-21  1:24       ` Tadeusz Struk
2018-06-21  1:24         ` Tadeusz Struk
2018-06-21  5:26         ` James Bottomley
2018-06-21  5:26           ` James Bottomley
2018-06-21  5:26           ` James Bottomley
2018-06-21 16:20           ` Tadeusz Struk
2018-06-21 16:20             ` Tadeusz Struk
2018-06-21 17:17     ` Jarkko Sakkinen
2018-06-21 17:17       ` Jarkko Sakkinen
2018-06-21 17:36       ` Tadeusz Struk
2018-06-21 17:36         ` Tadeusz Struk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.