Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33387 )
Change subject: mainboard/emulation/qemu-aarch64: Add new board for ARMv8 ......................................................................
Patch Set 35: Code-Review-1
(2 comments)
https://review.coreboot.org/c/coreboot/+/33387/33/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-aarch64/exception.c:
https://review.coreboot.org/c/coreboot/+/33387/33/src/mainboard/emulation/qe... PS33, Line 19: return EXC_RET_IGNORED;
Sorry, I'm still not sure what EXC_RET_HANDLED and EXC_RET_IGNORED are doing. […]
No, you should only have one exception handler. You cannot remove exception handlers, so you need to change the behavior of the one you have. So something like this:
static enum { ABORT_CHECKER_NOT_REGISTERED, ABORT_CHECKER_DEACTIVATED, ABORT_CHECKER_NOT_TRIGGERED, ABORT_CHECKER_TRIGGERED, } abort_state = ABORT_CHECKER_NOT_REGISTERED;
static int abort_checker(struct exc_state *state, uint64_t vector_id) { if (abort_state == ABORT_CHECKER_DEACTIVATED) return EXC_RET_IGNORED;
if (raw_read_esr_el3() >> 26 != 0x25) return EXC_RET_IGNORED; /* not a data abort */
abort_state = ABORT_CHECKER_TRIGGERED; state->elx.elr += sizeof(uint32_t); /* jump over faulting instruction */ raw_write_elr_el3(state->elx.elr); return EXC_RET_HANDLED; }
static int probe_mb(...) { [...]
if (ENV_ARM64) { read32((void *)addr); return abort_state == ABORT_CHECKER_NOT_TRIGGERED; }
[...] }
static int probe_ramsize(void) { if (ENV_ARM64) { if (abort_state == ABORT_CHECKER_NOT_REGISTERED) exception_handler_register(EXC_VID_CUR_SP_EL0_SERR); abort_state = ABORT_CHECKER_NOT_TRIGGERED; }
[...]
if (ENV_ARM64) abort_state = ABORT_CHECKER_DEACTIVATED; }
https://review.coreboot.org/c/coreboot/+/33387/35/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-aarch64/include/mainboard/exception.h:
https://review.coreboot.org/c/coreboot/+/33387/35/src/mainboard/emulation/qe... PS35, Line 1: /* If you're leaving the exception stuff for another patch then please remove this file.