Merge branch 'delete-mca' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg...
[pandora-kernel.git] / arch / x86 / kernel / traps.c
index 4754f51..ff08457 100644 (file)
@@ -46,6 +46,7 @@
 #include <asm/processor.h>
 #include <asm/debugreg.h>
 #include <linux/atomic.h>
+#include <asm/ftrace.h>
 #include <asm/traps.h>
 #include <asm/desc.h>
 #include <asm/i387.h>
@@ -299,8 +300,13 @@ gp_in_kernel:
 }
 
 /* May run on IST stack. */
-dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code)
+dotraplinkage void __kprobes notrace do_int3(struct pt_regs *regs, long error_code)
 {
+#ifdef CONFIG_DYNAMIC_FTRACE
+       /* ftrace must be first, everything else may cause a recursive crash */
+       if (unlikely(modifying_ftrace_code) && ftrace_int3_handler(regs))
+               return;
+#endif
 #ifdef CONFIG_KGDB_LOW_LEVEL_TRAP
        if (kgdb_ll_trap(DIE_INT3, "int3", regs, error_code, X86_TRAP_BP,
                                SIGTRAP) == NOTIFY_STOP)