mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org, ralf@linux-mips.org,
	ananth@in.ibm.com, anil.s.keshavamurthy@intel.com,
	davem@davemloft.net, masami.hiramatsu.pt@hitachi.com
Cc: linux-kernel@vger.kernel.org, hschauhan@nulltrace.org,
	David Daney <ddaney@caviumnetworks.com>
Subject: [PATCH] MIPS: KProbes: Use flush_insn_slot() where possible.
Date: Tue,  3 Aug 2010 14:00:45 -0700	[thread overview]
Message-ID: <1280869245-2786-1-git-send-email-ddaney@caviumnetworks.com> (raw)
In-Reply-To: <1280859742-26364-4-git-send-email-ddaney@caviumnetworks.com>

Signed-off-by: David Daney <ddaney@caviumnetworks.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


  reply	other threads:[~2010-08-03 21:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03 18:22 [PATCH 0/5] KProbes support for MIPS David Daney
2010-08-03 18:22 ` [PATCH 1/5] MIPS: Define regs_return_value() David Daney
2010-08-03 20:26   ` Ralf Baechle
2010-08-03 20:53     ` [PATCH] " David Daney
2010-08-04 23:46       ` Ralf Baechle
2010-08-03 18:22 ` [PATCH 2/5] MIPS: Add instrunction format for BREAK and SYSCALL David Daney
2010-08-03 20:54   ` Maciej W. Rozycki
2010-08-03 20:59     ` David Daney
2010-08-04 23:53   ` Ralf Baechle
2010-08-03 18:22 ` [PATCH 3/5] MIPS: Add KProbe support David Daney
2010-08-03 21:00   ` David Daney [this message]
2010-08-04 23:59     ` [PATCH] MIPS: KProbes: Use flush_insn_slot() where possible Ralf Baechle
2010-08-04 23:59   ` [PATCH 3/5] MIPS: Add KProbe support Ralf Baechle
2010-08-03 18:22 ` [PATCH 4/5] samples: kprobe_example: Make it print something on MIPS David Daney
2010-08-05  0:04   ` Ralf Baechle
2010-08-03 18:22 ` [PATCH 5/5] documentation: Mention that KProbes is supported " David Daney
2010-08-05  0:07   ` Ralf Baechle
2010-08-04  4:43 ` [PATCH 0/5] KProbes support for MIPS Ananth N Mavinakayanahalli

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=1280869245-2786-1-git-send-email-ddaney@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=ananth@in.ibm.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=davem@davemloft.net \
    --cc=hschauhan@nulltrace.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=ralf@linux-mips.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

all inboxes | Powered by JetHome®