aboutsummaryrefslogtreecommitdiff
path: root/core/kernel
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2017-11-14 14:34:08 +0100
committerJérôme Forissier <jerome.forissier@linaro.org>2017-11-15 17:52:48 +0100
commitc7c4b6e31b3ba5b1c92a50fc00680fc07755e4ef (patch)
tree95ee6d73c29bf296c1007a81055b6c6f77ef7bca /core/kernel
parentc330283b4a00d2e0b9229c78f1e95268f7c5d915 (diff)
core: allow multithreaded pseudo TAs
Introduces TA_FLAG_CONCURRENT valid for pseudo TAs only which allows concurrent execution of the TA. With this change a pseudo TA configured with TA_FLAG_CONCURRENT would accept multiple sessions where each can be used concurrently with the other sessions. Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/kernel')
-rw-r--r--core/kernel/tee_ta_manager.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/kernel/tee_ta_manager.c b/core/kernel/tee_ta_manager.c
index 65304717..12bb98a8 100644
--- a/core/kernel/tee_ta_manager.c
+++ b/core/kernel/tee_ta_manager.c
@@ -116,6 +116,9 @@ static bool tee_ta_try_set_busy(struct tee_ta_ctx *ctx)
{
bool rc = true;
+ if (ctx->flags & TA_FLAG_CONCURRENT)
+ return true;
+
mutex_lock(&tee_ta_mutex);
if (ctx->flags & TA_FLAG_SINGLE_INSTANCE)
@@ -156,6 +159,9 @@ static void tee_ta_set_busy(struct tee_ta_ctx *ctx)
static void tee_ta_clear_busy(struct tee_ta_ctx *ctx)
{
+ if (ctx->flags & TA_FLAG_CONCURRENT)
+ return;
+
mutex_lock(&tee_ta_mutex);
assert(ctx->busy);