syscall_exit_to_user_mode(9)
πΈ syscall_exit_to_user_mode(9) πΈ
okay so bestie, welcome to the Kernel API Manual page for syscall_exit_to_user_mode(9) β it's giving βhandle work before returning to user modeβ and honestly it ate π
π NAME π
syscall_exit_to_user_mode β handle work before returning to user mode. Short, sweet, and exactly what it says on the tin β¨
π¦ SYNOPSIS π¦
void syscall_exit_to_user_mode (struct pt_regs *regs );
π ARGUMENTS π
regsβ pointer to currentspt_regsπ«Ά (yes, the page says βcurrentsβ, we're keeping that exact energy π)
π DESCRIPTION π
okay so here's the tea: you invoke this function with interrupts enabled and regs fully valid. It returns with all the work handled and interrupts disabled, so the caller can immediately switch to user mode. It gets called from architecture specific syscall and ret from fork code, iykyk.
The call order is literally this, bestie β don't skip steps:
- One-time syscall exit work:
rseqsyscall exitaudit- syscall tracing
ptrace(single stepping)
- Preparatory work:
- Disable interrupts
- Exit to user mode loop (common TIF handling). Invokes
arch_exit_to_user_mode_workfor architecture specific TIF work - Architecture specific one time work
arch_exit_to_user_mode_prepare - Address limit and lockdep checks
- Final transition (lockdep, tracing, context tracking, RCU), i.e. the functionality in
exit_to_user_mode.
So this function is a combination of syscall_exit_to_user_mode_work (1), disabling interrupts followed by syscall_exit_to_user_mode_prepare (2), and exit_to_user_mode (3). The page says this function is preferred unless there is a compelling architectural reason to invoke the functions separately. Iconic behavior, honestly π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/entry-common.hβ go read it, bestie π arch_ptrace_report_syscall_permit_entry(9)syscall_enter_from_user_mode_work(9)enter_from_user_mode_randomize_stack(9)syscall_enter_from_user_mode_randomize_stack(9)arch_ptrace_report_syscall_exit(9)syscall_exit_work(9)syscall_exit_to_user_mode_work(9)
xoxo, bestie π«Ά source/version: ./include/linux, dated October 2026 β catch you in the next manpage π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms