Hello,experts
I am reading the code about the optee supported by xen.
I noticed following code which about the limitation of the
“max optee threads”.
Is the limitation should be applied to all of the guest VMs running on Xen ?
if it is yes, however, ctx is per VM, so, if there is another VM enable the optee , the limitation may exceed the number of max optee threads.
Is it right?
File: xen/arch/arm/tee/optee.c
static struct optee_std_call *allocate_std_call(struct optee_domain *ctx)
{
struct optee_std_call *call;
int count;
/*
* Make sure that guest does not execute more than max_optee_threads.
* This also indirectly limits number of RPC SHM buffers, because OP-TEE
* allocates one such buffer per standard call.
*/
count = atomic_add_unless(&ctx->call_count, 1, max_optee_threads);
if ( count == max_optee_threads )
return ERR_PTR(-ENOSPC);