diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2018-09-27 16:54:23 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2018-10-01 10:51:43 +0200 |
commit | 40004d9a633160731095e33dfdd20c615f8e1f59 (patch) | |
tree | 82bbc91706d75b260657df04f8a34b6721119a7b | |
parent | 973e89087f379614cd6e177a3b085e1dcc5cb3e1 (diff) |
abort.c: always save VFP state with thread context
Saving VFP state requires a thread context, if none is available print
abort info and panic().
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Fixes: cfa34ec63699 ("abort.c: manipulate with VFP state only if thread is active")
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Hikey AArch64 pager)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r-- | core/arch/arm/kernel/abort.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/arch/arm/kernel/abort.c b/core/arch/arm/kernel/abort.c index 3622d7ac..44b9dd76 100644 --- a/core/arch/arm/kernel/abort.c +++ b/core/arch/arm/kernel/abort.c @@ -680,11 +680,13 @@ void abort_handler(uint32_t abort_type, struct thread_abort_regs *regs) #endif case FAULT_TYPE_PAGEABLE: default: - if (!thread_foreign_intr_disabled()) - thread_kernel_save_vfp(); + if (thread_get_id_may_fail() < 0) { + abort_print_error(&ai); + panic("abort outside thread context"); + } + thread_kernel_save_vfp(); handled = tee_pager_handle_fault(&ai); - if (!thread_foreign_intr_disabled()) - thread_kernel_restore_vfp(); + thread_kernel_restore_vfp(); if (!handled) { abort_print_error(&ai); if (!abort_is_user_exception(&ai)) |