summaryrefslogtreecommitdiff
path: root/src/arch/riscv/include
diff options
context:
space:
mode:
authorRonald G Minnich <rminnich@gmail.com>2024-03-21 14:04:58 -0700
committerron minnich <rminnich@gmail.com>2024-03-27 14:45:06 +0000
commit3ee97e47a6b814df58584031c8412ae1960360b9 (patch)
tree986621842bcdcc4ed66511569367f0b9a5c5da9e /src/arch/riscv/include
parent559ca8b5fbf2f484925f3e37c8acc4149532e69b (diff)
arch/riscv: remove misaligned load/store/fetch handling
Testing on the unmatched shows the code no longer works completely correctly; Linux has taken over the handling of misalignment anyway, because handling it in firmware, with the growing complexity of the ISA and the awkward way in which it has to be handled, is more trouble than its worth. Plus, we don't WANT misalignment handled, magically, in firmware: the cost of getting it wrong is high (as I've spent a month learning); the performance is terrible (350x slowdown; and most toolchains now know to avoid unaligned load/store on RISC-V anyway. But, mostly, if alignment problems exist, *we need to know*, and if they're handled invisibly in firmware, we don't. The problem with invisible handling was shown a while back in the Go toolchain: runtime had a small error, such that many misaligned load/store were happening, and it was not discovered for some time. Had a trap been directed to kernel or user on misalignment, the problem would have been known immediately, not after many months. (The error, btw, was masking the address with 3, not 7, to detect misalignment; an easy mistake!). But, the coreboot code does not work any more any way, and it's not worth fixing. Remove it. Tested by booting Linux to runlevel 1; before, it would hang on an alignment fault, as the alignment code was failing (somewhere). This takes the coreboot SBI code much closer to revival. Change-Id: I84a8d433ed2f50745686a8c109d101e8718f2a46 Signed-off-by: Ronald G Minnich <rminnich@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81416 Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch/riscv/include')
-rw-r--r--src/arch/riscv/include/arch/exception.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/arch/riscv/include/arch/exception.h b/src/arch/riscv/include/arch/exception.h
index e807a3f3c8..2eb575e608 100644
--- a/src/arch/riscv/include/arch/exception.h
+++ b/src/arch/riscv/include/arch/exception.h
@@ -28,6 +28,5 @@ static inline void exception_init(void)
void redirect_trap(void);
void default_trap_handler(struct trapframe *tf);
void handle_supervisor_call(struct trapframe *tf);
-void handle_misaligned(struct trapframe *tf);
#endif