]> Pileus Git - ~andy/linux/blobdiff - arch/sparc/kernel/kprobes.c
Merge tag 'fixes-for-3.13a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
[~andy/linux] / arch / sparc / kernel / kprobes.c
index e72212148d2a9e08dfe680f8500186b263a721f1..1b0973503197508404967e8bb0ed58cc934b982e 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/module.h>
 #include <linux/kdebug.h>
 #include <linux/slab.h>
+#include <linux/context_tracking.h>
 #include <asm/signal.h>
 #include <asm/cacheflush.h>
 #include <asm/uaccess.h>
@@ -349,7 +350,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
        case KPROBE_HIT_SSDONE:
                /*
                 * We increment the nmissed count for accounting,
-                * we can also use npre/npostfault count for accouting
+                * we can also use npre/npostfault count for accounting
                 * these specific fault cases.
                 */
                kprobes_inc_nmissed_count(cur);
@@ -418,12 +419,14 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
 asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
                                      struct pt_regs *regs)
 {
+       enum ctx_state prev_state = exception_enter();
+
        BUG_ON(trap_level != 0x170 && trap_level != 0x171);
 
        if (user_mode(regs)) {
                local_irq_enable();
                bad_trap(regs, trap_level);
-               return;
+               goto out;
        }
 
        /* trap_level == 0x170 --> ta 0x70
@@ -433,6 +436,8 @@ asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
                       (trap_level == 0x170) ? "debug" : "debug_2",
                       regs, 0, trap_level, SIGTRAP) != NOTIFY_STOP)
                bad_trap(regs, trap_level);
+out:
+       exception_exit(prev_state);
 }
 
 /* Jprobes support.  */