aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2021-08-19 18:37:28 +0100
committerMark Rutland <mark.rutland@arm.com>2021-08-25 10:48:16 +0100
commit776291ee8ee4f62215867f663fb34e1fef13289e (patch)
tree0f96f9eff02cddd4173180c636f9e64b3996a94e
parent325f6ccc9be91137630cbcad988be82473ab0eeb (diff)
downloadboot-wrapper-aarch64-776291ee8ee4f62215867f663fb34e1fef13289e.tar.gz
aarch32: simplify _switch_monitor
If we're lucky enough to have been booted into secure PL1, we can switch to monitor mode with an exception return rather than an SMC call, which avoids the need for boot-time vectors. Note that while all Secure PL1 register state is accessible in Secure SVC mode, we must switch to Monitor mode before we set SCR.NS=1. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Marc Zyngier <maz@kernel.org>
-rw-r--r--arch/aarch32/boot.S19
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/aarch32/boot.S b/arch/aarch32/boot.S
index 82927de..e397cb0 100644
--- a/arch/aarch32/boot.S
+++ b/arch/aarch32/boot.S
@@ -37,9 +37,10 @@ ASM_FUNC(_start)
b start_no_el3
_switch_monitor:
- ldr r0, =boot_vectors
- bl setup_vector
- smc #0
+ adr lr, _monitor
+ ldr r0, =(PSR_A | PSR_I | PSR_F | PSR_MON)
+ msr spsr, r0
+ movs pc, lr
_monitor:
/* Move the stack to Monitor mode*/
@@ -102,18 +103,6 @@ ASM_FUNC(jump_kernel)
msr spsr_cxf, r4
movs pc, lr
- .section .vectors
- .align 6
-boot_vectors:
- b .
- b .
- b _monitor
- b .
- b .
- b .
- b .
- b .
-
.section .data
.align 2
flag_no_el3: