| #
956c2d50 |
| 12-Jun-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: fix race condition on TA/PTA/StMM context loading
Fix race condition on creation of a context for single instance TAs, PTAs or StMM application. Such race condition could occur and lead to dup
core: fix race condition on TA/PTA/StMM context loading
Fix race condition on creation of a context for single instance TAs, PTAs or StMM application. Such race condition could occur and lead to duplicated contexts if connected close enough that they are created after tee_ta_init_session() calls tee_ta_init_session_with_context() and before the context are added in the centralized context list.
This is realized by keeping tee_ta_mutex held while tee_ctxes list is looked up for matching a context or a new context is added into that list with its .is_initializing field activated. For that purpose user TA and StMM application initialization function are split in 2 functions, the 2nd one used to finalizes the context creation started in the 1st function.
By the way, add inline description comments and fix indentation issues in uaer_ta.h and remove the inline comment in pseudo_ta.c that refers to TA loading whereas the function relates to PTA contexts creation.
Closes: https://github.com/OP-TEE/optee_os/issues/6801 Suggested-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
fee55718 |
| 14-May-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: make is_initializing field a generic service context
Replace fields is_initializing from struct user_mode_ctx and struct stmm_ctx with a common new field is_initialing in generic struct tee_ta
core: make is_initializing field a generic service context
Replace fields is_initializing from struct user_mode_ctx and struct stmm_ctx with a common new field is_initialing in generic struct tee_ta_ctx so that it can be used in generic context loading functions for contexts which initialization is done with tee_ta_mutex released.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| #
8f31ccb0 |
| 25-Jan-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add StMM to reported services
Adds StMM to the list of services reported by the device pseudo TA.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Ilias Apalodimas <ilias
core: add StMM to reported services
Adds StMM to the list of services reported by the device pseudo TA.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
7213740b |
| 12-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: separate sp_ops using a __weak attribute instead
Breaks the dependency chain for sp_ops using the standard method with a __weak symbol and an overriding symbol in link_dummies_paged.c.
Review
core: separate sp_ops using a __weak attribute instead
Breaks the dependency chain for sp_ops using the standard method with a __weak symbol and an overriding symbol in link_dummies_paged.c.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, pager, Clang 12) Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
4a6784ca |
| 30-Apr-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core/arch/arm/include/*.h: use U() for unsigned constants
Updates with the U() macro as described in the recently updated coding guidelines.
Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked
core/arch/arm/include/*.h: use U() for unsigned constants
Updates with the U() macro as described in the recently updated coding guidelines.
Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
409c619b |
| 09-Apr-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: stmm: Remove pager constraint on stmm_sp_ops
Fix a memory layout issue when CFG_WITH_STMM_SP=y and CFG_WITH_PAGER=y.
Before this change were all StMM operation function handlers their related
core: stmm: Remove pager constraint on stmm_sp_ops
Fix a memory layout issue when CFG_WITH_STMM_SP=y and CFG_WITH_PAGER=y.
Before this change were all StMM operation function handlers their related resources being linked into the pager unpaged sections despite they could be pageable. The reason is stmm_sp_ops is referenced in helper function is_stmm_ctx() which is referenced in unpaged helper function is_user_mode_ctx().
This change removes stmm_sp_ops reference pager constraint by using an indirect reference in is_stmm_ctx().
Declare stmm_dump_state() in pager unpaged section and preserve __rodata_unpaged attribute for stmm_sp_ops since ::dump_state operation is called from unpaged context by abort_print_current_ts().
Co-developed-by: Timothée Cercueil <timothee.cercueil@st.com> Signed-off-by: Timothée Cercueil <timothee.cercueil@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
d9339333 |
| 11-Nov-2020 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: stmm: support 32bit execution
Add support for 32bit EL0 secure partition StMM when Core is 32bit.
Defines 32bit FFA identifiers FFA_SVC_*_32 and FFA_MSG_*_32. Defines SVC_REGS_Ax() macros to
core: stmm: support 32bit execution
Add support for 32bit EL0 secure partition StMM when Core is 32bit.
Defines 32bit FFA identifiers FFA_SVC_*_32 and FFA_MSG_*_32. Defines SVC_REGS_Ax() macros to wrap 32b/64b thread_svc_regs structure fields in StMM secure partition driver. Defines __FFA_* local macros to wrap 32b/64b service IDs.
Save usr_sp banked register in return_helper() has it shall be preserved when we will enter again the secure partition.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| #
f9cd31c5 |
| 05-Oct-2020 |
Jelle Sels <jelle.sels@arm.com> |
core: rename secure_partition to stmm_sp
The current secure partition code is used for the stmm SP. Rename it so we can start integrating the FF-A secure partitions.
Backwards compatibility is main
core: rename secure_partition to stmm_sp
The current secure partition code is used for the stmm SP. Rename it so we can start integrating the FF-A secure partitions.
Backwards compatibility is maintained when CFG_STMM_PATH is used to enable support for STMM. The internal configuration flag CFG_WITH_SECURE_PARTITION is renamed to CFG_WITH_STMM_SP.
Signed-off-by: Jelle Sels <jelle.sels@arm.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
show more ...
|