tee: optee: support tracking system threads
authorEtienne Carriere <etienne.carriere@foss.st.com>
Mon, 30 Oct 2023 08:48:11 +0000 (09:48 +0100)
committerJens Wiklander <jens.wiklander@linaro.org>
Fri, 17 Nov 2023 14:48:03 +0000 (15:48 +0100)
commit45bc2c9b5b230b95cad10f44204d7b28f52b74c0
tree6af56a13460511b0b5f890026086ceed613d94f1
parenta9214a8883ceb82df55aa90d1c49ddb85fc1e3d5
tee: optee: support tracking system threads

Adds support in the OP-TEE driver to keep track of reserved system
threads. The logic allows one OP-TEE thread to be reserved to TEE system
sessions.

The optee_cq_*() functions are updated to handle this if enabled,
that is when TEE describes how many thread context it supports
and when at least 1 session has registered as a system session
(using tee_client_system_session()).

For sake of simplicity, initialization of call queue management
is factorized into new helper function optee_cq_init().

The SMC ABI part of the driver enables this tracking, but the
FF-A ABI part does not.

Co-developed-by: Jens Wiklander <jens.wiklander@linaro.org>
Co-developed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
drivers/tee/optee/call.c
drivers/tee/optee/ffa_abi.c
drivers/tee/optee/optee_private.h
drivers/tee/optee/smc_abi.c