mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Revert "kprobes: Warn if optprobe handler tries to change execution path"
Date: Tue, 17 Oct 2017 13:48:34 +0530	[thread overview]
Message-ID: <20171017081834.3629-1-naveen.n.rao@linux.vnet.ibm.com> (raw)

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, 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 <mpe@ellerman.id.au>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
Discussion here:
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1510995.html

 kernel/kprobes.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 2d28377a0e32..15fba7fe57c8 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();
 	}
-- 
2.14.2

             reply	other threads:[~2017-10-17  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17  8:18 Naveen N. Rao [this message]
2017-10-18 16:22 ` [tip:perf/core] " tip-bot for Naveen N. Rao
2017-10-19 21:38 ` [PATCH] " Masami Hiramatsu
2017-10-23 13:58   ` Naveen N. Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171017081834.3629-1-naveen.n.rao@linux.vnet.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®