aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-11 16:25:25 -0400
committerPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-11 16:25:25 -0400
commit58dfe883d3bc3b4c08c53a7f39e2ca3ec84f089e (patch)
treecbcc59b5efe71b75762a23604002eccc22e51927 /arch
parent851a67b825540a8e00c0be3ee25e4627ba8b133b (diff)
lockdep: annotate kprobes irq fiddling
kprobes disables irqs for jprobes, but does not tell lockdep about it. This resolves this warning during an allyesconfig bzImage bootup test: [ 423.670337] WARNING: at kernel/lockdep.c:2658 check_flags() [ 423.670341] [<c0107f01>] show_trace_log_lvl+0x19/0x2e [ 423.670348] [<c0107ffa>] show_trace+0x12/0x14 [ 423.670350] [<c0108010>] dump_stack+0x14/0x16 [ 423.670353] [<c015249d>] check_flags+0x95/0x142 [ 423.670357] [<c0155576>] lock_acquire+0x52/0xb8 [ 423.670360] [<c1313c90>] _spin_lock+0x2e/0x58 [ 423.670365] [<c11b72f9>] jtcp_rcv_established+0x6e/0x189 [ 423.670369] [<c11810da>] tcp_v4_do_rcv+0x30b/0x620 [ 423.670373] [<c1181c8c>] tcp_v4_rcv+0x89d/0x8fa [ 423.670376] [<c1167dba>] ip_local_deliver+0x17d/0x225 [ 423.670380] [<c11682f5>] ip_rcv+0x493/0x4ce [ 423.670383] [<c11177ef>] netif_receive_skb+0x347/0x365 [ 423.670388] [<c07b6e7b>] nv_napi_poll+0x501/0x6c3 [ 423.670393] [<c1115b1a>] net_rx_action+0xa3/0x1b6 [ 423.670396] [<c013bdee>] __do_softirq+0x76/0xfb [ 423.670400] [<c0109189>] do_softirq+0x75/0xf3 [ akpm: checkpatch.pl cleanups ] Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/kprobes_32.c7
-rw-r--r--arch/x86/kernel/kprobes_64.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c
index c2d03e96ae9f..e7d0d3c2ef64 100644
--- a/arch/x86/kernel/kprobes_32.c
+++ b/arch/x86/kernel/kprobes_32.c
@@ -557,6 +557,12 @@ static int __kprobes post_kprobe_handler(struct pt_regs *regs)
557 557
558 resume_execution(cur, regs, kcb); 558 resume_execution(cur, regs, kcb);
559 regs->eflags |= kcb->kprobe_saved_eflags; 559 regs->eflags |= kcb->kprobe_saved_eflags;
560#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
561 if (raw_irqs_disabled_flags(regs->eflags))
562 trace_hardirqs_off();
563 else
564 trace_hardirqs_on();
565#endif
560 566
561 /*Restore back the original saved kprobes variables and continue. */ 567 /*Restore back the original saved kprobes variables and continue. */
562 if (kcb->kprobe_status == KPROBE_REENTER) { 568 if (kcb->kprobe_status == KPROBE_REENTER) {
@@ -694,6 +700,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
694 memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr, 700 memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr,
695 MIN_STACK_SIZE(addr)); 701 MIN_STACK_SIZE(addr));
696 regs->eflags &= ~IF_MASK; 702 regs->eflags &= ~IF_MASK;
703 trace_hardirqs_off();
697 regs->eip = (unsigned long)(jp->entry); 704 regs->eip = (unsigned long)(jp->entry);
698 return 1; 705 return 1;
699} 706}
diff --git a/arch/x86/kernel/kprobes_64.c b/arch/x86/kernel/kprobes_64.c
index 1df17a0ec0c9..62e28e52d784 100644
--- a/arch/x86/kernel/kprobes_64.c
+++ b/arch/x86/kernel/kprobes_64.c
@@ -544,6 +544,12 @@ int __kprobes post_kprobe_handler(struct pt_regs *regs)
544 544
545 resume_execution(cur, regs, kcb); 545 resume_execution(cur, regs, kcb);
546 regs->eflags |= kcb->kprobe_saved_rflags; 546 regs->eflags |= kcb->kprobe_saved_rflags;
547#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
548 if (raw_irqs_disabled_flags(regs->eflags))
549 trace_hardirqs_off();
550 else
551 trace_hardirqs_on();
552#endif
547 553
548 /* Restore the original saved kprobes variables and continue. */ 554 /* Restore the original saved kprobes variables and continue. */
549 if (kcb->kprobe_status == KPROBE_REENTER) { 555 if (kcb->kprobe_status == KPROBE_REENTER) {
@@ -684,6 +690,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
684 memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr, 690 memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr,
685 MIN_STACK_SIZE(addr)); 691 MIN_STACK_SIZE(addr));
686 regs->eflags &= ~IF_MASK; 692 regs->eflags &= ~IF_MASK;
693 trace_hardirqs_off();
687 regs->rip = (unsigned long)(jp->entry); 694 regs->rip = (unsigned long)(jp->entry);
688 return 1; 695 return 1;
689} 696}