damien-lemoal / riscv64-nommu-buildroot

Other
42 stars 11 forks source link

"Oops - load address misaligned [#1]" error at boot with K210 #1

Closed laanwj closed 4 years ago

laanwj commented 4 years ago

I'm not entirely sure where to report this, this seems the most appropriate place: I'm trying to build a working Linux image for the Maix Go (K210) board. The image that they provide works, however when I build my own I get the following error after "Starting shell"

Oops - load address misaligned [#1]

EQ2CsOeXYAEC7jE

I looked up the address using addr2line and it is in side the kernel, tiocgwinsz copy_to_user. A 64-bit integer is being stored to an address that is only 32-bit aligned.

Normally these traps are handled by the SBI, and the memory access is emulated in software. However with the kernel running in M mode itself I'm not so sure what should be handling this. The kernel is 5.6-rc1 with these patches on top: https://lore.kernel.org/linux-riscv/20200212103432.660256-1-damien.lemoal@wdc.com/T/#t

laanwj commented 4 years ago

Whoops, it looks like I'm missing patch "* [PATCH 03/10] riscv: Unaligned load/store handling for M_MODE". That likely explains it.