aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/entry_64.S31
1 files changed, 16 insertions, 15 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index e41734a537bd..3194636a4293 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -361,34 +361,35 @@ ENTRY(save_paranoid)
361END(save_paranoid) 361END(save_paranoid)
362 362
363/* 363/*
364 * A newly forked process directly context switches into this. 364 * A newly forked process directly context switches into this address.
365 *
366 * rdi: prev task we switched from
365 */ 367 */
366/* rdi: prev */
367ENTRY(ret_from_fork) 368ENTRY(ret_from_fork)
368 DEFAULT_FRAME 369 DEFAULT_FRAME
370
369 push kernel_eflags(%rip) 371 push kernel_eflags(%rip)
370 CFI_ADJUST_CFA_OFFSET 8 372 CFI_ADJUST_CFA_OFFSET 8
371 popf # reset kernel eflags 373 popf # reset kernel eflags
372 CFI_ADJUST_CFA_OFFSET -8 374 CFI_ADJUST_CFA_OFFSET -8
373 call schedule_tail 375
376 call schedule_tail # rdi: 'prev' task parameter
377
374 GET_THREAD_INFO(%rcx) 378 GET_THREAD_INFO(%rcx)
375 testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%rcx) 379
376 CFI_REMEMBER_STATE 380 CFI_REMEMBER_STATE
377 jnz rff_trace
378rff_action:
379 RESTORE_REST 381 RESTORE_REST
380 testl $3,CS-ARGOFFSET(%rsp) # from kernel_thread? 382
383 testl $3, CS-ARGOFFSET(%rsp) # from kernel_thread?
381 je int_ret_from_sys_call 384 je int_ret_from_sys_call
382 testl $_TIF_IA32,TI_flags(%rcx) 385
386 testl $_TIF_IA32, TI_flags(%rcx) # 32-bit compat task needs IRET
383 jnz int_ret_from_sys_call 387 jnz int_ret_from_sys_call
388
384 RESTORE_TOP_OF_STACK %rdi, -ARGOFFSET 389 RESTORE_TOP_OF_STACK %rdi, -ARGOFFSET
385 jmp ret_from_sys_call 390 jmp ret_from_sys_call # go to the SYSRET fastpath
391
386 CFI_RESTORE_STATE 392 CFI_RESTORE_STATE
387rff_trace:
388 movq %rsp,%rdi
389 call syscall_trace_leave
390 GET_THREAD_INFO(%rcx)
391 jmp rff_action
392 CFI_ENDPROC 393 CFI_ENDPROC
393END(ret_from_fork) 394END(ret_from_fork)
394 395