riscv: Heads up: If 7.1 hangs on boot near "vector unaligned word access speed"
Vivian Wang
wangruikang at iscas.ac.cn
Fri Jun 12 11:36:51 PDT 2026
Hi Linux 7.1 on riscv users,
If you get boot hangs and/or panics near where the kernel says:
cpuN: vector unaligned word access speed is 0.01x byte access speed (slow)
Possibly with additional messages such as these:
sbi_trap_error: hart1: trap1: load fault handler failed (error -3)
sbi_trap_error: hart1: trap1: store fault handler failed (error -3)
[ 0.252142] Oops - instruction access fault [#1]
You're likely running into a now exposed OpenSBI stack overrun bug in
misaligned vector access emulation.
As a quick fix, apply this patch to OpenSBI 1.7 or 1.8 to increase the
stack size:
https://lore.kernel.org/opensbi/edbce78c-71a7-41d7-aa81-3fa57241644a@iscas.ac.cn
What happened?
--------------
Commit b69bcb13ed70 ("riscv: misaligned: Make enabling delegation depend
on NONPORTABLE") made it so that the in-kernel misaligned access
emulation handler is disabled for now, since it is very
feature-incomplete and crashes KVM guests, and userspace and kernel
vector users.
However, this means that the firmware emulation is now in use, which
exposed this latent issue. It turns out the vector misaligned access
handler uses a 8192-byte stack buffer, whereas the entire per-hart stack
in OpenSBI defaults to 8192 bytes. This is a straightforward stack
overrun and either crashes OpenSBI or worse, causes it to misbehave and
creating further errors.
Currently, I believe it is the right thing to ask affected users to fix
their OpenSBI, since as far as I can find, no generally available
hardware ships with the affected OpenSBI versions (specifically, 1.7+
with stack size 8192), neither as factory default nor as separately
provided by the vendor. All possible cases I've been able to gather
affect either in-development platforms, or boards where the user has
replaced their firmware to have new OpenSBI (e.g. SpacemiT K1).
What do I do now?
-----------------
Apply that patch and replace your firmware's OpenSBI, probably the same
way you put it there in the first place. If you can't or don't know how,
please get in touch.
If it is convenient for you, I would appreciate if anyone who runs into
this can get in touch with me if you haven't done so. Feedback from
affected users on how to proceed is appreciated.
Also possible check out previous discussions:
- https://lore.kernel.org/linux-riscv/nrvt74qnojaubiwjo37ums4lnclu466hovwrhmtbag6f5uhrql@q6msoe2oto4b/T
- https://lore.kernel.org/opensbi/edbce78c-71a7-41d7-aa81-3fa57241644a@iscas.ac.cn/T
Furthermore, there is work in progress to make the vector misaligned
access handler not to use so much stack, thanks to Bo Gan:
- https://lore.kernel.org/opensbi/20260609060024.706-1-ganboing@gmail.com/
Thanks and with apologies,
Vivian "dramforever" Wang
More information about the linux-riscv
mailing list