[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1280869245-2786-1-git-send-email-ddaney@caviumnetworks.com>
Date: Tue, 3 Aug 2010 14:00:45 -0700
From: David Daney <ddaney@...iumnetworks.com>
To: linux-mips@...ux-mips.org, ralf@...ux-mips.org, ananth@...ibm.com,
anil.s.keshavamurthy@...el.com, davem@...emloft.net,
masami.hiramatsu.pt@...achi.com
Cc: linux-kernel@...r.kernel.org, hschauhan@...ltrace.org,
David Daney <ddaney@...iumnetworks.com>
Subject: [PATCH] MIPS: KProbes: Use flush_insn_slot() where possible.
Signed-off-by: David Daney <ddaney@...iumnetworks.com>
---
This is a small cleanup that could either be folded into the original
3/5 or applied in addition to it.
arch/mips/include/asm/kprobes.h | 1 +
arch/mips/kernel/kprobes.c | 11 +++--------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/mips/include/asm/kprobes.h b/arch/mips/include/asm/kprobes.h
index fe58e08..e6ea4d4 100644
--- a/arch/mips/include/asm/kprobes.h
+++ b/arch/mips/include/asm/kprobes.h
@@ -25,6 +25,7 @@
#include <linux/ptrace.h>
#include <linux/types.h>
+#include <asm/cacheflush.h>
#include <asm/kdebug.h>
#include <asm/inst.h>
diff --git a/arch/mips/kernel/kprobes.c b/arch/mips/kernel/kprobes.c
index a74ccd2..ee28683 100644
--- a/arch/mips/kernel/kprobes.c
+++ b/arch/mips/kernel/kprobes.c
@@ -28,7 +28,6 @@
#include <linux/kdebug.h>
#include <linux/slab.h>
-#include <asm/cacheflush.h>
#include <asm/ptrace.h>
#include <asm/break.h>
#include <asm/inst.h>
@@ -151,18 +150,14 @@ out:
void __kprobes arch_arm_kprobe(struct kprobe *p)
{
- *(p->addr) = breakpoint_insn;
- flush_icache_range((unsigned long)p->addr,
- (unsigned long)p->addr +
- (MAX_INSN_SIZE * sizeof(kprobe_opcode_t)));
+ *p->addr = breakpoint_insn;
+ flush_insn_slot(p);
}
void __kprobes arch_disarm_kprobe(struct kprobe *p)
{
*p->addr = p->opcode;
- flush_icache_range((unsigned long)p->addr,
- (unsigned long)p->addr +
- (MAX_INSN_SIZE * sizeof(kprobe_opcode_t)));
+ flush_insn_slot(p);
}
void __kprobes arch_remove_kprobe(struct kprobe *p)
--
1.7.1.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists