riscv: blacklist assembly symbols for kprobe
authorClément Léger <cleger@rivosinc.com>
Wed, 4 Oct 2023 13:10:09 +0000 (15:10 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 24 Jan 2024 23:59:42 +0000 (15:59 -0800)
commit5014396af9bbac0f28d9afee7eae405206d01ee7
treed140198837a2056ff266ae5598715a24a284b7c2
parent7f43d57b900d7e221a73204239b74d4001193599
riscv: blacklist assembly symbols for kprobe

Adding kprobes on some assembly functions (mainly exception handling)
will result in crashes (either recursive trap or panic). To avoid such
errors, add ASM_NOKPROBE() macro which allow adding specific symbols
into the __kprobe_blacklist section and use to blacklist the following
symbols that showed to be problematic:
- handle_exception()
- ret_from_exception()
- handle_kernel_stack_overflow()

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231004131009.409193-1-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/asm.h
arch/riscv/kernel/entry.S