Skip to content

Commit

Permalink
build: add CFG_DBG_DISABLE_DYN_SHM_CAP config variable
Browse files Browse the repository at this point in the history
This variable disables reported capability OPTEE_SMC_SEC_CAP_DYNAMIC_SHM.
But dynamic SHM remains fully operational, though.

Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
  • Loading branch information
lorc committed Oct 10, 2017
1 parent b4557ca commit 35f5ace
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 @@ -104,12 +104,14 @@ 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_DBG_DISABLE_DYN_SHM_CAP)
if (core_mmu_nsec_ddr_is_defined()) {
IMSG("NS DDR defined. Enabling dynamic SHM");
args->a1 |= OPTEE_SMC_SEC_CAP_DYNAMIC_SHM;
} else {
IMSG("No NS DDR defined for the platform. Disabling dynamic SHM");
}
#endif
}

static void tee_entry_disable_shm_cache(struct thread_smc_args *args)
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_DBG_DISABLE_DYN_SHM_CAP ?= n

0 comments on commit 35f5ace

Please sign in to comment.