linux/drivers/tee/optee
Jens Wiklander d88e0493a0 tee: simplify shm pool handling
Replaces the shared memory pool based on two pools with a single pool.
The alloc() function pointer in struct tee_shm_pool_ops gets another
parameter, align. This makes it possible to make less than page aligned
allocations from the optional reserved shared memory pool while still
making user space allocations page aligned. With in practice unchanged
behaviour using only a single pool for bookkeeping.

The allocation algorithm in the static OP-TEE shared memory pool is
changed from best-fit to first-fit since only the latter supports an
alignment parameter. The best-fit algorithm was previously the default
choice and not a conscious one.

The optee and amdtee drivers are updated as needed to work with this
changed pool handling.

This also removes OPTEE_SHM_NUM_PRIV_PAGES which becomes obsolete with
this change as the private pages can be mixed with the payload pages.

The OP-TEE driver changes minimum alignment for argument struct from 8
bytes to 512 bytes. A typical OP-TEE private shm allocation is 224 bytes
(argument struct with 6 parameters, needed for open session). So with an
alignment of 512 well waste a bit more than 50%. Before this we had a
single page reserved for this so worst case usage compared to that would
be 3 pages instead of 1 page. However, this worst case only occurs if
there is a high pressure from multiple threads on secure world. All in
all this should scale up and down better than fixed boundaries.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2022-02-16 07:49:41 +01:00
..
call.c optee: add FF-A support 2021-10-18 11:44:23 +02:00
core.c tee: simplify shm pool handling 2022-02-16 07:49:41 +01:00
device.c tee: optee: Fix missing devices unregister during optee_remove 2021-10-12 13:24:39 +02:00
ffa_abi.c tee: simplify shm pool handling 2022-02-16 07:49:41 +01:00
Kconfig tee: simplify shm pool handling 2022-02-16 07:49:41 +01:00
Makefile optee: separate notification functions 2021-11-17 14:08:56 +01:00
notif.c optee: separate notification functions 2021-11-17 14:08:56 +01:00
optee_ffa.h optee: add FF-A support 2021-10-18 11:44:23 +02:00
optee_msg.h optee: add asynchronous notifications 2021-11-17 14:08:57 +01:00
optee_private.h tee: simplify shm pool handling 2022-02-16 07:49:41 +01:00
optee_rpc_cmd.h optee: separate notification functions 2021-11-17 14:08:56 +01:00
optee_smc.h optee: add asynchronous notifications 2021-11-17 14:08:57 +01:00
optee_trace.h tee: optee: add invoke_fn tracepoints 2021-03-15 12:04:01 +01:00
rpc.c optee: separate notification functions 2021-11-17 14:08:56 +01:00
smc_abi.c tee: simplify shm pool handling 2022-02-16 07:49:41 +01:00
supp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00