x86/entry: Move irq flags tracing to prepare_exit_to_usermode()
This is another step towards more C-code and less convoluted ASM. Similar to the entry path, invoke the tracer before context tracking which might turn off RCU and invoke lockdep as the last step before going back to user space. Annotate the code sections in exit_to_user_mode() accordingly so objtool won't complain about the tracer invocation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Andy Lutomirski <luto@kernel.org> Link: https://lkml.kernel.org/r/20200505134340.703783926@linutronix.de
这个提交包含在:
@@ -817,8 +817,7 @@ SYM_CODE_START(ret_from_fork)
|
||||
/* When we fork, we trace the syscall return in the child, too. */
|
||||
movl %esp, %eax
|
||||
call syscall_return_slowpath
|
||||
STACKLEAK_ERASE
|
||||
jmp restore_all
|
||||
jmp .Lsyscall_32_done
|
||||
|
||||
/* kernel thread */
|
||||
1: movl %edi, %eax
|
||||
@@ -862,7 +861,7 @@ ret_from_intr:
|
||||
TRACE_IRQS_OFF
|
||||
movl %esp, %eax
|
||||
call prepare_exit_to_usermode
|
||||
jmp restore_all
|
||||
jmp restore_all_switch_stack
|
||||
SYM_CODE_END(ret_from_exception)
|
||||
|
||||
SYM_ENTRY(__begin_SYSENTER_singlestep_region, SYM_L_GLOBAL, SYM_A_NONE)
|
||||
@@ -975,8 +974,7 @@ SYM_FUNC_START(entry_SYSENTER_32)
|
||||
|
||||
STACKLEAK_ERASE
|
||||
|
||||
/* Opportunistic SYSEXIT */
|
||||
TRACE_IRQS_ON /* User mode traces as IRQs on. */
|
||||
/* Opportunistic SYSEXIT */
|
||||
|
||||
/*
|
||||
* Setup entry stack - we keep the pointer in %eax and do the
|
||||
@@ -1079,11 +1077,9 @@ SYM_FUNC_START(entry_INT80_32)
|
||||
movl %esp, %eax
|
||||
call do_int80_syscall_32
|
||||
.Lsyscall_32_done:
|
||||
|
||||
STACKLEAK_ERASE
|
||||
|
||||
restore_all:
|
||||
TRACE_IRQS_ON
|
||||
restore_all_switch_stack:
|
||||
SWITCH_TO_ENTRY_STACK
|
||||
CHECK_AND_APPLY_ESPFIX
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户