aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/kernel/kprobes.c12
-rw-r--r--include/asm-ia64/kprobes.h4
2 files changed, 11 insertions, 5 deletions
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 4f5fd0960ba7..72e593e94053 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -370,14 +370,18 @@ static int __kprobes valid_kprobe_addr(int template, int slot,
370 370
371static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) 371static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
372{ 372{
373 kcb->prev_kprobe.kp = kprobe_running(); 373 unsigned int i;
374 kcb->prev_kprobe.status = kcb->kprobe_status; 374 i = atomic_add_return(1, &kcb->prev_kprobe_index);
375 kcb->prev_kprobe[i-1].kp = kprobe_running();
376 kcb->prev_kprobe[i-1].status = kcb->kprobe_status;
375} 377}
376 378
377static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) 379static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
378{ 380{
379 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; 381 unsigned int i;
380 kcb->kprobe_status = kcb->prev_kprobe.status; 382 i = atomic_sub_return(1, &kcb->prev_kprobe_index);
383 __get_cpu_var(current_kprobe) = kcb->prev_kprobe[i].kp;
384 kcb->kprobe_status = kcb->prev_kprobe[i].status;
381} 385}
382 386
383static void __kprobes set_current_kprobe(struct kprobe *p, 387static void __kprobes set_current_kprobe(struct kprobe *p,
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 828ae00e47c1..2abc98b336f3 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -71,13 +71,15 @@ struct prev_kprobe {
71 71
72#define MAX_PARAM_RSE_SIZE (0x60+0x60/0x3f) 72#define MAX_PARAM_RSE_SIZE (0x60+0x60/0x3f)
73/* per-cpu kprobe control block */ 73/* per-cpu kprobe control block */
74#define ARCH_PREV_KPROBE_SZ 2
74struct kprobe_ctlblk { 75struct kprobe_ctlblk {
75 unsigned long kprobe_status; 76 unsigned long kprobe_status;
76 struct pt_regs jprobe_saved_regs; 77 struct pt_regs jprobe_saved_regs;
77 unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE]; 78 unsigned long jprobes_saved_stacked_regs[MAX_PARAM_RSE_SIZE];
78 unsigned long *bsp; 79 unsigned long *bsp;
79 unsigned long cfm; 80 unsigned long cfm;
80 struct prev_kprobe prev_kprobe; 81 atomic_t prev_kprobe_index;
82 struct prev_kprobe prev_kprobe[ARCH_PREV_KPROBE_SZ];
81}; 83};
82 84
83#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 85#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry