diff options
Diffstat (limited to 'arch/powerpc/kernel/kprobes.c')
-rw-r--r-- | arch/powerpc/kernel/kprobes.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index fc4343514bed..01addfb0ed0a 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c | |||
@@ -43,6 +43,12 @@ DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | |||
43 | 43 | ||
44 | struct kretprobe_blackpoint kretprobe_blacklist[] = {{NULL, NULL}}; | 44 | struct kretprobe_blackpoint kretprobe_blacklist[] = {{NULL, NULL}}; |
45 | 45 | ||
46 | int is_current_kprobe_addr(unsigned long addr) | ||
47 | { | ||
48 | struct kprobe *p = kprobe_running(); | ||
49 | return (p && (unsigned long)p->addr == addr) ? 1 : 0; | ||
50 | } | ||
51 | |||
46 | bool arch_within_kprobe_blacklist(unsigned long addr) | 52 | bool arch_within_kprobe_blacklist(unsigned long addr) |
47 | { | 53 | { |
48 | return (addr >= (unsigned long)__kprobes_text_start && | 54 | return (addr >= (unsigned long)__kprobes_text_start && |
@@ -617,6 +623,15 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | |||
617 | regs->gpr[2] = (unsigned long)(((func_descr_t *)jp->entry)->toc); | 623 | regs->gpr[2] = (unsigned long)(((func_descr_t *)jp->entry)->toc); |
618 | #endif | 624 | #endif |
619 | 625 | ||
626 | /* | ||
627 | * jprobes use jprobe_return() which skips the normal return | ||
628 | * path of the function, and this messes up the accounting of the | ||
629 | * function graph tracer. | ||
630 | * | ||
631 | * Pause function graph tracing while performing the jprobe function. | ||
632 | */ | ||
633 | pause_graph_tracing(); | ||
634 | |||
620 | return 1; | 635 | return 1; |
621 | } | 636 | } |
622 | NOKPROBE_SYMBOL(setjmp_pre_handler); | 637 | NOKPROBE_SYMBOL(setjmp_pre_handler); |
@@ -642,6 +657,8 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) | |||
642 | * saved regs... | 657 | * saved regs... |
643 | */ | 658 | */ |
644 | memcpy(regs, &kcb->jprobe_saved_regs, sizeof(struct pt_regs)); | 659 | memcpy(regs, &kcb->jprobe_saved_regs, sizeof(struct pt_regs)); |
660 | /* It's OK to start function graph tracing again */ | ||
661 | unpause_graph_tracing(); | ||
645 | preempt_enable_no_resched(); | 662 | preempt_enable_no_resched(); |
646 | return 1; | 663 | return 1; |
647 | } | 664 | } |