summaryrefslogtreecommitdiff
path: root/src/arch/arm64/boot.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2018-08-03 17:14:45 -0700
committerJulius Werner <jwerner@chromium.org>2018-08-10 04:16:25 +0000
commit0c5f61a01c3ebaa1c19f9a20d20d4b1353648d7c (patch)
treeb200a6be0cbc43adfd25d6778afce750ae81739c /src/arch/arm64/boot.c
parent73be9dd82c033a9bce3fc7ff11dab453e9cfde82 (diff)
arm64: Drop checks for current exception level, hardcode EL3 assumption
When we first created the arm64 port, we weren't quite sure whether coreboot would always run in EL3 on all platforms. The AArch64 A.R.M. technically considers this exception level optional, but in practice all SoCs seem to support it. We have since accumulated a lot of code that already hardcodes an implicit or explicit assumption of executing in EL3 somewhere, so coreboot wouldn't work on a system that tries to enter it in EL1/2 right now anyway. However, some of our low level support libraries (in particular those for accessing architectural registers) still have provisions for running at different exception levels built-in, and often use switch statements over the current exception level to decide which register to access. This includes an unnecessarily large amount of code for what should be single-instruction operations and precludes further optimization via inlining. This patch removes any remaining code that dynamically depends on the current exception level and makes the assumption that coreboot executes at EL3 official. If this ever needs to change for a future platform, it would probably be cleaner to set the expected exception level in a Kconfig rather than always probing it at runtime. Change-Id: I1a9fb9b4227bd15a013080d1c7eabd48515fdb67 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/27880 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/arch/arm64/boot.c')
-rw-r--r--src/arch/arm64/boot.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c
index 5fd46a7ebd..95c51d3842 100644
--- a/src/arch/arm64/boot.c
+++ b/src/arch/arm64/boot.c
@@ -36,23 +36,8 @@ static void run_payload(struct prog *prog)
if (IS_ENABLED(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE))
arm_tf_run_bl31((u64)doit, (u64)arg, payload_spsr);
- else {
- uint8_t current_el = get_current_el();
-
- printk(BIOS_SPEW, "entry = %p\n", doit);
-
- /* If current EL is not EL3, jump to payload at same EL. */
- if (current_el != EL3)
- doit(arg);
- else {
- /* If current EL is EL3, we transition to payload in EL2. */
- struct exc_state exc_state;
- memset(&exc_state, 0, sizeof(exc_state));
- exc_state.elx.spsr = payload_spsr;
-
- transition_with_entry(doit, arg, &exc_state);
- }
- }
+ else
+ transition_to_el2(doit, arg, payload_spsr);
}
void arch_prog_run(struct prog *prog)