提交 07fab8da 编写于 作者: P Prasanna S Panchamukhi 提交者: Linus Torvalds

[PATCH] Switch Kprobes inline functions to __kprobes for sparc64

Andrew Morton pointed out that compiler might not inline the functions
marked for inline in kprobes.  There-by allowing the insertion of probes
on these kprobes routines, which might cause recursion.

This patch removes all such inline and adds them to kprobes section
there by disallowing probes on all such routines.  Some of the routines
can even still be inlined, since these routines gets executed after the
kprobes had done necessay setup for reentrancy.
Signed-off-by: NPrasanna S Panchamukhi <prasanna@in.ibm.com>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3ca269d8
...@@ -63,7 +63,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p) ...@@ -63,7 +63,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
flushi(p->addr); flushi(p->addr);
} }
static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
{ {
kcb->prev_kprobe.kp = kprobe_running(); kcb->prev_kprobe.kp = kprobe_running();
kcb->prev_kprobe.status = kcb->kprobe_status; kcb->prev_kprobe.status = kcb->kprobe_status;
...@@ -71,7 +71,7 @@ static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) ...@@ -71,7 +71,7 @@ static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb)
kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil; kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil;
} }
static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
{ {
__get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp;
kcb->kprobe_status = kcb->prev_kprobe.status; kcb->kprobe_status = kcb->prev_kprobe.status;
...@@ -79,7 +79,7 @@ static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) ...@@ -79,7 +79,7 @@ static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb)
kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil; kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil;
} }
static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb) struct kprobe_ctlblk *kcb)
{ {
__get_cpu_var(current_kprobe) = p; __get_cpu_var(current_kprobe) = p;
...@@ -87,7 +87,7 @@ static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, ...@@ -87,7 +87,7 @@ static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL);
} }
static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs, static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb) struct kprobe_ctlblk *kcb)
{ {
regs->tstate |= TSTATE_PIL; regs->tstate |= TSTATE_PIL;
...@@ -273,7 +273,7 @@ static void __kprobes resume_execution(struct kprobe *p, ...@@ -273,7 +273,7 @@ static void __kprobes resume_execution(struct kprobe *p,
kcb->kprobe_orig_tstate_pil); kcb->kprobe_orig_tstate_pil);
} }
static inline int post_kprobe_handler(struct pt_regs *regs) static int __kprobes post_kprobe_handler(struct pt_regs *regs)
{ {
struct kprobe *cur = kprobe_running(); struct kprobe *cur = kprobe_running();
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
...@@ -300,7 +300,7 @@ static inline int post_kprobe_handler(struct pt_regs *regs) ...@@ -300,7 +300,7 @@ static inline int post_kprobe_handler(struct pt_regs *regs)
return 1; return 1;
} }
static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
{ {
struct kprobe *cur = kprobe_running(); struct kprobe *cur = kprobe_running();
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册