diff options
| author | Thomas Gleixner <tglx@kernel.org> | 2026-07-07 21:06:57 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-07-12 12:38:02 +0200 |
| commit | 2b341c74dbf8864b6dd32119b761ceaab516249e (patch) | |
| tree | cb8cf8503d5380966007a5d2204f961e31907ec5 | |
| parent | 622f04e97415e62bd2ab61f7a27e7a296e8467b7 (diff) | |
x86/entry: Make syscall functions static
They are only used in the respective source files. No point in exposing
them.
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
Link: https://patch.msgid.link/20260707190254.438361565@kernel.org
| -rw-r--r-- | arch/x86/entry/syscall_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/entry/syscall_64.c | 10 | ||||
| -rw-r--r-- | arch/x86/include/asm/syscall.h | 8 |
3 files changed, 7 insertions, 13 deletions
diff --git a/arch/x86/entry/syscall_32.c b/arch/x86/entry/syscall_32.c index 2b13f1c842b8..6e00929b893c 100644 --- a/arch/x86/entry/syscall_32.c +++ b/arch/x86/entry/syscall_32.c @@ -41,7 +41,7 @@ const sys_call_ptr_t sys_call_table[] = { #endif #define __SYSCALL(nr, sym) case nr: return __ia32_##sym(regs); -long ia32_sys_call(const struct pt_regs *regs, unsigned int nr) +static noinline long ia32_sys_call(const struct pt_regs *regs, unsigned int nr) { switch (nr) { #include <asm/syscalls_32.h> diff --git a/arch/x86/entry/syscall_64.c b/arch/x86/entry/syscall_64.c index 0acd7e99e8e0..837aee7db50d 100644 --- a/arch/x86/entry/syscall_64.c +++ b/arch/x86/entry/syscall_64.c @@ -32,7 +32,7 @@ const sys_call_ptr_t sys_call_table[] = { #undef __SYSCALL #define __SYSCALL(nr, sym) case nr: return __x64_##sym(regs); -long x64_sys_call(const struct pt_regs *regs, unsigned int nr) +static noinline long x64_sys_call(const struct pt_regs *regs, unsigned int nr) { switch (nr) { #include <asm/syscalls_64.h> @@ -40,15 +40,17 @@ long x64_sys_call(const struct pt_regs *regs, unsigned int nr) } } -#ifdef CONFIG_X86_X32_ABI -long x32_sys_call(const struct pt_regs *regs, unsigned int nr) +static noinline long x32_sys_call(const struct pt_regs *regs, unsigned int nr) { +#ifdef CONFIG_X86_X32_ABI switch (nr) { #include <asm/syscalls_x32.h> default: return __x64_sys_ni_syscall(regs); } -} +#else + return -ENOSYS; #endif +} static __always_inline bool do_syscall_x64(struct pt_regs *regs, int nr) { diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h index c10dbb74cd00..59a406074dc0 100644 --- a/arch/x86/include/asm/syscall.h +++ b/arch/x86/include/asm/syscall.h @@ -21,14 +21,6 @@ typedef long (*sys_call_ptr_t)(const struct pt_regs *); extern const sys_call_ptr_t sys_call_table[]; /* - * These may not exist, but still put the prototypes in so we - * can use IS_ENABLED(). - */ -extern long ia32_sys_call(const struct pt_regs *, unsigned int nr); -extern long x32_sys_call(const struct pt_regs *, unsigned int nr); -extern long x64_sys_call(const struct pt_regs *, unsigned int nr); - -/* * Only the low 32 bits of orig_ax are meaningful, so we return int. * This importantly ignores the high bits on 64-bit, so comparisons * sign-extend the low 32 bits. |
