diff options
author | David Milosevic <David.Milosevic@9elements.com> | 2023-04-27 02:12:31 +0200 |
---|---|---|
committer | Werner Zeh <werner.zeh@siemens.com> | 2024-04-22 07:35:36 +0000 |
commit | 41ba11229a80eb19d97c8052aff1861478ee2486 (patch) | |
tree | 9b6f1803e5854e577a68959e679187e8e4c88c3c /src/arch/arm64/transition_asm.S | |
parent | 93cbbbfc7f32f62b1d20027541122c17e575ced6 (diff) |
arch/arm64: Add EL1/EL2/EL3 support for arm64
Currently, arch/arm64 requires coreboot to run on EL3 due
to EL3 register access. This might be an issue when, for example,
one boots into TF-A first and drops into EL2 for coreboot afterwards.
This patch aims at making arch/arm64 more versatile by removing the
current EL3 constraint and allowing arm64 coreboot to run on EL1,
EL2 and EL3.
The strategy here, is to add a Kconfig option (ARM64_CURRENT_EL) which
lets us specify coreboot's EL upon entry. Based on that, we access the
appropriate ELx registers. So, for example, when running coreboot on
EL1, we would not access vbar_el3 or vbar_el2 but instead vbar_el1.
This way, we don't generate faults when accessing higher-EL registers.
Currently only tested on the qemu-aarch64 target. Exceptions were
tested by enabling FATAL_ASSERTS.
Signed-off-by: David Milosevic <David.Milosevic@9elements.com>
Change-Id: Iae1c57f0846c8d0585384f7e54102a837e701e7e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74798
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: ron minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/arch/arm64/transition_asm.S')
-rw-r--r-- | src/arch/arm64/transition_asm.S | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/arch/arm64/transition_asm.S b/src/arch/arm64/transition_asm.S index 73a6fb6c04..b4522e02da 100644 --- a/src/arch/arm64/transition_asm.S +++ b/src/arch/arm64/transition_asm.S @@ -142,19 +142,16 @@ ENTRY(exc_exit) ENDPROC(exc_exit) /* - * exception_init_asm: Initialize VBAR and point SP_EL3 to exception stack. + * exception_init_asm: Initialize VBAR and point SP_ELx to exception stack. * Also unmask aborts now that we can report them. x0 = end of exception stack */ ENTRY(exception_init_asm) msr SPSel, #SPSR_USE_H mov sp, x0 msr SPSel, #SPSR_USE_L - adr x0, exc_vectors - msr vbar_el3, x0 - + msr CURRENT_EL(vbar), x0 msr DAIFClr, #0xf - dsb sy isb ret |