From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751936AbdJRQ1Q (ORCPT ); Wed, 18 Oct 2017 12:27:16 -0400 Received: from terminus.zytor.com ([65.50.211.136]:49659 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751904AbdJRQ1O (ORCPT ); Wed, 18 Oct 2017 12:27:14 -0400 Date: Wed, 18 Oct 2017 09:22:40 -0700 From: "tip-bot for Naveen N. Rao" Message-ID: Cc: torvalds@linux-foundation.org, mingo@kernel.org, peterz@infradead.org, hpa@zytor.com, mpe@ellerman.id.au, tglx@linutronix.de, mhiramat@kernel.org, linux-kernel@vger.kernel.org, ananth@linux.vnet.ibm.com, naveen.n.rao@linux.vnet.ibm.com Reply-To: tglx@linutronix.de, mhiramat@kernel.org, linux-kernel@vger.kernel.org, ananth@linux.vnet.ibm.com, naveen.n.rao@linux.vnet.ibm.com, torvalds@linux-foundation.org, mingo@kernel.org, mpe@ellerman.id.au, hpa@zytor.com, peterz@infradead.org In-Reply-To: <20171017081834.3629-1-naveen.n.rao@linux.vnet.ibm.com> References: <20171017081834.3629-1-naveen.n.rao@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] Revert "kprobes: Warn if optprobe handler tries to change execution path" Git-Commit-ID: 4f3a871443669c6b4d458a60ac8d8ca5eedc3f97 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4f3a871443669c6b4d458a60ac8d8ca5eedc3f97 Gitweb: https://git.kernel.org/tip/4f3a871443669c6b4d458a60ac8d8ca5eedc3f97 Author: Naveen N. Rao AuthorDate: Tue, 17 Oct 2017 13:48:34 +0530 Committer: Ingo Molnar CommitDate: Wed, 18 Oct 2017 15:21:35 +0200 Revert "kprobes: Warn if optprobe handler tries to change execution path" This reverts commit: e863d539614641 ("kprobes: Warn if optprobe handler tries to change execution path") On PowerPC, we place a probe at kretprobe_trampoline to catch function returns and with CONFIG_OPTPROBES=y, this probe gets optimized. This works for us due to the way we handle the optprobe as described in commit: 762df10bad6954 ("powerpc/kprobes: Optimize kprobe in kretprobe_trampoline()") With the above commit, we end up with a warning. As such, revert this change. Reported-by: Michael Ellerman Signed-off-by: Naveen N. Rao Cc: Ananth N Mavinakayanahalli Cc: Linus Torvalds Cc: Masami Hiramatsu Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20171017081834.3629-1-naveen.n.rao@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- kernel/kprobes.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 2d28377..15fba7f 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -387,10 +387,7 @@ void opt_pre_handler(struct kprobe *p, struct pt_regs *regs) list_for_each_entry_rcu(kp, &p->list, list) { if (kp->pre_handler && likely(!kprobe_disabled(kp))) { set_kprobe_instance(kp); - if (kp->pre_handler(kp, regs)) { - if (WARN_ON_ONCE(1)) - pr_err("Optprobe ignores instruction pointer changing.(%pF)\n", p->addr); - } + kp->pre_handler(kp, regs); } reset_kprobe_instance(); }