]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: generate 64-bit syscall.tbl
authorArnd Bergmann <arnd@arndb.de>
Thu, 4 Jul 2024 12:33:34 +0000 (14:33 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 10 Jul 2024 12:23:38 +0000 (14:23 +0200)
Change the asm/unistd.h header for arm64 to no longer include
asm-generic/unistd.h itself, but instead generate both the asm/unistd.h
contents and the list of entry points using the syscall.tbl scripts that
we use on most other architectures.

Once his is done for the remaining architectures, the generic unistd.h
header can be removed and the generated tbl file put in its place.

The Makefile changes are more complex than they should be, I need
a little help to improve those. Ideally this should be done in an
architecture-independent way as well.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm64/include/asm/Kbuild
arch/arm64/include/asm/seccomp.h
arch/arm64/include/asm/unistd.h
arch/arm64/include/uapi/asm/Kbuild
arch/arm64/include/uapi/asm/unistd.h
arch/arm64/kernel/Makefile.syscalls
arch/arm64/kernel/sys.c
arch/arm64/tools/Makefile
arch/arm64/tools/syscall_64.tbl [new symlink]

index 3fc45ef32e859a745f1964b955d32fb3c7eaf99f..7d7d97ad3cd5abc7f7aadcfa6bdbe152fd303ccf 100644 (file)
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 syscall-y += syscall_table_32.h
+syscall-y += syscall_table_64.h
 
 # arm32 syscall table used by lib/compat_audit.c:
 syscall-y += unistd_32.h
index d56164d3cac5024591b44b2ca79bda99baa8c5d4..c83ca2c8b936e0bc3e58e1e2d8e601d734d00389 100644 (file)
@@ -23,6 +23,7 @@
 #define SECCOMP_ARCH_NATIVE_NR         NR_syscalls
 #define SECCOMP_ARCH_NATIVE_NAME       "aarch64"
 #ifdef CONFIG_COMPAT
+#include <asm/unistd_compat_32.h>
 # define SECCOMP_ARCH_COMPAT           AUDIT_ARCH_ARM
 # define SECCOMP_ARCH_COMPAT_NR                __NR_compat32_syscalls
 # define SECCOMP_ARCH_COMPAT_NAME      "arm"
index 55ac26355be4969d0f5013233821045cba35e8e5..fdd16052f9bc1207d4d1416f4576f884f822aa2d 100644 (file)
@@ -41,9 +41,8 @@
 #endif
 
 #define __ARCH_WANT_SYS_CLONE
+#define __ARCH_WANT_NEW_STAT
 
-#ifndef __COMPAT_SYSCALL_NR
-#include <uapi/asm/unistd.h>
-#endif
+#include <asm/unistd_64.h>
 
 #define NR_syscalls (__NR_syscalls)
index 602d137932dcef659fc39c6eef6160bc2182f25b..c6d141d7b7d734c09d339e19834ab5ee3cd158e2 100644 (file)
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
+syscall-y += unistd_64.h
 
 generic-y += kvm_para.h
index 9306726337fe005e3cf3e1ffd38dc6356191fa95..df36f23876e863ff0a9e88473d5339f7ab69516d 100644 (file)
@@ -1,24 +1,2 @@
 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-/*
- * Copyright (C) 2012 ARM Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#define __ARCH_WANT_RENAMEAT
-#define __ARCH_WANT_NEW_STAT
-#define __ARCH_WANT_SET_GET_RLIMIT
-#define __ARCH_WANT_TIME32_SYSCALLS
-#define __ARCH_WANT_MEMFD_SECRET
-
-#include <asm-generic/unistd.h>
+#include <asm/unistd_64.h>
index 1e14effb39210937191ecd5a8ab97912ff1627ff..3cfafd003b2db6868f234bd53240aa6e6f715b0c 100644 (file)
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 syscall_abis_32 +=
+syscall_abis_64 += renameat newstat rlimit memfd_secret
 
 syscalltbl = arch/arm64/tools/syscall_%.tbl
index d5ffaaab31a7d1ed433e8e7bf01ae1f52848cd22..f08408b6e8263c1bcd7860c9dd049c9b1ae26ac1 100644 (file)
@@ -48,14 +48,16 @@ asmlinkage long __arm64_sys_ni_syscall(const struct pt_regs *__unused)
  */
 #define __arm64_sys_personality                __arm64_sys_arm64_personality
 
+#define __SYSCALL_WITH_COMPAT(nr, native, compat)  __SYSCALL(nr, native)
+
 #undef __SYSCALL
 #define __SYSCALL(nr, sym)     asmlinkage long __arm64_##sym(const struct pt_regs *);
-#include <asm/unistd.h>
+#include <asm/syscall_table_64.h>
 
 #undef __SYSCALL
 #define __SYSCALL(nr, sym)     [nr] = __arm64_##sym,
 
 const syscall_fn_t sys_call_table[__NR_syscalls] = {
        [0 ... __NR_syscalls - 1] = __arm64_sys_ni_syscall,
-#include <asm/unistd.h>
+#include <asm/syscall_table_64.h>
 };
index fa2251d9762d9ada612272a2bea8ab45efe69607..c2b34e76100625ab87a1506d669f2bd4954d7169 100644 (file)
@@ -3,12 +3,16 @@
 gen := arch/$(ARCH)/include/generated
 kapi := $(gen)/asm
 
-kapi-hdrs-y := $(kapi)/cpucap-defs.h $(kapi)/sysreg-defs.h
+kapisyshdr-y := cpucap-defs.h sysreg-defs.h
+
+kapi-hdrs-y := $(addprefix $(kapi)/, $(kapisyshdr-y))
 
 targets += $(addprefix ../../../, $(kapi-hdrs-y))
 
 PHONY += kapi
 
+all: $(syscall64) kapi
+
 kapi:   $(kapi-hdrs-y)
 
 quiet_cmd_gen_cpucaps = GEN     $@
diff --git a/arch/arm64/tools/syscall_64.tbl b/arch/arm64/tools/syscall_64.tbl
new file mode 120000 (symlink)
index 0000000..63135cf
--- /dev/null
@@ -0,0 +1 @@
+../../../scripts/syscall.tbl
\ No newline at end of file