diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 13:40:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 13:40:41 -0400 |
commit | 419217cb1d0266f62cbea6cdc6b1d1324350bc34 (patch) | |
tree | 01f80c026cc94dfc13b3a16d2fce3ba41c69d54f /arch | |
parent | 4937ce87959629d31e9b09cf5bdf1e12a305c805 (diff) | |
parent | 14358e6ddaed27499d7d366b3e65c3e46b39e1c4 (diff) |
Merge branch 'v2.6.24-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep
* 'v2.6.24-lockdep' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/linux-2.6-lockdep:
lockdep: annotate dir vs file i_mutex
lockdep: per filesystem inode lock class
lockdep: annotate kprobes irq fiddling
lockdep: annotate rcu_read_{,un}lock{,_bh}
lockdep: annotate journal_start()
lockdep: s390: connect the sysexit hook
lockdep: x86_64: connect the sysexit hook
lockdep: i386: connect the sysexit hook
lockdep: syscall exit check
lockdep: fixup mutex annotations
lockdep: fix mismatched lockdep_depth/curr_chain_hash
lockdep: Avoid /proc/lockdep & lock_stat infinite output
lockdep: maintainers
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/entry.S | 12 | ||||
-rw-r--r-- | arch/s390/kernel/entry64.S | 9 | ||||
-rw-r--r-- | arch/x86/kernel/entry_32.S | 4 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 23 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes_32.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes_64.c | 7 | ||||
-rw-r--r-- | arch/x86/lib/thunk_64.S | 4 |
7 files changed, 54 insertions, 12 deletions
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index f3bceb165321..139ca153d5cc 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
@@ -68,9 +68,15 @@ STACK_SIZE = 1 << STACK_SHIFT | |||
68 | l %r1,BASED(.Ltrace_irq_off) | 68 | l %r1,BASED(.Ltrace_irq_off) |
69 | basr %r14,%r1 | 69 | basr %r14,%r1 |
70 | .endm | 70 | .endm |
71 | |||
72 | .macro LOCKDEP_SYS_EXIT | ||
73 | l %r1,BASED(.Llockdep_sys_exit) | ||
74 | basr %r14,%r1 | ||
75 | .endm | ||
71 | #else | 76 | #else |
72 | #define TRACE_IRQS_ON | 77 | #define TRACE_IRQS_ON |
73 | #define TRACE_IRQS_OFF | 78 | #define TRACE_IRQS_OFF |
79 | #define LOCKDEP_SYS_EXIT | ||
74 | #endif | 80 | #endif |
75 | 81 | ||
76 | /* | 82 | /* |
@@ -260,6 +266,7 @@ sysc_return: | |||
260 | bno BASED(sysc_leave) | 266 | bno BASED(sysc_leave) |
261 | tm __TI_flags+3(%r9),_TIF_WORK_SVC | 267 | tm __TI_flags+3(%r9),_TIF_WORK_SVC |
262 | bnz BASED(sysc_work) # there is work to do (signals etc.) | 268 | bnz BASED(sysc_work) # there is work to do (signals etc.) |
269 | LOCKDEP_SYS_EXIT | ||
263 | sysc_leave: | 270 | sysc_leave: |
264 | RESTORE_ALL __LC_RETURN_PSW,1 | 271 | RESTORE_ALL __LC_RETURN_PSW,1 |
265 | 272 | ||
@@ -283,6 +290,7 @@ sysc_work: | |||
283 | bo BASED(sysc_restart) | 290 | bo BASED(sysc_restart) |
284 | tm __TI_flags+3(%r9),_TIF_SINGLE_STEP | 291 | tm __TI_flags+3(%r9),_TIF_SINGLE_STEP |
285 | bo BASED(sysc_singlestep) | 292 | bo BASED(sysc_singlestep) |
293 | LOCKDEP_SYS_EXIT | ||
286 | b BASED(sysc_leave) | 294 | b BASED(sysc_leave) |
287 | 295 | ||
288 | # | 296 | # |
@@ -572,6 +580,7 @@ io_return: | |||
572 | #endif | 580 | #endif |
573 | tm __TI_flags+3(%r9),_TIF_WORK_INT | 581 | tm __TI_flags+3(%r9),_TIF_WORK_INT |
574 | bnz BASED(io_work) # there is work to do (signals etc.) | 582 | bnz BASED(io_work) # there is work to do (signals etc.) |
583 | LOCKDEP_SYS_EXIT | ||
575 | io_leave: | 584 | io_leave: |
576 | RESTORE_ALL __LC_RETURN_PSW,0 | 585 | RESTORE_ALL __LC_RETURN_PSW,0 |
577 | io_done: | 586 | io_done: |
@@ -618,6 +627,7 @@ io_work_loop: | |||
618 | bo BASED(io_reschedule) | 627 | bo BASED(io_reschedule) |
619 | tm __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) | 628 | tm __TI_flags+3(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) |
620 | bnz BASED(io_sigpending) | 629 | bnz BASED(io_sigpending) |
630 | LOCKDEP_SYS_EXIT | ||
621 | b BASED(io_leave) | 631 | b BASED(io_leave) |
622 | 632 | ||
623 | # | 633 | # |
@@ -1040,6 +1050,8 @@ cleanup_io_leave_insn: | |||
1040 | .Ltrace_irq_on: .long trace_hardirqs_on | 1050 | .Ltrace_irq_on: .long trace_hardirqs_on |
1041 | .Ltrace_irq_off: | 1051 | .Ltrace_irq_off: |
1042 | .long trace_hardirqs_off | 1052 | .long trace_hardirqs_off |
1053 | .Llockdep_sys_exit: | ||
1054 | .long lockdep_sys_exit | ||
1043 | #endif | 1055 | #endif |
1044 | .Lcritical_start: | 1056 | .Lcritical_start: |
1045 | .long __critical_start + 0x80000000 | 1057 | .long __critical_start + 0x80000000 |
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index 9c0d5cc8269d..05e26d1fdf40 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S | |||
@@ -66,9 +66,14 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ | |||
66 | .macro TRACE_IRQS_OFF | 66 | .macro TRACE_IRQS_OFF |
67 | brasl %r14,trace_hardirqs_off | 67 | brasl %r14,trace_hardirqs_off |
68 | .endm | 68 | .endm |
69 | |||
70 | .macro LOCKDEP_SYS_EXIT | ||
71 | brasl %r14,lockdep_sys_exit | ||
72 | .endm | ||
69 | #else | 73 | #else |
70 | #define TRACE_IRQS_ON | 74 | #define TRACE_IRQS_ON |
71 | #define TRACE_IRQS_OFF | 75 | #define TRACE_IRQS_OFF |
76 | #define LOCKDEP_SYS_EXIT | ||
72 | #endif | 77 | #endif |
73 | 78 | ||
74 | .macro STORE_TIMER lc_offset | 79 | .macro STORE_TIMER lc_offset |
@@ -255,6 +260,7 @@ sysc_return: | |||
255 | jno sysc_leave | 260 | jno sysc_leave |
256 | tm __TI_flags+7(%r9),_TIF_WORK_SVC | 261 | tm __TI_flags+7(%r9),_TIF_WORK_SVC |
257 | jnz sysc_work # there is work to do (signals etc.) | 262 | jnz sysc_work # there is work to do (signals etc.) |
263 | LOCKDEP_SYS_EXIT | ||
258 | sysc_leave: | 264 | sysc_leave: |
259 | RESTORE_ALL __LC_RETURN_PSW,1 | 265 | RESTORE_ALL __LC_RETURN_PSW,1 |
260 | 266 | ||
@@ -278,6 +284,7 @@ sysc_work: | |||
278 | jo sysc_restart | 284 | jo sysc_restart |
279 | tm __TI_flags+7(%r9),_TIF_SINGLE_STEP | 285 | tm __TI_flags+7(%r9),_TIF_SINGLE_STEP |
280 | jo sysc_singlestep | 286 | jo sysc_singlestep |
287 | LOCKDEP_SYS_EXIT | ||
281 | j sysc_leave | 288 | j sysc_leave |
282 | 289 | ||
283 | # | 290 | # |
@@ -558,6 +565,7 @@ io_return: | |||
558 | #endif | 565 | #endif |
559 | tm __TI_flags+7(%r9),_TIF_WORK_INT | 566 | tm __TI_flags+7(%r9),_TIF_WORK_INT |
560 | jnz io_work # there is work to do (signals etc.) | 567 | jnz io_work # there is work to do (signals etc.) |
568 | LOCKDEP_SYS_EXIT | ||
561 | io_leave: | 569 | io_leave: |
562 | RESTORE_ALL __LC_RETURN_PSW,0 | 570 | RESTORE_ALL __LC_RETURN_PSW,0 |
563 | io_done: | 571 | io_done: |
@@ -605,6 +613,7 @@ io_work_loop: | |||
605 | jo io_reschedule | 613 | jo io_reschedule |
606 | tm __TI_flags+7(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) | 614 | tm __TI_flags+7(%r9),(_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK) |
607 | jnz io_sigpending | 615 | jnz io_sigpending |
616 | LOCKDEP_SYS_EXIT | ||
608 | j io_leave | 617 | j io_leave |
609 | 618 | ||
610 | # | 619 | # |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 290b7bc82da3..8099fea0a72f 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -251,6 +251,7 @@ check_userspace: | |||
251 | jb resume_kernel # not returning to v8086 or userspace | 251 | jb resume_kernel # not returning to v8086 or userspace |
252 | 252 | ||
253 | ENTRY(resume_userspace) | 253 | ENTRY(resume_userspace) |
254 | LOCKDEP_SYS_EXIT | ||
254 | DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt | 255 | DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt |
255 | # setting need_resched or sigpending | 256 | # setting need_resched or sigpending |
256 | # between sampling and the iret | 257 | # between sampling and the iret |
@@ -338,6 +339,7 @@ sysenter_past_esp: | |||
338 | jae syscall_badsys | 339 | jae syscall_badsys |
339 | call *sys_call_table(,%eax,4) | 340 | call *sys_call_table(,%eax,4) |
340 | movl %eax,PT_EAX(%esp) | 341 | movl %eax,PT_EAX(%esp) |
342 | LOCKDEP_SYS_EXIT | ||
341 | DISABLE_INTERRUPTS(CLBR_ANY) | 343 | DISABLE_INTERRUPTS(CLBR_ANY) |
342 | TRACE_IRQS_OFF | 344 | TRACE_IRQS_OFF |
343 | movl TI_flags(%ebp), %ecx | 345 | movl TI_flags(%ebp), %ecx |
@@ -377,6 +379,7 @@ syscall_call: | |||
377 | call *sys_call_table(,%eax,4) | 379 | call *sys_call_table(,%eax,4) |
378 | movl %eax,PT_EAX(%esp) # store the return value | 380 | movl %eax,PT_EAX(%esp) # store the return value |
379 | syscall_exit: | 381 | syscall_exit: |
382 | LOCKDEP_SYS_EXIT | ||
380 | DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt | 383 | DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt |
381 | # setting need_resched or sigpending | 384 | # setting need_resched or sigpending |
382 | # between sampling and the iret | 385 | # between sampling and the iret |
@@ -467,6 +470,7 @@ work_pending: | |||
467 | jz work_notifysig | 470 | jz work_notifysig |
468 | work_resched: | 471 | work_resched: |
469 | call schedule | 472 | call schedule |
473 | LOCKDEP_SYS_EXIT | ||
470 | DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt | 474 | DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt |
471 | # setting need_resched or sigpending | 475 | # setting need_resched or sigpending |
472 | # between sampling and the iret | 476 | # between sampling and the iret |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 1d232e5f5658..f1cacd4897f7 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -244,6 +244,7 @@ ret_from_sys_call: | |||
244 | movl $_TIF_ALLWORK_MASK,%edi | 244 | movl $_TIF_ALLWORK_MASK,%edi |
245 | /* edi: flagmask */ | 245 | /* edi: flagmask */ |
246 | sysret_check: | 246 | sysret_check: |
247 | LOCKDEP_SYS_EXIT | ||
247 | GET_THREAD_INFO(%rcx) | 248 | GET_THREAD_INFO(%rcx) |
248 | cli | 249 | cli |
249 | TRACE_IRQS_OFF | 250 | TRACE_IRQS_OFF |
@@ -333,6 +334,7 @@ int_ret_from_sys_call: | |||
333 | movl $_TIF_ALLWORK_MASK,%edi | 334 | movl $_TIF_ALLWORK_MASK,%edi |
334 | /* edi: mask to check */ | 335 | /* edi: mask to check */ |
335 | int_with_check: | 336 | int_with_check: |
337 | LOCKDEP_SYS_EXIT_IRQ | ||
336 | GET_THREAD_INFO(%rcx) | 338 | GET_THREAD_INFO(%rcx) |
337 | movl threadinfo_flags(%rcx),%edx | 339 | movl threadinfo_flags(%rcx),%edx |
338 | andl %edi,%edx | 340 | andl %edi,%edx |
@@ -544,11 +546,13 @@ exit_intr: | |||
544 | retint_with_reschedule: | 546 | retint_with_reschedule: |
545 | movl $_TIF_WORK_MASK,%edi | 547 | movl $_TIF_WORK_MASK,%edi |
546 | retint_check: | 548 | retint_check: |
549 | LOCKDEP_SYS_EXIT_IRQ | ||
547 | movl threadinfo_flags(%rcx),%edx | 550 | movl threadinfo_flags(%rcx),%edx |
548 | andl %edi,%edx | 551 | andl %edi,%edx |
549 | CFI_REMEMBER_STATE | 552 | CFI_REMEMBER_STATE |
550 | jnz retint_careful | 553 | jnz retint_careful |
551 | retint_swapgs: | 554 | |
555 | retint_swapgs: /* return to user-space */ | ||
552 | /* | 556 | /* |
553 | * The iretq could re-enable interrupts: | 557 | * The iretq could re-enable interrupts: |
554 | */ | 558 | */ |
@@ -557,7 +561,7 @@ retint_swapgs: | |||
557 | swapgs | 561 | swapgs |
558 | jmp restore_args | 562 | jmp restore_args |
559 | 563 | ||
560 | retint_restore_args: | 564 | retint_restore_args: /* return to kernel space */ |
561 | cli | 565 | cli |
562 | /* | 566 | /* |
563 | * The iretq could re-enable interrupts: | 567 | * The iretq could re-enable interrupts: |
@@ -866,26 +870,21 @@ error_sti: | |||
866 | movq ORIG_RAX(%rsp),%rsi /* get error code */ | 870 | movq ORIG_RAX(%rsp),%rsi /* get error code */ |
867 | movq $-1,ORIG_RAX(%rsp) | 871 | movq $-1,ORIG_RAX(%rsp) |
868 | call *%rax | 872 | call *%rax |
869 | /* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */ | 873 | /* ebx: no swapgs flag (1: don't need swapgs, 0: need it) */ |
870 | error_exit: | 874 | error_exit: |
871 | movl %ebx,%eax | 875 | movl %ebx,%eax |
872 | RESTORE_REST | 876 | RESTORE_REST |
873 | cli | 877 | cli |
874 | TRACE_IRQS_OFF | 878 | TRACE_IRQS_OFF |
875 | GET_THREAD_INFO(%rcx) | 879 | GET_THREAD_INFO(%rcx) |
876 | testl %eax,%eax | 880 | testl %eax,%eax |
877 | jne retint_kernel | 881 | jne retint_kernel |
882 | LOCKDEP_SYS_EXIT_IRQ | ||
878 | movl threadinfo_flags(%rcx),%edx | 883 | movl threadinfo_flags(%rcx),%edx |
879 | movl $_TIF_WORK_MASK,%edi | 884 | movl $_TIF_WORK_MASK,%edi |
880 | andl %edi,%edx | 885 | andl %edi,%edx |
881 | jnz retint_careful | 886 | jnz retint_careful |
882 | /* | 887 | jmp retint_swapgs |
883 | * The iret might restore flags: | ||
884 | */ | ||
885 | TRACE_IRQS_IRETQ | ||
886 | swapgs | ||
887 | RESTORE_ARGS 0,8,0 | ||
888 | jmp iret_label | ||
889 | CFI_ENDPROC | 888 | CFI_ENDPROC |
890 | 889 | ||
891 | error_kernelspace: | 890 | error_kernelspace: |
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 | } |
diff --git a/arch/x86/lib/thunk_64.S b/arch/x86/lib/thunk_64.S index 55e586d352d3..6ea73f3de567 100644 --- a/arch/x86/lib/thunk_64.S +++ b/arch/x86/lib/thunk_64.S | |||
@@ -50,6 +50,10 @@ | |||
50 | thunk trace_hardirqs_on_thunk,trace_hardirqs_on | 50 | thunk trace_hardirqs_on_thunk,trace_hardirqs_on |
51 | thunk trace_hardirqs_off_thunk,trace_hardirqs_off | 51 | thunk trace_hardirqs_off_thunk,trace_hardirqs_off |
52 | #endif | 52 | #endif |
53 | |||
54 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
55 | thunk lockdep_sys_exit_thunk,lockdep_sys_exit | ||
56 | #endif | ||
53 | 57 | ||
54 | /* SAVE_ARGS below is used only for the .cfi directives it contains. */ | 58 | /* SAVE_ARGS below is used only for the .cfi directives it contains. */ |
55 | CFI_STARTPROC | 59 | CFI_STARTPROC |