[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260125164016.331257-9-qq570070308@gmail.com>
Date: Mon, 26 Jan 2026 00:40:15 +0800
From: Xie Yuanbin <qq570070308@...il.com>
To: linux@...linux.org.uk,
johannes@...solutions.net,
masahiroy@...nel.org,
jgross@...e.com,
nsc@...nel.org,
kees@...nel.org,
tglx@...nel.org,
mingo@...nel.org,
frederic@...nel.org,
paulmck@...nel.org,
peterz@...radead.org,
mathieu.desnoyers@...icios.com,
luto@...nel.org,
edumazet@...gle.com
Cc: linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Xie Yuanbin <qq570070308@...il.com>
Subject: [PATCH 8/9] ARM: entry: use enter_from_user_mode() instead of user_exit_callable()
According to user_exit_callable()'s comment, the function is obsolete.
Use enter_from_user_mode() instead of user_exit_callable() to pair with
the calling of exit_to_user_mode() at returning to user.
Since enter_from_user_mode() is a inline function, add
arm_enter_from_user_mode() to call enter_from_user_mode(),
thereby replacing user_exit_callable() and trace_hardirqs_off().
Signed-off-by: Xie Yuanbin <qq570070308@...il.com>
---
arch/arm/include/asm/entry-common.h | 3 +++
arch/arm/kernel/entry-armv.S | 7 +------
arch/arm/kernel/entry-common.S | 6 ++----
arch/arm/kernel/entry.c | 14 ++++++++++++++
4 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/arch/arm/include/asm/entry-common.h b/arch/arm/include/asm/entry-common.h
index d34c80d4b32b..0158a671d4fc 100644
--- a/arch/arm/include/asm/entry-common.h
+++ b/arch/arm/include/asm/entry-common.h
@@ -2,6 +2,9 @@
#ifndef ARCH_ARM_ENTRY_COMMON_H
#define ARCH_ARM_ENTRY_COMMON_H
+asmlinkage __section(".entry.text")
+void arm_enter_from_user_mode(void);
+
asmlinkage __section(".entry.text")
void arm_exit_to_user_mode_no_work_pending(void);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 7f8781666a44..083782ef8180 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -403,12 +403,7 @@ ENDPROC(__fiq_abt)
zero_fp
.if \trace
-#ifdef CONFIG_TRACE_IRQFLAGS
- bl trace_hardirqs_off
-#endif
-#ifdef CONFIG_CONTEXT_TRACKING_USER
- bl user_exit_callable
-#endif
+ bl arm_enter_from_user_mode
.endif
.endm
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 108b77e2b405..0556d01ef55b 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -181,10 +181,8 @@ ENTRY(vector_swi)
zero_fp
alignment_trap r10, ip, cr_alignment
asm_trace_hardirqs_on save=0
- enable_irq_notrace
-#ifdef CONFIG_CONTEXT_TRACKING_USER
- bl user_exit_callable
-#endif
+ bl arm_enter_from_user_mode
+ enable_irq save=0
/*
* Get the system call number.
diff --git a/arch/arm/kernel/entry.c b/arch/arm/kernel/entry.c
index 85df47b5c359..0438e1b7a704 100644
--- a/arch/arm/kernel/entry.c
+++ b/arch/arm/kernel/entry.c
@@ -5,6 +5,20 @@
#include <linux/irq-entry-common.h>
#include <linux/kstack_erase.h>
+/*
+ * arm_enter_from_user_mode - Establish state when coming from user mode
+ *
+ * The calling code satisfies (arch_irqs_disabled() && lockdep_hardirqs_enabled()).
+ * When the function returns, the state satisfies (arch_irqs_disabled() &&
+ * !lockdep_hardirqs_enabled()).
+ */
+asmlinkage __section(".entry.text")
+void arm_enter_from_user_mode(void)
+{
+ /* arm32 not uses pt_regs now */
+ enter_from_user_mode(NULL);
+}
+
/*
* arm_exit_to_user_mode_no_work_pending - Fixup state when exiting to user mode
*
--
2.51.0
Powered by blists - more mailing lists