Home
last modified time | relevance | path

Searched hist:ce56605a0ede428379531a49ae766ec3b16aab9a (Results 1 – 2 of 2) sorted by relevance

/optee_os/lib/libutils/ext/include/
H A Dfault_mitigation.hce56605a0ede428379531a49ae766ec3b16aab9a Fri Sep 22 05:30:39 UTC 2023 Sichun Qin <sichun.qin@amlogic.com> core: support fault mitigations in non-threaded code

Fault mitigation won't work in non-threaded code due to the following
error:
assertion 'ct >= 0 && ct < CFG_NUM_THREADS' failed at core/arch/arm/kernel
/thread.c:799 <thread_get_id>

The problem is in __ftmn_get_tsd_func_arg_pp which calls thread_get_tsd
which thread_get_id. The reason is that the interrupt handler is not
associated with any thread, so the ct (current_thread_id) value is -1 which
would cause an assert problem.

The fix is to add ftmn_arg to thread_core_local and the new variable would
be used when the current thread is < 0.

Signed-off-by: Sichun Qin <sichun.qin@amlogic.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
/optee_os/core/arch/arm/include/kernel/
H A Dthread_arch.hce56605a0ede428379531a49ae766ec3b16aab9a Fri Sep 22 05:30:39 UTC 2023 Sichun Qin <sichun.qin@amlogic.com> core: support fault mitigations in non-threaded code

Fault mitigation won't work in non-threaded code due to the following
error:
assertion 'ct >= 0 && ct < CFG_NUM_THREADS' failed at core/arch/arm/kernel
/thread.c:799 <thread_get_id>

The problem is in __ftmn_get_tsd_func_arg_pp which calls thread_get_tsd
which thread_get_id. The reason is that the interrupt handler is not
associated with any thread, so the ct (current_thread_id) value is -1 which
would cause an assert problem.

The fix is to add ftmn_arg to thread_core_local and the new variable would
be used when the current thread is < 0.

Signed-off-by: Sichun Qin <sichun.qin@amlogic.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>