]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: add hardware error trap handler support
authorRui Qi <qirui.001@bytedance.com>
Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)
committerPaul Walmsley <pjw@kernel.org>
Sun, 5 Apr 2026 00:42:44 +0000 (18:42 -0600)
commit5d5c5d0f2be9cf0351ad8e90516c519a8db22981
tree65da21f3c7d6a23dba79debd4d03948a89be3b44
parent580e626dd0304b4cafb2a5d21c6f0401b44f0ffb
riscv: add hardware error trap handler support

Add support for handling hardware error traps (exception code 19)
in the RISC-V architecture. The changes include:

- Add do_trap_hardware_error function declaration in asm-prototypes.h
- Add hardware error trap vector entry in entry.S exception vector table
- Implement do_trap_hardware_error handler in traps.c that generates
  SIGBUS with BUS_MCEERR_AR for hardware errors

This enables proper handling of hardware error exceptions that may occur
in RISC-V systems, providing appropriate error reporting and signal
generation for user space processes.

Signed-off-by: Rui Qi <qirui.001@bytedance.com>
Link: https://patch.msgid.link/20260202094200.53735-1-qirui.001@bytedance.com
[pjw@kernel.org: clean up commit message slightly]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/asm/asm-prototypes.h
arch/riscv/kernel/entry.S
arch/riscv/kernel/traps.c