summaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/kprobes.c
diff options
context:
space:
mode:
authorZhigang Lu <zlu@ezchip.com>2015-09-30 09:53:47 +0800
committerChris Metcalf <cmetcalf@ezchip.com>2016-01-04 15:09:31 -0500
commitf419e6f63c5afea00d7c17ebf54f2d265f5c4d7e (patch)
treec9c49f97a3a3abd0c55fce3f41fe71ef0125d3af /arch/tile/kernel/kprobes.c
parent9f9499ae8e6415cefc4fe0a96ad0e27864353c89 (diff)
downloadlinux-f419e6f63c5afea00d7c17ebf54f2d265f5c4d7e.tar.bz2
tile: define a macro ktext_writable_addr to get writable kernel text address
It is used by kgdb, ftrace, kprobe and jump label, so we factor this out into a helper routine. Reviewed-by: Chris Metcalf <cmetcalf@ezchip.com> Signed-off-by: Zhigang Lu <zlu@ezchip.com> Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
Diffstat (limited to 'arch/tile/kernel/kprobes.c')
-rw-r--r--arch/tile/kernel/kprobes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/tile/kernel/kprobes.c b/arch/tile/kernel/kprobes.c
index f8a45c51e9e4..c68694bb1ad2 100644
--- a/arch/tile/kernel/kprobes.c
+++ b/arch/tile/kernel/kprobes.c
@@ -116,7 +116,7 @@ void __kprobes arch_arm_kprobe(struct kprobe *p)
unsigned long addr_wr;
/* Operate on writable kernel text mapping. */
- addr_wr = (unsigned long)p->addr - MEM_SV_START + PAGE_OFFSET;
+ addr_wr = ktext_writable_addr(p->addr);
if (probe_kernel_write((void *)addr_wr, &breakpoint_insn,
sizeof(breakpoint_insn)))
@@ -131,7 +131,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *kp)
unsigned long addr_wr;
/* Operate on writable kernel text mapping. */
- addr_wr = (unsigned long)kp->addr - MEM_SV_START + PAGE_OFFSET;
+ addr_wr = ktext_writable_addr(kp->addr);
if (probe_kernel_write((void *)addr_wr, &kp->opcode,
sizeof(kp->opcode)))