Skip to content

Commit aa18a46

Browse files
Hou TaoSasha Levin
Hou Tao
authored and
Sasha Levin
committed
x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h
[ Upstream commit ee0e39a ] Move is_vsyscall_vaddr() into asm/vsyscall.h to make it available for copy_from_kernel_nofault_allowed() in arch/x86/mm/maccess.c. Reviewed-by: Sohil Mehta <[email protected]> Signed-off-by: Hou Tao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9fe96db commit aa18a46

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

arch/x86/include/asm/vsyscall.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <linux/seqlock.h>
66
#include <uapi/asm/vsyscall.h>
7+
#include <asm/page_types.h>
78

89
#ifdef CONFIG_X86_VSYSCALL_EMULATION
910
extern void map_vsyscall(void);
@@ -24,4 +25,13 @@ static inline bool emulate_vsyscall(unsigned long error_code,
2425
}
2526
#endif
2627

28+
/*
29+
* The (legacy) vsyscall page is the long page in the kernel portion
30+
* of the address space that has user-accessible permissions.
31+
*/
32+
static inline bool is_vsyscall_vaddr(unsigned long vaddr)
33+
{
34+
return unlikely((vaddr & PAGE_MASK) == VSYSCALL_ADDR);
35+
}
36+
2737
#endif /* _ASM_X86_VSYSCALL_H */

arch/x86/mm/fault.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -798,15 +798,6 @@ show_signal_msg(struct pt_regs *regs, unsigned long error_code,
798798
show_opcodes(regs, loglvl);
799799
}
800800

801-
/*
802-
* The (legacy) vsyscall page is the long page in the kernel portion
803-
* of the address space that has user-accessible permissions.
804-
*/
805-
static bool is_vsyscall_vaddr(unsigned long vaddr)
806-
{
807-
return unlikely((vaddr & PAGE_MASK) == VSYSCALL_ADDR);
808-
}
809-
810801
static void
811802
__bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
812803
unsigned long address, u32 pkey, int si_code)

0 commit comments

Comments
 (0)