From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: Ingo Molnar <mingo@redhat.com>,
Namhyung Kim <namhyung@kernel.org>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 1/2] powerpc: kretprobes: override default function entry offset
Date: Thu, 16 Feb 2017 13:47:38 +0530 [thread overview]
Message-ID: <a3b56931746e2149b997c0565bf6a579cd286101.1487232416.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1487232416.git.naveen.n.rao@linux.vnet.ibm.com>
In-Reply-To: <cover.1487232416.git.naveen.n.rao@linux.vnet.ibm.com>
With ABIv2, we offset 8 bytes into a function to get at the local entry
point.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/kernel/kprobes.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index fce05a38851c..331751701fed 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -131,6 +131,15 @@ static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
kcb->kprobe_saved_msr = regs->msr;
}
+bool arch_function_offset_within_entry(unsigned long offset)
+{
+#ifdef PPC64_ELF_ABI_v2
+ return offset <= 8;
+#else
+ return !offset;
+#endif
+}
+
void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
struct pt_regs *regs)
{
--
2.11.0
next prev parent reply other threads:[~2017-02-16 8:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <dbb93084a6bc96d44cf7436ab6d5f9c8c72b6a39.1487181941.git.naveen.n.rao@linux.vnet.ibm.com>
2017-02-16 8:17 ` [PATCH 0/2] powerpc: kretprobe updates Naveen N. Rao
2017-02-16 8:17 ` Naveen N. Rao [this message]
2017-02-16 8:17 ` [PATCH 2/2] perf: powerpc: choose LEP with kretprobes Naveen N. Rao
2017-02-17 10:44 ` [PATCH 0/2] powerpc: kretprobe updates Masami Hiramatsu
2017-02-17 20:42 ` Arnaldo Carvalho de Melo
2017-02-17 20:50 ` PowerMac G5 Quad Strage lspci luigi burdo
2017-02-19 4:42 ` [PATCH 0/2] powerpc: kretprobe updates Masami Hiramatsu
2017-02-20 9:50 ` Naveen N. Rao
2017-02-21 13:07 ` Masami Hiramatsu
2017-02-22 13:39 ` Naveen N. Rao
2017-02-20 9:46 ` Naveen N. Rao
2017-02-20 11:43 ` Naveen N. Rao
2017-02-21 13:06 ` Masami Hiramatsu
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=a3b56931746e2149b997c0565bf6a579cd286101.1487232416.git.naveen.n.rao@linux.vnet.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=ananth@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=namhyung@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).