[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250107-arm-generic-entry-v3-14-4e5f3c15db2d@linaro.org>
Date: Tue, 07 Jan 2025 10:41:30 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Dmitry Vyukov <dvyukov@...gle.com>, Oleg Nesterov <oleg@...hat.com>,
Russell King <linux@...linux.org.uk>, Kees Cook <kees@...nel.org>,
Andy Lutomirski <luto@...capital.net>, Will Drewry <wad@...omium.org>,
Frederic Weisbecker <frederic@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Jinjie Ruan <ruanjinjie@...wei.com>, Arnd Bergmann <arnd@...db.de>,
Ard Biesheuvel <ardb@...nel.org>, Al Viro <viro@...iv.linux.org.uk>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH RFC v3 14/30] ARM: entry: Drop trace argument from
usr_entry macro
The trace argument select whether to look into tracing of
the hardirqs for the exceptions from userspace, but also
selects whether to call further down to establish context
for RCU.
Split off a second macro that is called on everything
except the FIQ since this is the only outlier.
Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
---
arch/arm/kernel/entry-armv.S | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 93a37437a9520118eff411f009e8f6bd729412fc..c71110126fc105fc6ac2d6cb0f5f399b4c8b1548 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -357,7 +357,7 @@ ENDPROC(__fiq_abt)
#error "sizeof(struct pt_regs) must be a multiple of 8"
#endif
- .macro usr_entry, trace=1, uaccess=1
+ .macro usr_entry, uaccess=1
UNWIND(.fnstart )
UNWIND(.cantunwind ) @ don't unwind the user space
sub sp, sp, #PT_REGS_SIZE
@@ -401,13 +401,14 @@ ENDPROC(__fiq_abt)
@ Clear FP to mark the first stack frame
@
zero_fp
+ .endm
- .if \trace
+ /* Called after usr_entry for everything except FIQ */
+ .macro usr_entry_enter
#ifdef CONFIG_TRACE_IRQFLAGS
bl trace_hardirqs_off
#endif
asm_irqentry_enter_from_user_mode save = 0
- .endif
.endm
.macro kuser_cmpxchg_check
@@ -429,6 +430,7 @@ ENDPROC(__fiq_abt)
.align 5
__dabt_usr:
usr_entry uaccess=0
+ usr_entry_enter
kuser_cmpxchg_check
mov r2, sp
dabt_helper
@@ -439,6 +441,7 @@ ENDPROC(__dabt_usr)
.align 5
__irq_usr:
usr_entry
+ usr_entry_enter
kuser_cmpxchg_check
irq_handler from_user=1
get_thread_info tsk
@@ -452,6 +455,7 @@ ENDPROC(__irq_usr)
.align 5
__und_usr:
usr_entry uaccess=0
+ usr_entry_enter
@ IRQs must be enabled before attempting to read the instruction from
@ user space since that could cause a page/translation fault if the
@@ -476,6 +480,7 @@ ENDPROC(__und_usr)
.align 5
__pabt_usr:
usr_entry
+ usr_entry_enter
mov r2, sp @ regs
pabt_helper
UNWIND(.fnend )
@@ -495,7 +500,7 @@ ENDPROC(ret_from_exception)
.align 5
__fiq_usr:
- usr_entry trace=0
+ usr_entry
kuser_cmpxchg_check
mov r0, sp @ struct pt_regs *regs
bl handle_fiq_as_nmi
--
2.47.1
Powered by blists - more mailing lists