diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-10-11 16:11:12 -0400 |
---|---|---|
committer | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-10-11 16:11:12 -0400 |
commit | 10cd706d180b62a61aace5b440247c8785026ac1 (patch) | |
tree | 4bc544761719fd10ecfa977e6f4bfd8f1249d8b9 /arch/x86/kernel/entry_64.S | |
parent | c7e872e7da5514d014707a407ea562d197cc0136 (diff) |
lockdep: x86_64: connect the sysexit hook
Run the lockdep_sys_exit hook after all other C code on the syscall
return path.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/entry_64.S')
-rw-r--r-- | arch/x86/kernel/entry_64.S | 23 |
1 files changed, 11 insertions, 12 deletions
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: |