[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250107-arm-generic-entry-v3-16-4e5f3c15db2d@linaro.org>
Date: Tue, 07 Jan 2025 10:41:32 +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 16/30] ARM: entry: Drop argument to asm_irqentry
macros
asm_irqentry_enter_from_user_mode and asm_irqentry_exit_to_user_mode
have a "save" argument that will save and restore registers before
the call to the C function.
Now all invocations set this argument to 0 so drop the surplus
code.
Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
---
arch/arm/kernel/entry-armv.S | 8 ++++----
arch/arm/kernel/entry-common.S | 2 +-
arch/arm/kernel/entry-header.S | 18 ++----------------
3 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 6edf362ab1e1035dafebf6fb7c55db71462c1eae..460aa92c3c1f50de905550acf363c58f509bfe0a 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -422,7 +422,7 @@ ENDPROC(__fiq_abt)
.align 5
__dabt_usr:
usr_entry uaccess=0
- asm_irqentry_enter_from_user_mode save = 0
+ asm_irqentry_enter_from_user_mode
kuser_cmpxchg_check
mov r2, sp
dabt_helper
@@ -433,7 +433,7 @@ ENDPROC(__dabt_usr)
.align 5
__irq_usr:
usr_entry
- asm_irqentry_enter_from_user_mode save = 0
+ asm_irqentry_enter_from_user_mode
kuser_cmpxchg_check
irq_handler from_user=1
get_thread_info tsk
@@ -447,7 +447,7 @@ ENDPROC(__irq_usr)
.align 5
__und_usr:
usr_entry uaccess=0
- asm_irqentry_enter_from_user_mode save = 0
+ asm_irqentry_enter_from_user_mode
@ IRQs must be enabled before attempting to read the instruction from
@ user space since that could cause a page/translation fault if the
@@ -472,7 +472,7 @@ ENDPROC(__und_usr)
.align 5
__pabt_usr:
usr_entry
- asm_irqentry_enter_from_user_mode save = 0
+ asm_irqentry_enter_from_user_mode
mov r2, sp @ regs
pabt_helper
UNWIND(.fnend )
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 14b2495cae3c2f95b0dfecd849b4e16ec143dbe9..df564388905ee019cd5553f8b37e678da59e3222 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -109,7 +109,7 @@ ENTRY(ret_to_user_from_irq)
movs r1, r1, lsl #16
bne slow_work_pending
no_work_pending:
- asm_irqentry_exit_to_user_mode save = 0
+ asm_irqentry_exit_to_user_mode
#ifdef CONFIG_GCC_PLUGIN_STACKLEAK
bl stackleak_erase_on_task_stack
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index fb5bb019199b2871e29e306a29bea8fdf47dd7f3..50c0b55adc7421e7be123c9d00f94b1ebb93ff9e 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -365,28 +365,14 @@ ALT_UP_B(.L1_\@)
* Context tracking and other mode transitions. Used to instrument transitions
* between user and kernel mode.
*/
- .macro asm_irqentry_enter_from_user_mode, save = 1
- .if \save
- stmdb sp!, {r0-r3, ip, lr}
+ .macro asm_irqentry_enter_from_user_mode
mov r0, sp @ regs
bl irqentry_enter_from_user_mode
- ldmia sp!, {r0-r3, ip, lr}
- .else
- mov r0, sp @ regs
- bl irqentry_enter_from_user_mode
- .endif
.endm
- .macro asm_irqentry_exit_to_user_mode, save = 1
- .if \save
- stmdb sp!, {r0-r3, ip, lr}
+ .macro asm_irqentry_exit_to_user_mode
mov r0, sp @ regs
bl irqentry_exit_to_user_mode
- ldmia sp!, {r0-r3, ip, lr}
- .else
- mov r0, sp @ regs
- bl irqentry_exit_to_user_mode
- .endif
.endm
/*
--
2.47.1
Powered by blists - more mailing lists