Skip to content

Commit

Permalink
build: add CFG_DYN_SHM_CAP config variable
Browse files Browse the repository at this point in the history
This variable can disable reported capability
OPTEE_SMC_SEC_CAP_DYNAMIC_SHM.

But dynamic SHM remains fully operational, though. This can be used
for testing and debugging to emulate system, where dynamic SHM is not
supported.

Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
lorc authored and jforissier committed Oct 11, 2017
1 parent bea839d commit d81f93a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/arch/arm/tee/entry_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ static void tee_entry_exchange_capabilities(struct thread_smc_args *args)
args->a0 = OPTEE_SMC_RETURN_OK;
args->a1 = OPTEE_SMC_SEC_CAP_HAVE_RESERVED_SHM;

#if defined(CFG_DYN_SHM_CAP)
dyn_shm_en = core_mmu_nsec_ddr_is_defined();
if (dyn_shm_en)
args->a1 |= OPTEE_SMC_SEC_CAP_DYNAMIC_SHM;
#endif

IMSG("Dynamic shared memory is %sabled", dyn_shm_en ? "en" : "dis");
}
Expand Down
7 changes: 7 additions & 0 deletions mk/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,10 @@ CFG_SECURE_DATA_PATH ?= n
# so its value represents log2(cores/cluster).
# Default is 2**(2) = 4 cores per cluster.
CFG_CORE_CLUSTER_SHIFT ?= 2

# Do not report to NW that dynamic shared memory (shared memory outside
# predefined region) is enabled.
# Note that you can disable this feature for debug purposes. OP-TEE will not
# report to Normal World that it support dynamic SHM. But, nevertheles it
# will accept dynamic SHM buffers.
CFG_DYN_SHM_CAP ?= y

0 comments on commit d81f93a

Please sign in to comment.