aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-25 08:01:10 -0400
committerPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-25 08:01:10 -0400
commit143a5d325d35efb1b29dcb8d6031cf27107e183a (patch)
treedef297c7608722df2b5a51e5e6acaacb1aeb1f97 /arch/x86/kernel
parentc9927c2bf4f45bb85e8b502ab3fb79ad6483c244 (diff)
lockdep: fixup irq tracing
Ensure we fixup the IRQ state before we hit any locking code. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/kprobes_32.c7
-rw-r--r--arch/x86/kernel/kprobes_64.c7
-rw-r--r--arch/x86/kernel/traps_32.c2
-rw-r--r--arch/x86/kernel/traps_64.c2
4 files changed, 6 insertions, 12 deletions
diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c
index 90f778c04b3f..d87a523070d1 100644
--- a/arch/x86/kernel/kprobes_32.c
+++ b/arch/x86/kernel/kprobes_32.c
@@ -564,12 +564,7 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
564 564
565 resume_execution(cur, regs, kcb); 565 resume_execution(cur, regs, kcb);
566 regs->eflags |= kcb->kprobe_saved_eflags; 566 regs->eflags |= kcb->kprobe_saved_eflags;
567#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT 567 trace_hardirqs_fixup_flags(regs->eflags);
568 if (raw_irqs_disabled_flags(regs->eflags))
569 trace_hardirqs_off();
570 else
571 trace_hardirqs_on();
572#endif
573 568
574 /*Restore back the original saved kprobes variables and continue. */ 569 /*Restore back the original saved kprobes variables and continue. */
575 if (kcb->kprobe_status == KPROBE_REENTER) { 570 if (kcb->kprobe_status == KPROBE_REENTER) {
diff --git a/arch/x86/kernel/kprobes_64.c b/arch/x86/kernel/kprobes_64.c
index 681b801c5e26..3db3611933d8 100644
--- a/arch/x86/kernel/kprobes_64.c
+++ b/arch/x86/kernel/kprobes_64.c
@@ -551,12 +551,7 @@ int __kprobes post_kprobe_handler(struct pt_regs *regs)
551 551
552 resume_execution(cur, regs, kcb); 552 resume_execution(cur, regs, kcb);
553 regs->eflags |= kcb->kprobe_saved_rflags; 553 regs->eflags |= kcb->kprobe_saved_rflags;
554#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT 554 trace_hardirqs_fixup_flags(regs->eflags);
555 if (raw_irqs_disabled_flags(regs->eflags))
556 trace_hardirqs_off();
557 else
558 trace_hardirqs_on();
559#endif
560 555
561 /* Restore the original saved kprobes variables and continue. */ 556 /* Restore the original saved kprobes variables and continue. */
562 if (kcb->kprobe_status == KPROBE_REENTER) { 557 if (kcb->kprobe_status == KPROBE_REENTER) {
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index cc9acace7e23..298d13ed3ab3 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -789,6 +789,8 @@ void restart_nmi(void)
789#ifdef CONFIG_KPROBES 789#ifdef CONFIG_KPROBES
790fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code) 790fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code)
791{ 791{
792 trace_hardirqs_fixup();
793
792 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) 794 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
793 == NOTIFY_STOP) 795 == NOTIFY_STOP)
794 return; 796 return;
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index d0c2bc7ab2ec..4a6bd4965f56 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -807,6 +807,8 @@ asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs)
807/* runs on IST stack. */ 807/* runs on IST stack. */
808asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code) 808asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code)
809{ 809{
810 trace_hardirqs_fixup();
811
810 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { 812 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) {
811 return; 813 return;
812 } 814 }