From df4a7a48e2b1ed431c99c157c891eeaf8517d64c Mon Sep 17 00:00:00 2001 From: He Sheng Date: Thu, 13 Oct 2022 10:59:27 +0800 Subject: [PATCH] sw64: handle kprobe breakpoint if CONFIG_KPROBES=y Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG -------------------------------- If CONFIG_KPROBES is not set, kprobe breakpoint instructions are treated as illegal instructions. Signed-off-by: He Sheng Reviewed-by: Cui Wei Signed-off-by: Gu Zitao --- arch/sw_64/kernel/traps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sw_64/kernel/traps.c b/arch/sw_64/kernel/traps.c index 9362fcd922c5..b26a0e369ed9 100644 --- a/arch/sw_64/kernel/traps.c +++ b/arch/sw_64/kernel/traps.c @@ -261,12 +261,14 @@ do_entIF(unsigned long inst_type, struct pt_regs *regs) case IF_OPDEC: switch (inst) { +#ifdef CONFIG_KPROBES case BREAK_KPROBE: if (notify_die(DIE_BREAK, "kprobe", regs, 0, 0, SIGTRAP) == NOTIFY_STOP) return; case BREAK_KPROBE_SS: if (notify_die(DIE_SSTEPBP, "single_step", regs, 0, 0, SIGTRAP) == NOTIFY_STOP) return; +#endif #ifdef CONFIG_UPROBES case UPROBE_BRK_UPROBE: if (notify_die(DIE_UPROBE, "uprobe", regs, 0, 0, SIGTRAP) == NOTIFY_STOP) -- GitLab