diff options
| author | Amith Nuggehalli <aramachan@nvidia.com> | 2017-09-07 01:19:16 -0400 |
|---|---|---|
| committer | Stephen Wolfe <swolfe@nvidia.com> | 2018-07-27 17:12:44 -0400 |
| commit | 9b415b21b13c94f26269dfb97f648be59f931ef8 (patch) | |
| tree | e210f7597e25480d0088a0ec10390cfbd9413d6d /include/linux | |
| parent | af5f3aec798ad724697053b9e993fc53eefbfadd (diff) | |
Add polling thread to poll TX vq
*** This change is needed for multi-guest trusty use-case only ***
Trusty (TOS) splits the incoming requests into kernel and user threads.
These threads are blocked on events, run when their event is released.
Trusty also has an idle thread whose priority is lower than all other
threads in the OS. It runs when there is no other active thread to run
and it takes the cpu back to the NS world (idle return).
In multi-guest configuration, TOS can receive requests from multiple
guests concurrently. While some requests are exclusive rest others
access shared system resources such as SE engine keyslots and so on.
Infact, trusted applications can also be considered to be shared
resources as they are single threaded and only one instance of
each TA runs on the system.
Threads waiting on shared resources or service from a server, go
to sleep if the wait is not released immediately. In such cases,
the incoming guest returns back to the kernel, while its requests
are still waiting in TOS.This guest kernel would need some
kind of a callback or an asynchronous event or rudimentary polling to
inform its requests are completed. The cpu running in trusty runs all
the waiting threads before it returns back to its guest.
This fix checks the VQ for any new buffers at every second. So
at the end of each interval, there is a guarantee that the kernel
looks at its Rx queues and notifies the clients waiting on their
channels for any new messages.
JIRA: SEC-412
TESTS: Ran 10,000 iterations of sample_client1 calling crypto, secure
storage, secure RTC and nvcrypto APIs concurrently on both guest
VMs in a linux-linux configuration. Tests complete successfully.
Change-Id: I7e336c79cac0ebb36a81921553243c09c98a6568
Signed-off-by: Amith Nuggehalli <aramachan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1550450
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mihir Joshi <mihirj@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/trusty/trusty.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/trusty/trusty.h b/include/linux/trusty/trusty.h index bd7c91313..a203e6943 100644 --- a/include/linux/trusty/trusty.h +++ b/include/linux/trusty/trusty.h | |||
| @@ -60,6 +60,9 @@ struct notifier_block; | |||
| 60 | enum { | 60 | enum { |
| 61 | TRUSTY_CALL_PREPARE, | 61 | TRUSTY_CALL_PREPARE, |
| 62 | TRUSTY_CALL_RETURNED, | 62 | TRUSTY_CALL_RETURNED, |
| 63 | #ifdef CONFIG_TEGRA_VIRTUALIZATION | ||
| 64 | TRUSTY_CALL_VQ_POLLING, | ||
| 65 | #endif | ||
| 63 | }; | 66 | }; |
| 64 | int trusty_call_notifier_register(struct device *dev, | 67 | int trusty_call_notifier_register(struct device *dev, |
| 65 | struct notifier_block *n); | 68 | struct notifier_block *n); |
