Commit 9e367d85 authored by Michael Ellerman's avatar Michael Ellerman Committed by Linus Torvalds

jprobes: remove JPROBE_ENTRY()

AFAICT now that jprobe.entry is a void *, JPROBE_ENTRY doesn't do anything
useful - so remove it ..

I've left a do-nothing version so that out-of-tree jprobes code will still
compile without modifications.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Acked-by: default avatarAnanth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 81eae375
...@@ -247,12 +247,6 @@ control to Kprobes.) If the probed function is declared asmlinkage, ...@@ -247,12 +247,6 @@ control to Kprobes.) If the probed function is declared asmlinkage,
fastcall, or anything else that affects how args are passed, the fastcall, or anything else that affects how args are passed, the
handler's declaration must match. handler's declaration must match.
NOTE: A macro JPROBE_ENTRY is provided to handle architecture-specific
aliasing of jp->entry. In the interest of portability, it is advised
to use:
jp->entry = JPROBE_ENTRY(handler);
register_jprobe() returns 0 on success, or a negative errno otherwise. register_jprobe() returns 0 on success, or a negative errno otherwise.
4.3 register_kretprobe 4.3 register_kretprobe
...@@ -518,7 +512,7 @@ long jdo_fork(unsigned long clone_flags, unsigned long stack_start, ...@@ -518,7 +512,7 @@ long jdo_fork(unsigned long clone_flags, unsigned long stack_start,
} }
static struct jprobe my_jprobe = { static struct jprobe my_jprobe = {
.entry = JPROBE_ENTRY(jdo_fork) .entry = jdo_fork
}; };
static int __init jprobe_init(void) static int __init jprobe_init(void)
......
...@@ -42,7 +42,6 @@ typedef u8 kprobe_opcode_t; ...@@ -42,7 +42,6 @@ typedef u8 kprobe_opcode_t;
? (MAX_STACK_SIZE) \ ? (MAX_STACK_SIZE) \
: (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
#define ARCH_SUPPORTS_KRETPROBES #define ARCH_SUPPORTS_KRETPROBES
#define ARCH_INACTIVE_KPROBE_COUNT 0 #define ARCH_INACTIVE_KPROBE_COUNT 0
#define flush_insn_slot(p) do { } while (0) #define flush_insn_slot(p) do { } while (0)
......
...@@ -82,8 +82,6 @@ struct kprobe_ctlblk { ...@@ -82,8 +82,6 @@ struct kprobe_ctlblk {
struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ]; struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
}; };
#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
#define ARCH_SUPPORTS_KRETPROBES #define ARCH_SUPPORTS_KRETPROBES
#define ARCH_INACTIVE_KPROBE_COUNT 1 #define ARCH_INACTIVE_KPROBE_COUNT 1
......
...@@ -73,12 +73,10 @@ typedef unsigned int kprobe_opcode_t; ...@@ -73,12 +73,10 @@ typedef unsigned int kprobe_opcode_t;
} \ } \
} }
#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ #define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \
IS_TWI(instr) || IS_TDI(instr)) IS_TWI(instr) || IS_TDI(instr))
#else #else
/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */ /* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */
#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr)) #define is_trap(instr) (IS_TW(instr) || IS_TWI(instr))
#endif #endif
......
...@@ -46,8 +46,6 @@ typedef u16 kprobe_opcode_t; ...@@ -46,8 +46,6 @@ typedef u16 kprobe_opcode_t;
? (MAX_STACK_SIZE) \ ? (MAX_STACK_SIZE) \
: (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
#define ARCH_SUPPORTS_KRETPROBES #define ARCH_SUPPORTS_KRETPROBES
#define ARCH_INACTIVE_KPROBE_COUNT 0 #define ARCH_INACTIVE_KPROBE_COUNT 0
......
...@@ -10,7 +10,6 @@ typedef u32 kprobe_opcode_t; ...@@ -10,7 +10,6 @@ typedef u32 kprobe_opcode_t;
#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */ #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
#define MAX_INSN_SIZE 2 #define MAX_INSN_SIZE 2
#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
#define arch_remove_kprobe(p) do {} while (0) #define arch_remove_kprobe(p) do {} while (0)
#define ARCH_INACTIVE_KPROBE_COUNT 0 #define ARCH_INACTIVE_KPROBE_COUNT 0
......
...@@ -41,7 +41,6 @@ typedef u8 kprobe_opcode_t; ...@@ -41,7 +41,6 @@ typedef u8 kprobe_opcode_t;
? (MAX_STACK_SIZE) \ ? (MAX_STACK_SIZE) \
: (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
#define ARCH_SUPPORTS_KRETPROBES #define ARCH_SUPPORTS_KRETPROBES
#define ARCH_INACTIVE_KPROBE_COUNT 1 #define ARCH_INACTIVE_KPROBE_COUNT 1
......
...@@ -119,6 +119,9 @@ struct jprobe { ...@@ -119,6 +119,9 @@ struct jprobe {
void *entry; /* probe handling code to jump to */ void *entry; /* probe handling code to jump to */
}; };
/* For backward compatibility with old code using JPROBE_ENTRY() */
#define JPROBE_ENTRY(handler) (handler)
DECLARE_PER_CPU(struct kprobe *, current_kprobe); DECLARE_PER_CPU(struct kprobe *, current_kprobe);
DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
......
...@@ -112,7 +112,7 @@ static struct jprobe dccp_send_probe = { ...@@ -112,7 +112,7 @@ static struct jprobe dccp_send_probe = {
.kp = { .kp = {
.symbol_name = "dccp_sendmsg", .symbol_name = "dccp_sendmsg",
}, },
.entry = JPROBE_ENTRY(jdccp_sendmsg), .entry = jdccp_sendmsg,
}; };
static int dccpprobe_open(struct inode *inode, struct file *file) static int dccpprobe_open(struct inode *inode, struct file *file)
......
...@@ -130,7 +130,7 @@ static struct jprobe tcp_jprobe = { ...@@ -130,7 +130,7 @@ static struct jprobe tcp_jprobe = {
.kp = { .kp = {
.symbol_name = "tcp_rcv_established", .symbol_name = "tcp_rcv_established",
}, },
.entry = JPROBE_ENTRY(jtcp_rcv_established), .entry = jtcp_rcv_established,
}; };
static int tcpprobe_open(struct inode * inode, struct file * file) static int tcpprobe_open(struct inode * inode, struct file * file)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment