enter_from_user_mode(9)
π enter_from_user_mode(9) β like, the kernel API manual bestie β¨
okay so real talk, this is a page from the Kernel API Manual and it's about enter_from_user_mode, which honestly is giving "the bouncer at the club door between userland and kernel space" energy. Let's get into it π«Ά
β¨ NAME β¨
enter_from_user_mode β establish state when coming from user mode. that's it, that's the whole vibe check π«
π SYNOPSIS π
void enter_from_user_mode (struct pt_regs *regs );
no cap, that's the entire signature. void return, one arg, we move π
πΈ ARGUMENTS πΈ
regsβ pointer to current'spt_regs. yes bestie, the current task's registers, get you a pointer that knows where it lives π₯
π¦ DESCRIPTION π¦
okay so here's the lore: when you enter a syscall or an interrupt, interrupts get disabled, right? but user mode is traced as if interrupts are enabled. and if NO_HZ_FULL is in play, RCU might lowkey be idle. messy, i know π
so this function does three things, in order, and you will respect the order:
- Tell
lockdepthat interrupts are disabled π - Invoke context tracking if enabled, so it can reactivate RCU π
- Trace the interrupts-off state π
and here's the part where you gotta pay attention, bestie:
Invoked from architecture-specific syscall entry code with interrupts disabled. The calling code has to be non-instrumentable. When the function returns, all state is correct and interrupts are still disabled. The subsequent functions can be instrumented.
like, it's giving "this door is one-way and you cannot decorate it." periodt. π
also, this is the one you call when there's architecture-specific functionality to be done between establishing state and enabling interrupts. and heads up π:
The caller must enable interrupts before invoking syscall_enter_from_user_mode_work.
don't skip that step, i'm literally begging π
π SEE ALSO π
kernel file over at ./include/linux/irq-entry-common.h β go read it, it's the whole friend group fr fr π§
and the rest of the squad, alphabetically-ish, all present and accounted for:
arch_enter_from_user_mode(9)arch_in_rcu_eqs(9)arch_exit_to_user_mode_work(9)arch_exit_to_user_mode_prepare(9)arch_exit_to_user_mode(9)arch_do_signal_or_restart(9)__exit_to_user_mode_prepare(9)syscall_exit_to_user_mode_prepare(9)irqentry_exit_to_user_mode_prepare(9)exit_to_user_mode(9)irqentry_enter_from_user_mode(9)irqentry_exit_to_user_mode(9)struct irqentry_state(9)irqentry_enter_from_kernel_mode(9)irqentry_exit_to_kernel_mode_preempt(9)irqentry_exit_to_kernel_mode_after_preempt(9)irqentry_exit_to_kernel_mode(9)irqentry_enter(9)irqentry_exit(9)irqentry_nmi_enter(9)irqentry_nmi_exit(9)
like, the whole irqentry_* family reunion β iconic behavior honestly π
and that's a wrap, bestie π this page lives in ./include/linux, the October 2026 edition, and it's filed under enter_from_user_mode(9) β go forth and enable those interrupts after you're done, mwah πβ¨
π¦ 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