summaryrefslogtreecommitdiff
path: root/lib/el3_runtime
diff options
context:
space:
mode:
authorManish Pandey <manish.pandey2@arm.com>2022-11-17 15:47:05 +0000
committerManish Pandey <manish.pandey2@arm.com>2022-12-14 15:47:34 +0100
commit1cbe42a510812a4a4415a26ba46821cad1c04b68 (patch)
tree4719372b04b232f9e8499ef287607700284cef4f /lib/el3_runtime
parente61713b00715fc988a970687f9bf53418b81b0ca (diff)
downloadarm-trusted-firmware-1cbe42a510812a4a4415a26ba46821cad1c04b68.tar.gz
fix(el3_runtime): allow SErrors when executing in EL3
SCR_EL3.EA is set to 1 in BL31 initialization and is cleared before entering to lower ELs(except for RAS FFH case "HANDLE_EA_EL3_FIRST_NS"). The cleared value persist even during run time when execution comes back to EL3. When SCR_EL3.EA is 0 and execution state is EL3, Async EAs(delivered as SErrors) are implicitly masked and hence any Async EA by EL3 will remain pending and will trap at the exception level EA is targeted to and unmasked when entering lower EL. This causes unexpected EA at lower EL. This is a very rare to get SError in EL3 until unless there is any programming error. This patch sets SCR_EL3.EA to 1 when entering EL3 from lower EL. Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: Ibb593369edb034f670fd85ee79adc9829b900a83
Diffstat (limited to 'lib/el3_runtime')
-rw-r--r--lib/el3_runtime/aarch64/context.S10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/el3_runtime/aarch64/context.S b/lib/el3_runtime/aarch64/context.S
index b126b9cd8..60501f615 100644
--- a/lib/el3_runtime/aarch64/context.S
+++ b/lib/el3_runtime/aarch64/context.S
@@ -788,6 +788,15 @@ endfunc fpregs_context_restore
#endif /* CTX_INCLUDE_FPREGS */
/*
+ * Set SCR_EL3.EA bit to enable SErrors at EL3
+ */
+ .macro enable_serror_at_el3
+ mrs x8, scr_el3
+ orr x8, x8, #SCR_EA_BIT
+ msr scr_el3, x8
+ .endm
+
+ /*
* Set the PSTATE bits not set when the exception was taken as
* described in the AArch64.TakeException() pseudocode function
* in ARM DDI 0487F.c page J1-7635 to a default value.
@@ -917,6 +926,7 @@ endfunc fpregs_context_restore
*/
func prepare_el3_entry
save_gp_pmcr_pauth_regs
+ enable_serror_at_el3
/*
* Set the PSTATE bits not described in the Aarch64.TakeException
* pseudocode to their default values.