]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/kprobes_64.c
Merge branch 'xen-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
[linux-2.6] / arch / x86 / kernel / kprobes_64.c
index 1df17a0ec0c9d7ddca19df029d6fca8818b68090..681b801c5e26bf7be2a09c24134f590381214258 100644 (file)
@@ -48,6 +48,13 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p);
 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
 DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
 
+struct kretprobe_blackpoint kretprobe_blacklist[] = {
+       {"__switch_to", }, /* This function switches only current task, but
+                             doesn't switch kernel stack.*/
+       {NULL, NULL}    /* Terminator */
+};
+const int kretprobe_blacklist_size = ARRAY_SIZE(kretprobe_blacklist);
+
 /*
  * returns non-zero if opcode modifies the interrupt flag.
  */
@@ -544,6 +551,12 @@ int __kprobes post_kprobe_handler(struct pt_regs *regs)
 
        resume_execution(cur, regs, kcb);
        regs->eflags |= kcb->kprobe_saved_rflags;
+#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
+       if (raw_irqs_disabled_flags(regs->eflags))
+               trace_hardirqs_off();
+       else
+               trace_hardirqs_on();
+#endif
 
        /* Restore the original saved kprobes variables and continue. */
        if (kcb->kprobe_status == KPROBE_REENTER) {
@@ -651,7 +664,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
                        ret = NOTIFY_STOP;
                break;
        case DIE_GPF:
-       case DIE_PAGE_FAULT:
                /* kprobe_running() needs smp_processor_id() */
                preempt_disable();
                if (kprobe_running() &&
@@ -684,6 +696,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
        memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr,
                        MIN_STACK_SIZE(addr));
        regs->eflags &= ~IF_MASK;
+       trace_hardirqs_off();
        regs->rip = (unsigned long)(jp->entry);
        return 1;
 }