Skip to content

Commit 2f911d4

Browse files
mrutland-armwilldeacon
authored andcommitted
arm64: entry: move enter_from_user_mode to entry-common.c
In later patches we'll want to extend enter_from_user_mode() and add a corresponding exit_to_user_mode(). As these will be common for all entries/exits from userspace, it'd be better for these to live in entry-common.c with the rest of the entry logic. This patch moves enter_from_user_mode() into entry-common.c. As with other functions in entry-common.c it is marked as noinstr (which prevents all instrumentation, tracing, and kprobes) but there are no other functional changes. Signed-off-by: Mark Rutland <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: James Morse <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent da19267 commit 2f911d4

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

arch/arm64/kernel/entry-common.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ asmlinkage void noinstr el1_sync_handler(struct pt_regs *regs)
101101
}
102102
}
103103

104+
asmlinkage void noinstr enter_from_user_mode(void)
105+
{
106+
CT_WARN_ON(ct_state() != CONTEXT_USER);
107+
user_exit_irqoff();
108+
}
109+
104110
static void noinstr el0_da(struct pt_regs *regs, unsigned long esr)
105111
{
106112
unsigned long far = read_sysreg(far_el1);

arch/arm64/kernel/traps.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -876,13 +876,6 @@ asmlinkage void do_serror(struct pt_regs *regs, unsigned int esr)
876876
nmi_exit();
877877
}
878878

879-
asmlinkage void enter_from_user_mode(void)
880-
{
881-
CT_WARN_ON(ct_state() != CONTEXT_USER);
882-
user_exit_irqoff();
883-
}
884-
NOKPROBE_SYMBOL(enter_from_user_mode);
885-
886879
/* GENERIC_BUG traps */
887880

888881
int is_valid_bugaddr(unsigned long addr)

0 commit comments

Comments
 (0)