diff options
author | Hanna Hawa <hannah@marvell.com> | 2018-06-24 17:48:51 +0300 |
---|---|---|
committer | Kostya Porotchkin <kostap@marvell.com> | 2018-07-18 11:34:56 +0300 |
commit | 1ab07f1fd4b472ad4f80c46f6be411ab5a11a94e (patch) | |
tree | c10b0cae7e4453843804e10a3e82eff6df16bbd5 | |
parent | 1bc99e8f8bd3b763754a01dd599db0c6f2d2d96a (diff) |
runtime_exceptions: add default lower el system error handler
When ATF is built with HANDLE_EA_EL3_FIRST (more in doc), the external
aborts and serror interrupts will be trapped in EL3.
Add simple weak serror handler for lower level data aborts.
Change-Id: I568085d8ddbbafb01648bb71856e3650039264e2
Signed-off-by: Hanna Hawa <hannah@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/57293
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
-rw-r--r-- | bl31/aarch64/runtime_exceptions.S | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/bl31/aarch64/runtime_exceptions.S b/bl31/aarch64/runtime_exceptions.S index 9719874e..6860924d 100644 --- a/bl31/aarch64/runtime_exceptions.S +++ b/bl31/aarch64/runtime_exceptions.S @@ -35,6 +35,29 @@ .globl serror_aarch32 .weak dabort_lower_el_handler + .weak serror_lower_el_handler + + /* --------------------------------------------------------------------- + * This macro handles Asynchronous exceptions. + * Only system error are supported + * --------------------------------------------------------------------- + */ + .macro handle_async_exception + /* Enable the SError interrupt */ + msr daifclr, #DAIF_ABT_BIT + + str x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_LR] + + mrs x30, esr_el3 + ubfx x30, x30, #ESR_EC_SHIFT, #ESR_EC_LENGTH + + cmp x30, #EC_SERROR + b.eq serror_lower_el_handler + + /* Other kinds of asynchronous exceptions are not handled */ + ldr x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_LR] + b report_unhandled_exception + .endm /* --------------------------------------------------------------------- * This macro handles Synchronous exceptions. @@ -259,7 +282,7 @@ vector_entry serror_aarch64 * SError exceptions from lower ELs are not currently supported. * Report their occurrence. */ - b report_unhandled_exception + handle_async_exception check_vector_size serror_aarch64 /* --------------------------------------------------------------------- @@ -417,3 +440,12 @@ endfunc smc_handler dabort_lower_el_handler: ldr x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_LR] b report_unhandled_exception + + /* --------------------------------------------------------------------- + * Weak handler for serror calls from lower exception levels, can be + * overwritten by platform handler. + * --------------------------------------------------------------------- + */ +serror_lower_el_handler: + ldr x30, [sp, #CTX_GPREGS_OFFSET + CTX_GPREG_LR] + b report_unhandled_exception |