coreboot/payloads
Julius Werner 7fb0f14ebe libpayload: arm64: Fix asynchronous exception routing in payload
Six years ago we had a problem with not getting SError exceptions in
coreboot, and we fixed it by setting the right SCR_EL3 bits to force
exception routing to EL3 (commit bb345abbfc ("arm64: Correctly unmask
asynchronous SError interrupts")). Turns out that we have the same
problem in the payload but we never fixed it there. EL2 exception
routing works differently, so in order to achieve the same effect here
we can either enable the HCR_EL2 AMO, FMO and IMO bits (respectively),
or we can just enable the TGE bit which traps everything. This patch
chooses the latter, and it also ensures that the PSTATE exception
masking (DAIF) bits are in the expected state (although they usually
already are).

This state will persist after handoff to the kernel or chained payload,
and will prevent transition into EL1 if not cleared first. This should
be fine since any code taking control in EL2 should be expected to
correctly reintialize HCR_EL2 before handing off into EL1 (the Linux
kernel has always reinitialized this very early after its entry point).
If any selfboot() payloads are broken after this change, the payload
should be fixed to reinitialize HCR_EL2 to 0 (or desired value).

Change-Id: I339eded5a5344b5753c94be82e4f1e52e00b39f4
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90127
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Chen-Tsung Hsieh <chentsung@google.com>
2025-11-25 16:49:56 +00:00
..
coreinfo libpayload: Set reasonable arch defaults 2024-08-27 09:06:58 +00:00
external payloads/edk2: Add iPXE EFI support for EDK2 payload 2025-11-18 21:13:27 +00:00
libpayload libpayload: arm64: Fix asynchronous exception routing in payload 2025-11-25 16:49:56 +00:00
linuxcheck treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
nvramcui libpayload: Set reasonable arch defaults 2024-08-27 09:06:58 +00:00
Kconfig payloads/Kconfig: default to Skiboot payload on PPC64 2025-09-26 19:04:44 +00:00
Makefile.mk payloads: Add leanefi payload 2024-06-04 00:26:14 +00:00