diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/entry_64.S | 23 | ||||
-rw-r--r-- | arch/x86/lib/thunk_64.S | 4 |
2 files changed, 15 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: |
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 |