From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masami Hiramatsu Subject: [RFC PATCH -tip v5 22/27] sh: kprobes: Don't call the ->break_handler() in SH kprobes code Date: Tue, 5 Jun 2018 00:59:10 +0900 Message-ID: <152812795011.10068.14489215679738766582.stgit@devbox> References: <152812730943.10068.5166429445118734697.stgit@devbox> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <152812730943.10068.5166429445118734697.stgit@devbox> Sender: linux-kernel-owner@vger.kernel.org To: Thomas Gleixner , Ingo Molnar Cc: Masami Hiramatsu , Ingo Molnar , "H . Peter Anvin" , linux-kernel@vger.kernel.org, Ananth N Mavinakayanahalli , Andrew Morton , Steven Rostedt , linux-arch@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org List-Id: linux-arch.vger.kernel.org Don't call the ->break_handler() from the SH kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- arch/sh/kernel/kprobes.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/arch/sh/kernel/kprobes.c b/arch/sh/kernel/kprobes.c index 2b5e58873b96..4fafe0cd12c6 100644 --- a/arch/sh/kernel/kprobes.c +++ b/arch/sh/kernel/kprobes.c @@ -248,11 +248,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) prepare_singlestep(p, regs); kcb->kprobe_status = KPROBE_REENTER; return 1; - } else { - p = __this_cpu_read(current_kprobe); - if (p->break_handler && p->break_handler(p, regs)) { - goto ss_probe; - } } goto no_kprobe; } @@ -281,7 +276,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) /* handler has already set things up, so skip ss setup */ return 1; -ss_probe: prepare_singlestep(p, regs); kcb->kprobe_status = KPROBE_HIT_SS; return 1; @@ -508,14 +502,8 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, if (post_kprobe_handler(args->regs)) ret = NOTIFY_STOP; } else { - if (kprobe_handler(args->regs)) { + if (kprobe_handler(args->regs)) ret = NOTIFY_STOP; - } else { - p = __this_cpu_read(current_kprobe); - if (p->break_handler && - p->break_handler(p, args->regs)) - ret = NOTIFY_STOP; - } } } } From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:59342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbeFDP7e (ORCPT ); Mon, 4 Jun 2018 11:59:34 -0400 From: Masami Hiramatsu Subject: [RFC PATCH -tip v5 22/27] sh: kprobes: Don't call the ->break_handler() in SH kprobes code Date: Tue, 5 Jun 2018 00:59:10 +0900 Message-ID: <152812795011.10068.14489215679738766582.stgit@devbox> In-Reply-To: <152812730943.10068.5166429445118734697.stgit@devbox> References: <152812730943.10068.5166429445118734697.stgit@devbox> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Thomas Gleixner , Ingo Molnar Cc: Masami Hiramatsu , Ingo Molnar , "H . Peter Anvin" , linux-kernel@vger.kernel.org, Ananth N Mavinakayanahalli , Andrew Morton , Steven Rostedt , linux-arch@vger.kernel.org, Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Message-ID: <20180604155910.-4bybeImoQxJl7LBwyGusS5SGt1E5DY8XYSRO9chC9U@z> Don't call the ->break_handler() from the SH kprobes code, because it was only used by jprobes which got removed. Signed-off-by: Masami Hiramatsu Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- arch/sh/kernel/kprobes.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/arch/sh/kernel/kprobes.c b/arch/sh/kernel/kprobes.c index 2b5e58873b96..4fafe0cd12c6 100644 --- a/arch/sh/kernel/kprobes.c +++ b/arch/sh/kernel/kprobes.c @@ -248,11 +248,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) prepare_singlestep(p, regs); kcb->kprobe_status = KPROBE_REENTER; return 1; - } else { - p = __this_cpu_read(current_kprobe); - if (p->break_handler && p->break_handler(p, regs)) { - goto ss_probe; - } } goto no_kprobe; } @@ -281,7 +276,6 @@ static int __kprobes kprobe_handler(struct pt_regs *regs) /* handler has already set things up, so skip ss setup */ return 1; -ss_probe: prepare_singlestep(p, regs); kcb->kprobe_status = KPROBE_HIT_SS; return 1; @@ -508,14 +502,8 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self, if (post_kprobe_handler(args->regs)) ret = NOTIFY_STOP; } else { - if (kprobe_handler(args->regs)) { + if (kprobe_handler(args->regs)) ret = NOTIFY_STOP; - } else { - p = __this_cpu_read(current_kprobe); - if (p->break_handler && - p->break_handler(p, args->regs)) - ret = NOTIFY_STOP; - } } } }