Skip to content

Commit 6d97af4

Browse files
svens-s390hcahca
authored andcommitted
entry: Rename arch_check_user_regs() to arch_enter_from_user_mode()
arch_check_user_regs() is used at the moment to verify that struct pt_regs contains valid values when entering the kernel from userspace. s390 needs a place in the generic entry code to modify a cpu data structure when switching from userspace to kernel mode. As arch_check_user_regs() is exactly this, rename it to arch_enter_from_user_mode(). When entering the kernel from userspace, arch_check_user_regs() is used to verify that struct pt_regs contains valid values. Note that the NMI codepath doesn't call this function. s390 needs a place in the generic entry code to modify a cpu data structure when switching from userspace to kernel mode. As arch_check_user_regs() is exactly this, rename it to arch_enter_from_user_mode(). Signed-off-by: Sven Schnelle <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Cc: Andy Lutomirski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Carstens <[email protected]>
1 parent fcdc03f commit 6d97af4

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

arch/s390/include/asm/entry-common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
void do_per_trap(struct pt_regs *regs);
1616

1717
#ifdef CONFIG_DEBUG_ENTRY
18-
static __always_inline void arch_check_user_regs(struct pt_regs *regs)
18+
static __always_inline void arch_enter_from_user_mode(struct pt_regs *regs)
1919
{
2020
debug_user_asce(0);
2121
}
2222

23-
#define arch_check_user_regs arch_check_user_regs
23+
#define arch_enter_from_user_mode arch_enter_from_user_mode
2424
#endif /* CONFIG_DEBUG_ENTRY */
2525

2626
static __always_inline void arch_exit_to_user_mode_work(struct pt_regs *regs,

arch/x86/include/asm/entry-common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <asm/fpu/api.h>
1111

1212
/* Check that the stack and regs on entry from user mode are sane. */
13-
static __always_inline void arch_check_user_regs(struct pt_regs *regs)
13+
static __always_inline void arch_enter_from_user_mode(struct pt_regs *regs)
1414
{
1515
if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) {
1616
/*
@@ -42,7 +42,7 @@ static __always_inline void arch_check_user_regs(struct pt_regs *regs)
4242
WARN_ON_ONCE(regs != task_pt_regs(current));
4343
}
4444
}
45-
#define arch_check_user_regs arch_check_user_regs
45+
#define arch_enter_from_user_mode arch_enter_from_user_mode
4646

4747
static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,
4848
unsigned long ti_work)

include/linux/entry-common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
ARCH_EXIT_TO_USER_MODE_WORK)
6464

6565
/**
66-
* arch_check_user_regs - Architecture specific sanity check for user mode regs
66+
* arch_enter_from_user_mode - Architecture specific sanity check for user mode regs
6767
* @regs: Pointer to currents pt_regs
6868
*
6969
* Defaults to an empty implementation. Can be replaced by architecture
@@ -73,10 +73,10 @@
7373
* section. Use __always_inline so the compiler cannot push it out of line
7474
* and make it instrumentable.
7575
*/
76-
static __always_inline void arch_check_user_regs(struct pt_regs *regs);
76+
static __always_inline void arch_enter_from_user_mode(struct pt_regs *regs);
7777

78-
#ifndef arch_check_user_regs
79-
static __always_inline void arch_check_user_regs(struct pt_regs *regs) {}
78+
#ifndef arch_enter_from_user_mode
79+
static __always_inline void arch_enter_from_user_mode(struct pt_regs *regs) {}
8080
#endif
8181

8282
/**

kernel/entry/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* See comment for enter_from_user_mode() in entry-common.h */
1818
static __always_inline void __enter_from_user_mode(struct pt_regs *regs)
1919
{
20-
arch_check_user_regs(regs);
20+
arch_enter_from_user_mode(regs);
2121
lockdep_hardirqs_off(CALLER_ADDR0);
2222

2323
CT_WARN_ON(ct_state() != CONTEXT_USER);

0 commit comments

Comments
 (0)