From: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
To: ananth@in.ibm.com, akpm@osdl.org, paulmck@us.ibm.com
Cc: linux-kernel@vger.kernel.org, systemtap@sources.redhat.com,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Subject: [patch 1/4] Kprobes - Enable funcions only for required arch
Date: Tue, 13 Dec 2005 12:35:48 -0800 [thread overview]
Message-ID: <20051213203900.908870934@csdlinux-2.jf.intel.com> (raw)
In-Reply-To: 20051213203547.649087523@csdlinux-2.jf.intel.com
[-- Attachment #1: cleanup_inst_slot.patch --]
[-- Type: text/plain, Size: 2394 bytes --]
[PATCH] Kprobes - Enable funcions only for required arch
Kernel/kprobes.c defines get_insn_slot() and free_insn_slot()
which are currently required _only_ for x86_64 and powerpc (which has
no-exec support).
FYI, get{free}_insn_slot() functions manages the memory
page which is mapped as executable, required for instruction
emulation.
This patch moves those two functions under
__ARCH_WANT_KPROBES_INSN_SLOT and defines
__ARCH_WANT_KPROBES_INSN_SLOT in arch specific
kprobes.h file.
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
------------------------------------------------------------------
include/asm-powerpc/kprobes.h | 2 ++
include/asm-x86_64/kprobes.h | 2 ++
kernel/kprobes.c | 2 ++
3 files changed, 6 insertions(+)
Index: linux-2.6.15-rc5-mm2/include/asm-powerpc/kprobes.h
===================================================================
--- linux-2.6.15-rc5-mm2.orig/include/asm-powerpc/kprobes.h
+++ linux-2.6.15-rc5-mm2/include/asm-powerpc/kprobes.h
@@ -29,6 +29,8 @@
#include <linux/ptrace.h>
#include <linux/percpu.h>
+#define __ARCH_WANT_KPROBES_INSN_SLOT
+
struct pt_regs;
typedef unsigned int kprobe_opcode_t;
Index: linux-2.6.15-rc5-mm2/include/asm-x86_64/kprobes.h
===================================================================
--- linux-2.6.15-rc5-mm2.orig/include/asm-x86_64/kprobes.h
+++ linux-2.6.15-rc5-mm2/include/asm-x86_64/kprobes.h
@@ -27,6 +27,8 @@
#include <linux/ptrace.h>
#include <linux/percpu.h>
+#define __ARCH_WANT_KPROBES_INSN_SLOT
+
struct pt_regs;
typedef u8 kprobe_opcode_t;
Index: linux-2.6.15-rc5-mm2/kernel/kprobes.c
===================================================================
--- linux-2.6.15-rc5-mm2.orig/kernel/kprobes.c
+++ linux-2.6.15-rc5-mm2/kernel/kprobes.c
@@ -52,6 +52,7 @@ static DEFINE_SPINLOCK(kprobe_lock); /*
DEFINE_SPINLOCK(kretprobe_lock); /* Protects kretprobe_inst_table */
static DEFINE_PER_CPU(struct kprobe *, kprobe_instance) = NULL;
+#ifdef __ARCH_WANT_KPROBES_INSN_SLOT
/*
* kprobe->ainsn.insn points to the copy of the instruction to be
* single-stepped. x86_64, POWER4 and above have no-exec support and
@@ -151,6 +152,7 @@ void __kprobes free_insn_slot(kprobe_opc
}
}
}
+#endif
/* We have preemption disabled.. so it is safe to use __ versions */
static inline void set_kprobe_instance(struct kprobe *kp)
--
next prev parent reply other threads:[~2005-12-13 21:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-13 20:35 [patch 0/4] Kprobes cleanup patches Anil S Keshavamurthy
2005-12-13 20:35 ` Anil S Keshavamurthy [this message]
2005-12-13 20:35 ` [patch 2/4] Kprobes - cleanup include_asm_kprobes_h Anil S Keshavamurthy
2005-12-13 20:35 ` [patch 3/4] Kprobes - Changed from using spinlock to mutext Anil S Keshavamurthy
2005-12-14 23:50 ` Keshavamurthy Anil S
2005-12-13 20:35 ` [patch 4/4] Kprobes Cleanup arch_remove_kprobe Anil S Keshavamurthy
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=20051213203900.908870934@csdlinux-2.jf.intel.com \
--to=anil.s.keshavamurthy@intel.com \
--cc=akpm@osdl.org \
--cc=ananth@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@us.ibm.com \
--cc=systemtap@sources.redhat.com \
/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