aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/kprobes.c9
-rw-r--r--arch/powerpc/kernel/misc_32.S2
2 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index 23545a2f51f3..74693d91731f 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -95,6 +95,11 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
95 95
96static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 96static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
97{ 97{
98 /* We turn off async exceptions to ensure that the single step will
99 * be for the instruction we have the kprobe on, if we dont its
100 * possible we'd get the single step reported for an exception handler
101 * like Decrementer or External Interrupt */
102 regs->msr &= ~MSR_EE;
98 regs->msr |= MSR_SE; 103 regs->msr |= MSR_SE;
99 104
100 /* 105 /*
@@ -376,6 +381,10 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
376 if (!cur) 381 if (!cur)
377 return 0; 382 return 0;
378 383
384 /* make sure we got here for instruction we have a kprobe on */
385 if (((unsigned long)cur->ainsn.insn + 4) != regs->nip)
386 return 0;
387
379 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) { 388 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
380 kcb->kprobe_status = KPROBE_HIT_SSDONE; 389 kcb->kprobe_status = KPROBE_HIT_SSDONE;
381 cur->post_handler(cur, regs, 0); 390 cur->post_handler(cur, regs, 0);
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 89aaaa6f3561..6321ae36f729 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -489,7 +489,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_UNIFIED_ID_CACHE)
489 * 489 *
490 * flush_icache_range(unsigned long start, unsigned long stop) 490 * flush_icache_range(unsigned long start, unsigned long stop)
491 */ 491 */
492_GLOBAL(__flush_icache_range) 492_KPROBE(__flush_icache_range)
493BEGIN_FTR_SECTION 493BEGIN_FTR_SECTION
494 blr /* for 601, do nothing */ 494 blr /* for 601, do nothing */
495END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) 495END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)