| #
e7dd9fbb |
| 17-Jan-2024 |
Volodymyr Babchuk <volodymyr_babchuk@epam.com> |
arm: virtualization: don't allow hypervisor to issue std calls
There is standing issue with having two versions of OP-TEE binary: with virtualization enabled and without it. Correct variant needs to
arm: virtualization: don't allow hypervisor to issue std calls
There is standing issue with having two versions of OP-TEE binary: with virtualization enabled and without it. Correct variant needs to be present on board before booting rest of the system.
If non-virtualized variant is present and user tries to boot a hypervisor, hypervisor can (and should) detect that OP-TEE does not provide OPTEE_SMC_SEC_CAP_VIRTUALIZATION capability and fail gracefully.
On other hand, when virtualized variant of OP-TEE is booted, but user then boots directly into Linux (or any other OS), OP-TEE crashes:
E/TC:0 0 0 Core data-abort at address 0xffffffffffffffa0 (translation fault) E/TC:0 0 0 esr 0x96000044 ttbr0 0x4418d000 ttbr1 0x00000000 cidr 0x0 E/TC:0 0 0 cpu #0 cpsr 0x00000184 E/TC:0 0 0 x0 0000000032000004 x1 0000000000000004 E/TC:0 0 0 x2 000000008183c000 x3 0000000000000000 E/TC:0 0 0 x4 0000000000000000 x5 0000000000000000 E/TC:0 0 0 x6 0000000000000000 x7 0000000000000000 E/TC:0 0 0 x8 0000000000000000 x9 0000000000000000 E/TC:0 0 0 x10 0000000000000000 x11 0000000000000000 E/TC:0 0 0 x12 0000000000000000 x13 0000000000000000 E/TC:0 0 0 x14 0000000000000000 x15 0000000000000000 E/TC:0 0 0 x16 0000000000000000 x17 0000000000000000 E/TC:0 0 0 x18 0000000000000000 x19 0000000000000000 E/TC:0 0 0 x20 0000000000000000 x21 0000000000000000 E/TC:0 0 0 x22 0000000000000000 x23 0000000000000000 E/TC:0 0 0 x24 0000000000000000 x25 0000000000000000 E/TC:0 0 0 x26 0000000000000000 x27 0000000000000000 E/TC:0 0 0 x28 0000000000000000 x29 0000000000000000 E/TC:0 0 0 x30 0000000044103ce4 elr 0000000044106314 E/TC:0 0 0 sp_el0 0000000000000000 E/TC:0 0 0 TEE load address @ 0x44100000 E/TC:0 0 0 Call stack: E/TC:0 0 0 0x44106314 thread_handle_std_smc at core/arch/arm/kernel/thread_optee_smc.c:62 E/TC:0 0 0 Panic 'unhandled pageable abort' at core/arch/arm/kernel/abort.c:584 <abort_handler> E/TC:0 0 0 TEE load address @ 0x44100000 E/TC:0 0 0 Call stack: E/TC:0 0 0 0x44107e14 print_kernel_stack at core/arch/arm/kernel/unwind_arm64.c:89 E/TC:0 0 0 0x44114ffc __do_panic at core/kernel/panic.c:73 E/TC:0 0 0 0x44107050 get_fault_type at core/arch/arm/kernel/abort.c:500
This crash happens because virtualization code has special case for guest_id == HYP_CLNT_ID. This case is needed to allow hypervisor to call fast SMCs, so it can check OP-TEE version, capabilities and ask OP-TEE to create/destroy guest partitions. Problem is that thread_handle_std_smc() assumes that virt_set_guest() really sets the guest partition, which does not happen in this special case.
This patch removes this special case from virt_set_guest(). Instead thread_handle_fast_smc() function checks for HYP_CLNT_ID explicitly.
If hypervisor really want to be able to issue STD calls, it should create a partition for itself using OPTEE_SMC_VM_CREATED call.
With this patch applied, virtualized variant of OP-TEE does not crash anymore when users tries to boot into a baremetal setup.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
5ca2c365 |
| 10-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander
core: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
6c884c93 |
| 26-Oct-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: rpc_alloc: remove size limit for kernel payload
Removes the size limit of 1 page imposed in thread_rpc_alloc_kernel_payload(). The purpose of this limit was to error out early since the k
core: arm: rpc_alloc: remove size limit for kernel payload
Removes the size limit of 1 page imposed in thread_rpc_alloc_kernel_payload(). The purpose of this limit was to error out early since the kernel doesn't supply a list of physical pages and the source of the error is not obvious at first glance. This is now about to change so remove the limit since the kernel now may supply the needed list of physical pages.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
4989730f |
| 13-Nov-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: check for NULL mobj before thread_rpc_free()
In the SMC and FF-A ABIs check that a mobj representing a shared memory object isn't NULL before doing an RPC to free it in the normal world t
core: arm: check for NULL mobj before thread_rpc_free()
In the SMC and FF-A ABIs check that a mobj representing a shared memory object isn't NULL before doing an RPC to free it in the normal world too. For the FF-A ABI it's harmless without this check, but the SMC ABI may cause an NULL pointer dereference in the OP-TEE kernel driver.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
b76b2296 |
| 03-Feb-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
virt: rename CFG_VIRTUALIZATION to CFG_NS_VIRTUALIZATION
With the advent of virtualization support at S-EL2 in the Armv8.4-A architecture, CFG_VIRTUALIZATION has become ambiguous. Let's rename it to
virt: rename CFG_VIRTUALIZATION to CFG_NS_VIRTUALIZATION
With the advent of virtualization support at S-EL2 in the Armv8.4-A architecture, CFG_VIRTUALIZATION has become ambiguous. Let's rename it to CFG_NS_VIRTUALIZATION to indicate more clearly that it is about supporting virtualization on the non-secure side.
This commit is the result of the following command:
$ for f in $(git grep -l -w CFG_VIRTUALIZATION); do \ sed -i -e 's/CFG_VIRTUALIZATION/CFG_NS_VIRTUALIZATION/g' $f; \ done
...plus the compatibility line in mk/config.mk:
CFG_NS_VIRTUALIZATION ?= $(CFG_VIRTUALIZATION)
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
show more ...
|
| #
d0418bb0 |
| 09-Sep-2022 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: rpc: log error when allocation fails in non-secure world
The error messages printed when the non-secure world fails to allocate shared memory may be misleading misleading:
E/LD: init_elf:45
core: rpc: log error when allocation fails in non-secure world
The error messages printed when the non-secure world fails to allocate shared memory may be misleading misleading:
E/LD: init_elf:453 sys_open_ta_bin(cb3e5ba0-adf1-11e0-998b-0002a5d5c51b) E/TC:? 0 ldelf_init_with_ldelf:131 ldelf failed with res: 0xffff000c
This looks like an out-of-memory condition (0xffff000c = TEE_ERROR_OUT_OF_MEMORY) in the TEE core ("E/TC"), in other words insufficient core heap space. Add the following message to help pinpoint the issue:
E/TC:? 0 get_rpc_alloc_res:645 RPC allocation failed. Non-secure world result: ret=0xffff000c ret_origin=0x2
This situation can be reproduced by killing tee-supplicant and invoking a TA. When the CA is interrupted (Ctrl-C), the above log is printed.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
44c29b27 |
| 11-Jul-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: arm: kernel: fix rpc shm free when prealloc is disable
Fixes commit [1] that changed implementation of the standard invocation SMC command to introduce invocation with RPC shared memory refere
core: arm: kernel: fix rpc shm free when prealloc is disable
Fixes commit [1] that changed implementation of the standard invocation SMC command to introduce invocation with RPC shared memory reference. A wrong logic was implemented to free RPC buffer on standard invocation completion. This change fixes that by freeing the cached shared memory when pre-allocation is disable by config switch or runtime service.
Fixes: feb290a51087 ("core: add OPTEE_SMC_CALL_WITH_RPC_ARG") Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
feb290a5 |
| 02-Nov-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add OPTEE_SMC_CALL_WITH_RPC_ARG
Adds OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG where the struct optee_msg_arg to be used for RPC is appended in the memory following the norm
core: add OPTEE_SMC_CALL_WITH_RPC_ARG
Adds OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG where the struct optee_msg_arg to be used for RPC is appended in the memory following the normal argument struct optee_msg_arg. OPTEE_SMC_CALL_WITH_REGD_ARG only works with registered shared memory, a cookie and an offset is used instead a physical address.
The presence OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG is indicated by the new OPTEE_SMC_SEC_CAP_RPC_ARG bit returned by OPTEE_SMC_EXCHANGE_CAPABILITIES. OPTEE_SMC_EXCHANGE_CAPABILITIES also reports the number of arguments that the RPC argument struct must have room for.
OPTEE_SMC_CALL_WITH_RPC_ARG, OPTEE_SMC_CALL_WITH_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG can be used interleaved.
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
453d8327 |
| 14-Feb-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: change return type for tee_entry_std() TEE_Result
Changes the return type for the function tee_entry_std() to TEE_Result in order to make it independent of optee_smc.h. tee_entry_std() is also
core: change return type for tee_entry_std() TEE_Result
Changes the return type for the function tee_entry_std() to TEE_Result in order to make it independent of optee_smc.h. tee_entry_std() is also called from yielding_call_with_arg() and it doesn't make sense for that function to return values based on the SMC ABI.
With this we're doing an ABI change for FF-A, but that should not make a difference for the driver since that only test for 0 or !0. In addition if !0 is returned the communication has broken down completely so there not much left to recover from. Note that this patch does not require changes in the Linux kernel driver.
Acked-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
aac71369 |
| 14-Feb-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: move NOTIF_VALUE_DO_BOTTOM_HALF assert to thread_optee_smc.c
Moves the compile assertion that NOTIF_VALUE_DO_BOTTOM_HALF matches OPTEE_SMC_ASYNC_NOTIF_VALUE_DO_BOTTOM_HALF in core/kernel/notif
core: move NOTIF_VALUE_DO_BOTTOM_HALF assert to thread_optee_smc.c
Moves the compile assertion that NOTIF_VALUE_DO_BOTTOM_HALF matches OPTEE_SMC_ASYNC_NOTIF_VALUE_DO_BOTTOM_HALF in core/kernel/notif.c to core/arch/arm/kernel/thread_optee_smc.c to keep dependencies to optee_smc.h in architecture specific code.
Acked-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
7e399f9b |
| 01-Feb-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: move thread_private.h to an include directory
Moves core/arch/arm/kernel/thread_private.h to a include directory to be included as <kernel/thread_private.h>.
Reviewed-by: Jerome Forissier <je
core: move thread_private.h to an include directory
Moves core/arch/arm/kernel/thread_private.h to a include directory to be included as <kernel/thread_private.h>.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
9c4aaf67 |
| 11-Jan-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: make mobj_get_va() more secure
Adds a length parameter to allow mobj_get_va() to check that the entire va range requested is available.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.
core: make mobj_get_va() more secure
Adds a length parameter to allow mobj_get_va() to check that the entire va range requested is available.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
4ed45027 |
| 21-Oct-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: verify size of allocated shared memory
Makes sure that normal world cannot change the size of allocated shared memory, resulting in a smaller buffer being allocated.
This reintroduces cc6bc5f
core: verify size of allocated shared memory
Makes sure that normal world cannot change the size of allocated shared memory, resulting in a smaller buffer being allocated.
This reintroduces cc6bc5f94210 ("core: verify size of allocated shared memory") which was lost with Fixes: 2786f1438fc8 ("core: thread: separate old SMC interface handling"). In addition is the READ_ONCE() macro is used when reading the returned size from non-secure shared memory.
Since then we have a separate set of functions to deal with RPC when communicating with FF-A. A corresponding size check is added for the FF-A version of thread_rpc_alloc().
Reported-by: Patrik Lantz <patrik.lantz@axis.com> Reviewed-by: Patrik Lantz <patrik.lantz@axis.com> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
a94111b9 |
| 31-Aug-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: virtualization.h: add dummy static inline functions
Adds dummy static inline functions to replace the normal virt_*() functions in virtualization.h when CFG_VIRTUALIZATION is not configured.
core: virtualization.h: add dummy static inline functions
Adds dummy static inline functions to replace the normal virt_*() functions in virtualization.h when CFG_VIRTUALIZATION is not configured.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
bddb2f89 |
| 31-Aug-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: virt: use TEE_Result return type for virt_*() functions
Uses TEE_Result as return type for all virt_*() functions returning anything but void in <kernel/virtualization.h>
Reviewed-by: Etienne
core: virt: use TEE_Result return type for virt_*() functions
Uses TEE_Result as return type for all virt_*() functions returning anything but void in <kernel/virtualization.h>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
be501eb1 |
| 05-Oct-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE
Implement the renamed macro using the IS_ALIGNED definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carrie
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE
Implement the renamed macro using the IS_ALIGNED definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
88876632 |
| 01-Oct-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: new config switch CFG_PREALLOC_RPC_CACHE
CFG_PREALLOC_RPC_CACHE=y enables preallocation of an RPC shared memory reference per secure thread. It is default enabled for backward configuration co
core: new config switch CFG_PREALLOC_RPC_CACHE
CFG_PREALLOC_RPC_CACHE=y enables preallocation of an RPC shared memory reference per secure thread. It is default enabled for backward configuration compatibility.
Disabling CFG_PREALLOC_RPC_CACHE can be useful when CFG_WITH_PAGER=y and the pager page pool is somewhat small as RPC cache shm consumes several kByte of unpaged memory.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| #
c2e4eb43 |
| 23-May-2021 |
Anton Rybakov <a.rybakov@omp.ru> |
core_mmu: fix phys_to_virt() to check length
phys_to_virt() function without length parameter doesn`t always have ability to find the correct mapping for requested physical address. This is because
core_mmu: fix phys_to_virt() to check length
phys_to_virt() function without length parameter doesn`t always have ability to find the correct mapping for requested physical address. This is because physical address can be mapped in the same time in different virtual regions with different length. So the first found region which contains the requested physical address possibly doesn`t have enough mapped data. This is fixed by adding the length parameter to phys_to_virt() function. Length parameter can be set to 1 if caller knows that requested (pa + len) doesn`t cross mapping granule boundary.
core_mmu_get_va() and io_pa_or_va() functions now are take length parameter too as they based on phys_to_virt() in case of MMU enabled.
Signed-off-by: Anton Rybakov <a.rybakov@omp.ru> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (stm32mp1-157C_DK2) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabreauto) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6dlsabresd) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6qpsabreauto) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6sllevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ullevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx6ulzevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7dsabresd) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx7ulpevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mmevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mnevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mqevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8mpevk) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qmmek) Tested-by: Clement Faure <clement.faure@nxp.com> (imx-mx8qxpmek)
show more ...
|
| #
3cc421f7 |
| 10-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix thread_disable_prealloc_rpc_cache()
Fixes thread_disable_prealloc_rpc_cache() to also NULL rpc_mobj when freeing the shared memory object. Failing to do so might cause it rpc_mobj pointer
core: fix thread_disable_prealloc_rpc_cache()
Fixes thread_disable_prealloc_rpc_cache() to also NULL rpc_mobj when freeing the shared memory object. Failing to do so might cause it rpc_mobj pointer to be used after free.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
4107d2f9 |
| 16-Mar-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add a4 and a5 to thread_alloc_and_run()
Adds two parameters a4 and a5 to thread_alloc_and_run(), thread_std_smc_entry() and __thread_std_smc_entry().
Zeroes are passed where the new parameter
core: add a4 and a5 to thread_alloc_and_run()
Adds two parameters a4 and a5 to thread_alloc_and_run(), thread_std_smc_entry() and __thread_std_smc_entry().
Zeroes are passed where the new parameters are not needed.
This prepares for the next update of the FF-A ABI for OP-TEE where among other things one more register is used by OPTEE_FFA_YIELDING_CALL_WITH_ARG.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
ae2a9cfc |
| 15-Oct-2020 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
core: fix shared memory buffer rpc allocation
When dynamic shared memory has been configured, contiguous shared memory regions outside reserved SHM need to be included in the allocation pool.
To ke
core: fix shared memory buffer rpc allocation
When dynamic shared memory has been configured, contiguous shared memory regions outside reserved SHM need to be included in the allocation pool.
To keep the implementation simple, we will restrict the size of these allocations to a single page; we can then leverage the mechanism used for the allocation of arguments.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
0733f3d1 |
| 04-Aug-2020 |
Jerome Forissier <jerome@forissier.org> |
core: simplify setting of THREAD_CLF_TMP
Simplifies the manipulation of THREAD_CLF_TMP in the per-core structure thread_core_local:
- thread_clr_thread_core_local() sets the flag for all cores so t
core: simplify setting of THREAD_CLF_TMP
Simplifies the manipulation of THREAD_CLF_TMP in the per-core structure thread_core_local:
- thread_clr_thread_core_local() sets the flag for all cores so that init_secondary_helper() doesn't have to. It is renamed to thread_init_thread_core_local(). - The flag remains set upon return to normal world, ready for the next entry into secure world. - The foreign_intr_handler macro sets the flag since it uses the temporary stack. - thread_core_local_set_tmp_stack_flag() is now unused and can be removed.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
9bee8f2a |
| 21-Jul-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add generic rpc shared memory buffer caching
Replaces tee_fs_rpc_cache_alloc() with thread_rpc_shm_alloc() which also takes a shared memory type as argument. This allows allocating an kernel p
core: add generic rpc shared memory buffer caching
Replaces tee_fs_rpc_cache_alloc() with thread_rpc_shm_alloc() which also takes a shared memory type as argument. This allows allocating an kernel private RPC buffer when needed.
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
ddfb578c |
| 15-Jun-2020 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
core: arm: allocate kernel payload
Request shared memory allocation of TYPE_KERNEL memory
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io
core: arm: allocate kernel payload
Request shared memory allocation of TYPE_KERNEL memory
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> [jw: add spmc counter part] Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
e3a49933 |
| 11-Jun-2020 |
Jerome Forissier <jerome@forissier.org> |
core: add missing THREAD_CLF_TMP flag updates
There are a few places where the value of thread_core_local::flags does not reflect the stack being used, i.e., the temporary stack is used but THREAD_C
core: add missing THREAD_CLF_TMP flag updates
There are a few places where the value of thread_core_local::flags does not reflect the stack being used, i.e., the temporary stack is used but THREAD_CLF_TMP is not set or the opposite. In such cases, get_stack_limits() would return invalid values. The consequence is a debugging issue: no stack dump on core panic or abort.
This was found with the help of compiler instrumentation (-finstrument-functions).
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|