riscv: report misaligned accesses emulation to hwprobe
authorClément Léger <cleger@rivosinc.com>
Wed, 4 Oct 2023 15:14:04 +0000 (17:14 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 1 Nov 2023 15:34:58 +0000 (08:34 -0700)
commit71c54b3d169db5569655cbd2a3616bc701fd5eec
treede1ee9896df1b6c8372e235d9119cc4c2fd8d077
parent90b11b470b2e88ff583e04be109e6441cb69f54d
riscv: report misaligned accesses emulation to hwprobe

hwprobe provides a way to report if misaligned access are emulated. In
order to correctly populate that feature, we can check if it actually
traps when doing a misaligned access. This can be checked using an
exception table entry which will actually be used when a misaligned
access is done from kernel mode.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20231004151405.521596-8-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/cpufeature.h
arch/riscv/kernel/cpufeature.c
arch/riscv/kernel/smpboot.c
arch/riscv/kernel/traps_misaligned.c