diff options
| author | Michael Ryleev <gmar@google.com> | 2016-10-11 14:01:14 -0400 |
|---|---|---|
| committer | Stephen Wolfe <swolfe@nvidia.com> | 2018-07-27 17:12:44 -0400 |
| commit | 27e57ad67ae0b76cdf94e323c07b6db90f11bea4 (patch) | |
| tree | 3d713234ab5c0ed9c0398c492246a0f5a56aa008 /include/linux | |
| parent | 0d7d2541765e7f341d89b684c1ebe7599c95e3c8 (diff) | |
trusty: add support for parameterized NOP ops
Parameterized NOPs are introduced by Trusty secure side to
facilitate better SMP concurrency. They are effectively NOP
calls with parameters that will be routed to appropriate
handlers on secure side which can be executed concurrently
on multiple CPUs. Parameterized NOPs are represented by
trusty_nop structure that has to be initialized by calling
trusty_nop_init call. This patch creates queue for such items,
adds per CPU work queue to invoke them and adds API to enqueue
and dequeue them.
Change-Id: I4c450c3d6cc18b246dfd0ca4526ef8703c1c2d64
Signed-off-by: Michael Ryleev <gmar@google.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/trusty/smcall.h | 3 | ||||
| -rw-r--r-- | include/linux/trusty/trusty.h | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/linux/trusty/smcall.h b/include/linux/trusty/smcall.h index 2e43803d9..4e03a97ee 100644 --- a/include/linux/trusty/smcall.h +++ b/include/linux/trusty/smcall.h | |||
| @@ -120,7 +120,8 @@ | |||
| 120 | */ | 120 | */ |
| 121 | #define TRUSTY_API_VERSION_RESTART_FIQ (1) | 121 | #define TRUSTY_API_VERSION_RESTART_FIQ (1) |
| 122 | #define TRUSTY_API_VERSION_SMP (2) | 122 | #define TRUSTY_API_VERSION_SMP (2) |
| 123 | #define TRUSTY_API_VERSION_CURRENT (2) | 123 | #define TRUSTY_API_VERSION_SMP_NOP (3) |
| 124 | #define TRUSTY_API_VERSION_CURRENT (3) | ||
| 124 | #define SMC_FC_API_VERSION SMC_FASTCALL_NR (SMC_ENTITY_SECURE_MONITOR, 11) | 125 | #define SMC_FC_API_VERSION SMC_FASTCALL_NR (SMC_ENTITY_SECURE_MONITOR, 11) |
| 125 | 126 | ||
| 126 | /* TRUSTED_OS entity calls */ | 127 | /* TRUSTED_OS entity calls */ |
diff --git a/include/linux/trusty/trusty.h b/include/linux/trusty/trusty.h index 24fe2101a..742c09e9e 100644 --- a/include/linux/trusty/trusty.h +++ b/include/linux/trusty/trusty.h | |||
| @@ -69,4 +69,20 @@ int trusty_call32_mem_buf(struct device *dev, u32 smcnr, | |||
| 69 | struct page *page, u32 size, | 69 | struct page *page, u32 size, |
| 70 | pgprot_t pgprot); | 70 | pgprot_t pgprot); |
| 71 | 71 | ||
| 72 | struct trusty_nop { | ||
| 73 | struct list_head node; | ||
| 74 | u32 args[3]; | ||
| 75 | }; | ||
| 76 | |||
| 77 | static inline void trusty_nop_init(struct trusty_nop *nop, | ||
| 78 | u32 arg0, u32 arg1, u32 arg2) { | ||
| 79 | INIT_LIST_HEAD(&nop->node); | ||
| 80 | nop->args[0] = arg0; | ||
| 81 | nop->args[1] = arg1; | ||
| 82 | nop->args[2] = arg2; | ||
| 83 | } | ||
| 84 | |||
| 85 | void trusty_enqueue_nop(struct device *dev, struct trusty_nop *nop); | ||
| 86 | void trusty_dequeue_nop(struct device *dev, struct trusty_nop *nop); | ||
| 87 | |||
| 72 | #endif | 88 | #endif |
