]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
entry: Inline irqentry_enter/exit_from/to_user_mode()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 27 Oct 2025 08:44:40 +0000 (09:44 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Nov 2025 07:31:47 +0000 (08:31 +0100)
There is no point to have this as a function which just inlines
enter_from_user_mode(). The function call overhead is larger than the
function itself.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251027084306.715309918@linutronix.de
include/linux/irq-entry-common.h
kernel/entry/common.c

index 9b1f386ffeb15aec05640eb71be33a7d66723aec..83c9d841d9e115a6d198fd6ddd175ef4688a05f9 100644 (file)
@@ -278,7 +278,10 @@ static __always_inline void exit_to_user_mode(void)
  *
  * The function establishes state (lockdep, RCU (context tracking), tracing)
  */
-void irqentry_enter_from_user_mode(struct pt_regs *regs);
+static __always_inline void irqentry_enter_from_user_mode(struct pt_regs *regs)
+{
+       enter_from_user_mode(regs);
+}
 
 /**
  * irqentry_exit_to_user_mode - Interrupt exit work
@@ -293,7 +296,13 @@ void irqentry_enter_from_user_mode(struct pt_regs *regs);
  * Interrupt exit is not invoking #1 which is the syscall specific one time
  * work.
  */
-void irqentry_exit_to_user_mode(struct pt_regs *regs);
+static __always_inline void irqentry_exit_to_user_mode(struct pt_regs *regs)
+{
+       instrumentation_begin();
+       exit_to_user_mode_prepare(regs);
+       instrumentation_end();
+       exit_to_user_mode();
+}
 
 #ifndef irqentry_state
 /**
index f62e1d1b2063ea58723cde9e5b619487282ca09a..70a16db4cc0ae98207c6b70e86352d20ce5966a4 100644 (file)
@@ -62,19 +62,6 @@ __always_inline unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
        return ti_work;
 }
 
-noinstr void irqentry_enter_from_user_mode(struct pt_regs *regs)
-{
-       enter_from_user_mode(regs);
-}
-
-noinstr void irqentry_exit_to_user_mode(struct pt_regs *regs)
-{
-       instrumentation_begin();
-       exit_to_user_mode_prepare(regs);
-       instrumentation_end();
-       exit_to_user_mode();
-}
-
 noinstr irqentry_state_t irqentry_enter(struct pt_regs *regs)
 {
        irqentry_state_t ret = {