[tip: core/entry] x86/entry: Make syscall functions static

From: tip-bot2 for Thomas Gleixner

Date: Sun Jul 12 2026 - 08:46:00 EST


The following commit has been merged into the core/entry branch of tip:

Commit-ID: 2b341c74dbf8864b6dd32119b761ceaab516249e
Gitweb: https://git.kernel.org/tip/2b341c74dbf8864b6dd32119b761ceaab516249e
Author: Thomas Gleixner <tglx@xxxxxxxxxx>
AuthorDate: Tue, 07 Jul 2026 21:06:57 +02:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Sun, 12 Jul 2026 12:38:02 +02:00

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@xxxxxxxxxx>
Tested-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@xxxxxxxxx>
Reviewed-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@xxxxxxxxx>
Link: https://patch.msgid.link/20260707190254.438361565@xxxxxxxxxx
---
arch/x86/entry/syscall_32.c | 2 +-
arch/x86/entry/syscall_64.c | 10 ++++++----
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 2b13f1c..6e00929 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 0acd7e9..837aee7 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 c10dbb7..59a4060 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.