Skip to content

Commit

Permalink
x86/entry/64: Move sys_ni_syscall stub to common.c
Browse files Browse the repository at this point in the history
so it can be available to multiple syscall tables.  Also directly return
-ENOSYS instead of bouncing to the generic sys_ni_syscall().

Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20200313195144.164260-7-brgerst@gmail.com
  • Loading branch information
Brian Gerst authored and Thomas Gleixner committed Mar 21, 2020
1 parent 27dd84f commit cc42c04
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 7 additions & 0 deletions arch/x86/entry/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,3 +438,10 @@ __visible long do_fast_syscall_32(struct pt_regs *regs)
#endif
}
#endif

#ifdef CONFIG_X86_64
SYSCALL_DEFINE0(ni_syscall)
{
return -ENOSYS;
}
#endif
7 changes: 0 additions & 7 deletions arch/x86/entry/syscall_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
#include <asm/asm-offsets.h>
#include <asm/syscall.h>

extern asmlinkage long sys_ni_syscall(void);

SYSCALL_DEFINE0(ni_syscall)
{
return sys_ni_syscall();
}

#define __SYSCALL_64(nr, sym, qual) extern asmlinkage long sym(const struct pt_regs *);
#define __SYSCALL_X32(nr, sym, qual) __SYSCALL_64(nr, sym, qual)
#include <asm/syscalls_64.h>
Expand Down
3 changes: 3 additions & 0 deletions arch/x86/include/asm/syscall_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

struct pt_regs;

extern asmlinkage long __x64_sys_ni_syscall(const struct pt_regs *regs);
extern asmlinkage long __ia32_sys_ni_syscall(const struct pt_regs *regs);

/* Mapping of registers to parameters for syscalls on x86-64 and x32 */
#define SC_X86_64_REGS_TO_ARGS(x, ...) \
__MAP(x,__SC_ARGS \
Expand Down

0 comments on commit cc42c04

Please sign in to comment.