As of v5.11-rc1, 12 architectures duplicate similar shell scripts:
$ find arch -name syscalltbl.sh | sort
arch/alpha/kernel/syscalls/syscalltbl.sh
arch/arm/tools/syscalltbl.sh
arch/ia64/kernel/syscalls/syscalltbl.sh
arch/m68k/kernel/syscalls/syscalltbl.sh
arch/microblaze/kernel/syscalls/syscalltbl.sh
arch/mips/kernel/syscalls/syscalltbl.sh
arch/parisc/kernel/syscalls/syscalltbl.sh
arch/powerpc/kernel/syscalls/syscalltbl.sh
arch/sh/kernel/syscalls/syscalltbl.sh
arch/sparc/kernel/syscalls/syscalltbl.sh
arch/x86/entry/syscalls/syscalltbl.sh
arch/xtensa/kernel/syscalls/syscalltbl.sh
This patch set unifies all of them into a single file,
scripts/syscalltbl.sh.
The code-diff is attractive:
51 files changed, 254 insertions(+), 674 deletions(-)
delete mode 100644 arch/alpha/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/arm/tools/syscalltbl.sh
delete mode 100644 arch/ia64/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/m68k/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/microblaze/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/mips/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/parisc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/powerpc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/sparc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/x86/entry/syscalls/syscalltbl.sh
delete mode 100644 arch/xtensa/kernel/syscalls/syscalltbl.sh
create mode 100644 scripts/syscalltbl.sh
Also, this includes Makefile fixes, and some x86 fixes and cleanups.
My question is, how to merge this series.
I am touching all architectures, but the first patch is a prerequisite
of the rest of this series.
One possibility is to ask the x86 maintainers to pickup the first 5
patches for v5.12-rc1, and then send the rest for v5.13-rc1,
splitting per-arch.
I want the x86 maintainers to check the first 5 patches because
I cleaned up the x32 code.
I know x32 was considered for deprecation, but my motivation is to
clean-up scripts across the tree without changing the functionality.
Masahiro Yamada (27):
scripts: add generic syscalltbl.sh
x86/syscalls: fix -Wmissing-prototypes warnings from COND_SYSCALL()
x86/build: add missing FORCE and fix 'targets' to make if_changed work
x86/entry/x32: rename __x32_compat_sys_* to __x64_compat_sys_*
x86/syscalls: switch to generic syscalltbl.sh
ARM: syscalls: switch to generic syscalltbl.sh
alpha: add missing FORCE and fix 'targets' to make if_changed work
alpha: syscalls: switch to generic syscalltbl.sh
ia64: add missing FORCE and fix 'targets' to make if_changed work
ia64: syscalls: switch to generic syscalltbl.sh
m68k: add missing FORCE and fix 'targets' to make if_changed work
m68k: syscalls: switch to generic syscalltbl.sh
microblaze: add missing FORCE and fix 'targets' to make if_changed
work
microblaze: syscalls: switch to generic syscalltbl.sh
mips: add missing FORCE and fix 'targets' to make if_changed work
mips: syscalls: switch to generic syscalltbl.sh
parisc: add missing FORCE and fix 'targets' to make if_changed work
parisc: syscalls: switch to generic syscalltbl.sh
sh: add missing FORCE and fix 'targets' to make if_changed work
sh: syscalls: switch to generic syscalltbl.sh
sparc: remove wrong comment from arch/sparc/include/asm/Kbuild
sparc: add missing FORCE and fix 'targets' to make if_changed work
sparc: syscalls: switch to generic syscalltbl.sh
powerpc: add missing FORCE and fix 'targets' to make if_changed work
powerpc: syscalls: switch to generic syscalltbl.sh
xtensa: add missing FORCE and fix 'targets' to make if_changed work
xtensa: syscalls: switch to generic syscalltbl.sh
arch/alpha/kernel/syscalls/Makefile | 18 +++----
arch/alpha/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/alpha/kernel/systbls.S | 3 +-
arch/arm/kernel/entry-common.S | 8 +--
arch/arm/tools/Makefile | 9 ++--
arch/arm/tools/syscalltbl.sh | 22 --------
arch/ia64/kernel/entry.S | 3 +-
arch/ia64/kernel/syscalls/Makefile | 19 +++----
arch/ia64/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/m68k/kernel/syscalls/Makefile | 18 +++----
arch/m68k/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/m68k/kernel/syscalltable.S | 3 +-
arch/microblaze/kernel/syscall_table.S | 3 +-
arch/microblaze/kernel/syscalls/Makefile | 18 +++----
arch/microblaze/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/mips/include/asm/Kbuild | 7 ++-
arch/mips/kernel/scall32-o32.S | 4 +-
arch/mips/kernel/scall64-n32.S | 3 +-
arch/mips/kernel/scall64-n64.S | 3 +-
arch/mips/kernel/scall64-o32.S | 4 +-
arch/mips/kernel/syscalls/Makefile | 53 ++++++++-----------
arch/mips/kernel/syscalls/syscalltbl.sh | 36 -------------
arch/parisc/include/asm/Kbuild | 1 -
arch/parisc/kernel/syscall.S | 16 +++---
arch/parisc/kernel/syscalls/Makefile | 34 +++++-------
arch/parisc/kernel/syscalls/syscalltbl.sh | 36 -------------
arch/powerpc/include/asm/Kbuild | 1 -
arch/powerpc/kernel/syscalls/Makefile | 39 +++++---------
arch/powerpc/kernel/syscalls/syscalltbl.sh | 36 -------------
arch/powerpc/kernel/systbl.S | 5 +-
arch/powerpc/platforms/cell/spu_callbacks.c | 2 +-
arch/sh/kernel/syscalls/Makefile | 18 +++----
arch/sh/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/sparc/include/asm/Kbuild | 3 --
arch/sparc/kernel/syscalls/Makefile | 34 +++++-------
arch/sparc/kernel/syscalls/syscalltbl.sh | 36 -------------
arch/sparc/kernel/systbls_32.S | 4 +-
arch/sparc/kernel/systbls_64.S | 8 +--
arch/x86/entry/syscall_32.c | 12 +++--
arch/x86/entry/syscall_64.c | 9 ++--
arch/x86/entry/syscall_x32.c | 27 ++--------
arch/x86/entry/syscalls/Makefile | 33 +++++++-----
arch/x86/entry/syscalls/syscalltbl.sh | 46 ----------------
arch/x86/include/asm/Kbuild | 1 +
arch/x86/include/asm/syscall_wrapper.h | 11 ++--
arch/x86/um/sys_call_table_32.c | 8 +--
arch/x86/um/sys_call_table_64.c | 9 ++--
arch/xtensa/kernel/syscall.c | 3 +-
arch/xtensa/kernel/syscalls/Makefile | 18 +++----
arch/xtensa/kernel/syscalls/syscalltbl.sh | 32 -----------
scripts/syscalltbl.sh | 52 ++++++++++++++++++
51 files changed, 254 insertions(+), 674 deletions(-)
delete mode 100644 arch/alpha/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/arm/tools/syscalltbl.sh
delete mode 100644 arch/ia64/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/m68k/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/microblaze/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/mips/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/parisc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/powerpc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/sparc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/x86/entry/syscalls/syscalltbl.sh
delete mode 100644 arch/xtensa/kernel/syscalls/syscalltbl.sh
create mode 100644 scripts/syscalltbl.sh
--
2.27.0
In arch/x86/entry/syscall_x32.c, the macros are mapped to symbols
as follows:
__SYSCALL_COMMON(nr, sym) --> __x64_<sym>
__SYSCALL_X32(nr, sym) --> __x32_<sym>
Originally, the syscalls in the x32 special range (512-547) were all
compat.
This assumption is now broken after the following commits:
55db9c0e8534 ("net: remove compat_sys_{get,set}sockopt")
5f764d624a89 ("fs: remove the compat readv/writev syscalls")
598b3cec831f ("fs: remove compat_sys_vmsplice")
c3973b401ef2 ("mm: remove compat_process_vm_{readv,writev}")
Those commits redefined __x32_sys_* to __x64_sys_* because there is
no stub like __x32_sys_*.
I think defining as follows is sensible and cleaner.
__SYSCALL_COMMON(nr, sym) --> __x64_<sym>
__SYSCALL_X32(nr, sym) --> __x64_<sym>
The ugly #define __x32_sys_* will go away.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/x86/entry/syscall_x32.c | 16 ++--------------
arch/x86/include/asm/syscall_wrapper.h | 10 +++++-----
2 files changed, 7 insertions(+), 19 deletions(-)
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts x86 and UML to use scripts/syscalltbl.sh.
Currently, syscall_64.h mixes up x86_64 and x32 syscalls. This commit
separates syscall_64.h and syscall_x32.h.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/x86/entry/syscall_32.c | 12 +++++--
arch/x86/entry/syscall_64.c | 9 ++----
arch/x86/entry/syscall_x32.c | 15 +++------
arch/x86/entry/syscalls/Makefile | 10 ++++--
arch/x86/entry/syscalls/syscalltbl.sh | 46 ---------------------------
arch/x86/include/asm/Kbuild | 1 +
arch/x86/um/sys_call_table_32.c | 8 +++--
arch/x86/um/sys_call_table_64.c | 9 ++----
8 files changed, 34 insertions(+), 76 deletions(-)
delete mode 100644 arch/x86/entry/syscalls/syscalltbl.sh
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/alpha/kernel/syscalls/Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/x86/entry/syscalls/Makefile | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
Most of architectures generate syscall headers at the compile time
in the almost same way.
The syscall table has the same format for all architectures. Each line
has 3, 4 or 5 fields; syscall number, ABI, syscall name, native entry
point, and compat entry point. The syscall table is processed by
syscalltbl.sh script into header files.
Despite the same pattern, scripts are maintained per architecture,
which results in code duplication and bad maintainability.
As of v5.11-rc1, 12 architectures duplicate similar shell scripts:
$ find arch -name syscalltbl.sh | sort
arch/alpha/kernel/syscalls/syscalltbl.sh
arch/arm/tools/syscalltbl.sh
arch/ia64/kernel/syscalls/syscalltbl.sh
arch/m68k/kernel/syscalls/syscalltbl.sh
arch/microblaze/kernel/syscalls/syscalltbl.sh
arch/mips/kernel/syscalls/syscalltbl.sh
arch/parisc/kernel/syscalls/syscalltbl.sh
arch/powerpc/kernel/syscalls/syscalltbl.sh
arch/sh/kernel/syscalls/syscalltbl.sh
arch/sparc/kernel/syscalls/syscalltbl.sh
arch/x86/entry/syscalls/syscalltbl.sh
arch/xtensa/kernel/syscalls/syscalltbl.sh
My goal is to unify them into a single file, scripts/syscalltbl.sh.
For example, the i386 syscall table looks like this:
0 i386 restart_syscall sys_restart_syscall
1 i386 exit sys_exit
2 i386 fork sys_fork
3 i386 read sys_read
4 i386 write sys_write
5 i386 open sys_open compat_sys_open
...
scripts/syscalltbl.sh generates the following code:
__SYSCALL(0, sys_restart_syscall)
__SYSCALL(1, sys_exit)
__SYSCALL(2, sys_fork)
__SYSCALL(3, sys_read)
__SYSCALL(4, sys_write)
__SYSCALL_WITH_COMPAT(5, sys_open, compat_sys_open)
...
Then, the i386 kernel will do:
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
and the x86_64 kernel will do:
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, compat)
I noticed all 32/64 bit architectures can be covered by the same
pattern. Having an arch-specific script is fine if there is a good
reason to do so, but a single generic script should work for this case.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/syscalltbl.sh | 52 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 scripts/syscalltbl.sh
@@ -0,0 +1,52 @@+#!/bin/sh+# SPDX-License-Identifier: GPL-2.0-only+#+# Usage:+# scripts/syscalltbl.sh INFILE OUTFILE [ABIS] [OFFSET]+#+# INFILE: input syscall table+# OUTFILE: output file+# ABIS (optional): specify the ABIs to handle.+# If omitted, all lines are handled.+# OFFSET (optinal): spefify the offset of the syscall numbers.+# If omitted, the offset is zero.+#+# The syscall table format:+# nr abi name native [compat]+#+# nr: syscall number+# abi: ABI name+# name: syscall name+# native: native entry point+# compat (optional): compat entry point++set-e++in="$1"+out="$2"+abis=$(echo"($3)"|tr',''|')+offset="${4:-0}"++nxt=$offset++grep-E"^[0-9]+[[:space:]]+${abis}""$in"|sort-n|{++whilereadnrabinamenativecompat;do++nr=$((nr+$offset))++while[$nxt-lt$nr];do+echo"__SYSCALL($nxt, sys_ni_syscall)"+nxt=$((nxt+1))+done++if[-n"$compat"];then+echo"__SYSCALL_WITH_COMPAT($nr, $native, $compat)"+elif[-n"$native"];then+echo"__SYSCALL($nr, $native)"+else+echo"__SYSCALL($nr, sys_ni_syscall)"+fi+nxt=$((nr+1))+done+}>"$out"
On Thu, Jan 28, 2021 at 9:51 AM Masahiro Yamada [off-list ref] wrote:
quoted hunk
Most of architectures generate syscall headers at the compile time
in the almost same way.
The syscall table has the same format for all architectures. Each line
has 3, 4 or 5 fields; syscall number, ABI, syscall name, native entry
point, and compat entry point. The syscall table is processed by
syscalltbl.sh script into header files.
Despite the same pattern, scripts are maintained per architecture,
which results in code duplication and bad maintainability.
As of v5.11-rc1, 12 architectures duplicate similar shell scripts:
$ find arch -name syscalltbl.sh | sort
arch/alpha/kernel/syscalls/syscalltbl.sh
arch/arm/tools/syscalltbl.sh
arch/ia64/kernel/syscalls/syscalltbl.sh
arch/m68k/kernel/syscalls/syscalltbl.sh
arch/microblaze/kernel/syscalls/syscalltbl.sh
arch/mips/kernel/syscalls/syscalltbl.sh
arch/parisc/kernel/syscalls/syscalltbl.sh
arch/powerpc/kernel/syscalls/syscalltbl.sh
arch/sh/kernel/syscalls/syscalltbl.sh
arch/sparc/kernel/syscalls/syscalltbl.sh
arch/x86/entry/syscalls/syscalltbl.sh
arch/xtensa/kernel/syscalls/syscalltbl.sh
My goal is to unify them into a single file, scripts/syscalltbl.sh.
For example, the i386 syscall table looks like this:
0 i386 restart_syscall sys_restart_syscall
1 i386 exit sys_exit
2 i386 fork sys_fork
3 i386 read sys_read
4 i386 write sys_write
5 i386 open sys_open compat_sys_open
...
scripts/syscalltbl.sh generates the following code:
__SYSCALL(0, sys_restart_syscall)
__SYSCALL(1, sys_exit)
__SYSCALL(2, sys_fork)
__SYSCALL(3, sys_read)
__SYSCALL(4, sys_write)
__SYSCALL_WITH_COMPAT(5, sys_open, compat_sys_open)
...
Then, the i386 kernel will do:
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
and the x86_64 kernel will do:
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, compat)
I noticed all 32/64 bit architectures can be covered by the same
pattern. Having an arch-specific script is fine if there is a good
reason to do so, but a single generic script should work for this case.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/syscalltbl.sh | 52 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 scripts/syscalltbl.sh
@@ -0,0 +1,52 @@+#!/bin/sh+# SPDX-License-Identifier: GPL-2.0-only+#+# Usage:+# scripts/syscalltbl.sh INFILE OUTFILE [ABIS] [OFFSET]+#+# INFILE: input syscall table+# OUTFILE: output file+# ABIS (optional): specify the ABIs to handle.+# If omitted, all lines are handled.+# OFFSET (optinal): spefify the offset of the syscall numbers.+# If omitted, the offset is zero.+#+# The syscall table format:+# nr abi name native [compat]
This line should be
nr abi name [native] [compat]
because the native entry point is also optional.
(if it is missing, sys_ni_syscall is used)
+#
+# nr: syscall number
+# abi: ABI name
+# name: syscall name
+# native: native entry point
native (optional): native entry point
+# compat (optional): compat entry point
+
+set -e
+
+in="$1"
+out="$2"
+abis=$(echo "($3)" | tr ',' '|')
+offset="${4:-0}"
+
+nxt=$offset
+
+grep -E "^[0-9]+[[:space:]]+${abis}" "$in" | sort -n | {
+
+ while read nr abi name native compat ; do
+
+ nr=$((nr + $offset))
+
+ while [ $nxt -lt $nr ]; do
+ echo "__SYSCALL($nxt, sys_ni_syscall)"
+ nxt=$((nxt + 1))
+ done
+
+ if [ -n "$compat" ]; then
+ echo "__SYSCALL_WITH_COMPAT($nr, $native, $compat)"
+ elif [ -n "$native" ]; then
+ echo "__SYSCALL($nr, $native)"
+ else
+ echo "__SYSCALL($nr, sys_ni_syscall)"
+ fi
+ nxt=$((nr + 1))
+ done
+} > "$out"
--
2.27.0
Building kernel/sys_ni.c with W=1 omits tons of -Wmissing-prototypes
warnings.
$ make W=1 kernel/sys_ni.o
[ snip ]
CC kernel/sys_ni.o
In file included from kernel/sys_ni.c:10:
./arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_io_setup' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
./arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
./arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:39:1: note: in expansion of macro 'COND_SYSCALL'
39 | COND_SYSCALL(io_setup);
| ^~~~~~~~~~~~
./arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__ia32_sys_io_setup' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
./arch/x86/include/asm/syscall_wrapper.h:120:2: note: in expansion of macro '__COND_SYSCALL'
120 | __COND_SYSCALL(ia32, sys_##name)
| ^~~~~~~~~~~~~~
./arch/x86/include/asm/syscall_wrapper.h:257:2: note: in expansion of macro '__IA32_COND_SYSCALL'
257 | __IA32_COND_SYSCALL(name)
| ^~~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:39:1: note: in expansion of macro 'COND_SYSCALL'
39 | COND_SYSCALL(io_setup);
| ^~~~~~~~~~~~
...
__SYS_STUB0() and __SYS_STUBx() defined a few lines above have forward
declarations. Let's do likewise for __COND_SYSCALL() to fix the
warnings.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/x86/include/asm/syscall_wrapper.h | 1 +
1 file changed, 1 insertion(+)
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts ARM to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/arm/kernel/entry-common.S | 8 ++++----
arch/arm/tools/Makefile | 9 ++++-----
arch/arm/tools/syscalltbl.sh | 22 ----------------------
3 files changed, 8 insertions(+), 31 deletions(-)
delete mode 100644 arch/arm/tools/syscalltbl.sh
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/ia64/kernel/syscalls/Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts sparc to use scripts/syscalltbl.sh. This also
unifies syscall_table_64.h and syscall_table_c32.h.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/sparc/include/asm/Kbuild | 1 -
arch/sparc/kernel/syscalls/Makefile | 19 ++++---------
arch/sparc/kernel/syscalls/syscalltbl.sh | 36 ------------------------
arch/sparc/kernel/systbls_32.S | 4 +--
arch/sparc/kernel/systbls_64.S | 8 ++++--
5 files changed, 12 insertions(+), 56 deletions(-)
delete mode 100644 arch/sparc/kernel/syscalls/syscalltbl.sh
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts ia64 to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/ia64/kernel/entry.S | 3 +--
arch/ia64/kernel/syscalls/Makefile | 8 ++-----
arch/ia64/kernel/syscalls/syscalltbl.sh | 32 -------------------------
3 files changed, 3 insertions(+), 40 deletions(-)
delete mode 100644 arch/ia64/kernel/syscalls/syscalltbl.sh
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts xtensa to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/xtensa/kernel/syscall.c | 3 +--
arch/xtensa/kernel/syscalls/Makefile | 7 ++---
arch/xtensa/kernel/syscalls/syscalltbl.sh | 32 -----------------------
3 files changed, 3 insertions(+), 39 deletions(-)
delete mode 100644 arch/xtensa/kernel/syscalls/syscalltbl.sh
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts alpha to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/alpha/kernel/syscalls/Makefile | 7 ++----
arch/alpha/kernel/syscalls/syscalltbl.sh | 32 ------------------------
arch/alpha/kernel/systbls.S | 3 +--
3 files changed, 3 insertions(+), 39 deletions(-)
delete mode 100644 arch/alpha/kernel/syscalls/syscalltbl.sh
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts m68k to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/m68k/kernel/syscalls/Makefile | 7 ++----
arch/m68k/kernel/syscalls/syscalltbl.sh | 32 -------------------------
arch/m68k/kernel/syscalltable.S | 3 +--
3 files changed, 3 insertions(+), 39 deletions(-)
delete mode 100644 arch/m68k/kernel/syscalls/syscalltbl.sh
Hi Yamada-san,
On Thu, Jan 28, 2021 at 1:54 AM Masahiro Yamada [off-list ref] wrote:
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts m68k to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Thanks a lot!
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/parisc/kernel/syscalls/Makefile | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/m68k/kernel/syscalls/Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
On Thu, Jan 28, 2021 at 1:54 AM Masahiro Yamada [off-list ref] wrote:
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/powerpc/kernel/syscalls/Makefile | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts mips to use scripts/syscalltbl.sh. This also
unifies syscall_table_32_o32.h and syscall_table_64_o32.h into
syscall_table_o32.h.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/mips/include/asm/Kbuild | 7 +++--
arch/mips/kernel/scall32-o32.S | 4 +--
arch/mips/kernel/scall64-n32.S | 3 +--
arch/mips/kernel/scall64-n64.S | 3 +--
arch/mips/kernel/scall64-o32.S | 4 +--
arch/mips/kernel/syscalls/Makefile | 34 ++++++++---------------
arch/mips/kernel/syscalls/syscalltbl.sh | 36 -------------------------
7 files changed, 20 insertions(+), 71 deletions(-)
delete mode 100644 arch/mips/kernel/syscalls/syscalltbl.sh
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts sh to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/sh/kernel/syscalls/Makefile | 7 ++----
arch/sh/kernel/syscalls/syscalltbl.sh | 32 ---------------------------
2 files changed, 2 insertions(+), 37 deletions(-)
delete mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/mips/kernel/syscalls/Makefile | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts powerpc to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/powerpc/include/asm/Kbuild | 1 -
arch/powerpc/kernel/syscalls/Makefile | 22 +++----------
arch/powerpc/kernel/syscalls/syscalltbl.sh | 36 ---------------------
arch/powerpc/kernel/systbl.S | 5 ++-
arch/powerpc/platforms/cell/spu_callbacks.c | 2 +-
5 files changed, 10 insertions(+), 56 deletions(-)
delete mode 100644 arch/powerpc/kernel/syscalls/syscalltbl.sh
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/xtensa/kernel/syscalls/Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/sparc/kernel/syscalls/Makefile | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/microblaze/kernel/syscalls/Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts microblaze to use scripts/syscalltbl.sh.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/microblaze/kernel/syscall_table.S | 3 +-
arch/microblaze/kernel/syscalls/Makefile | 7 ++--
arch/microblaze/kernel/syscalls/syscalltbl.sh | 32 -------------------
3 files changed, 3 insertions(+), 39 deletions(-)
delete mode 100644 arch/microblaze/kernel/syscalls/syscalltbl.sh
These are NOT exported to userspace.
The headers listed in arch/sparc/include/uapi/asm/Kbuild are exported.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/sparc/include/asm/Kbuild | 2 --
1 file changed, 2 deletions(-)
On Thu, Jan 28, 2021 at 9:52 AM Masahiro Yamada [off-list ref] wrote:
These are NOT exported to userspace.
The headers listed in arch/sparc/include/uapi/asm/Kbuild are exported.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
The rules in this Makefile cannot detect the command line change because
the prerequisite 'FORCE' is missing.
Adding 'FORCE' will result in the headers being rebuilt every time
because the 'targets' addition is also wrong; the file paths in
'targets' must be relative to the current Makefile.
Fix all of them so the if_changed rules work correctly.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/sh/kernel/syscalls/Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts parisc to use scripts/syscalltbl.sh. This also
unifies syscall_table_64.h and syscall_table_c32.h.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/parisc/include/asm/Kbuild | 1 -
arch/parisc/kernel/syscall.S | 16 +++++-----
arch/parisc/kernel/syscalls/Makefile | 19 ++++--------
arch/parisc/kernel/syscalls/syscalltbl.sh | 36 -----------------------
4 files changed, 12 insertions(+), 60 deletions(-)
delete mode 100644 arch/parisc/kernel/syscalls/syscalltbl.sh
As of v5.11-rc1, 12 architectures duplicate similar shell scripts in
order to generate syscall table headers. My goal is to unify them into
the single scripts/syscalltbl.sh.
This commit converts parisc to use scripts/syscalltbl.sh. This also
unifies syscall_table_64.h and syscall_table_c32.h.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Thanks for the cleanup!
You may add:
Acked-by: Helge Deller <deller@gmx.de> # parisc
Helge
On Thu, Jan 28, 2021 at 9:51 AM Masahiro Yamada [off-list ref] wrote:
As of v5.11-rc1, 12 architectures duplicate similar shell scripts:
$ find arch -name syscalltbl.sh | sort
arch/alpha/kernel/syscalls/syscalltbl.sh
arch/arm/tools/syscalltbl.sh
arch/ia64/kernel/syscalls/syscalltbl.sh
arch/m68k/kernel/syscalls/syscalltbl.sh
arch/microblaze/kernel/syscalls/syscalltbl.sh
arch/mips/kernel/syscalls/syscalltbl.sh
arch/parisc/kernel/syscalls/syscalltbl.sh
arch/powerpc/kernel/syscalls/syscalltbl.sh
arch/sh/kernel/syscalls/syscalltbl.sh
arch/sparc/kernel/syscalls/syscalltbl.sh
arch/x86/entry/syscalls/syscalltbl.sh
arch/xtensa/kernel/syscalls/syscalltbl.sh
This patch set unifies all of them into a single file,
scripts/syscalltbl.sh.
The code-diff is attractive:
51 files changed, 254 insertions(+), 674 deletions(-)
delete mode 100644 arch/alpha/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/arm/tools/syscalltbl.sh
delete mode 100644 arch/ia64/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/m68k/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/microblaze/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/mips/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/parisc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/powerpc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/sparc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/x86/entry/syscalls/syscalltbl.sh
delete mode 100644 arch/xtensa/kernel/syscalls/syscalltbl.sh
create mode 100644 scripts/syscalltbl.sh
Also, this includes Makefile fixes, and some x86 fixes and cleanups.
My question is, how to merge this series.
I am touching all architectures, but the first patch is a prerequisite
of the rest of this series.
One possibility is to ask the x86 maintainers to pickup the first 5
patches for v5.12-rc1, and then send the rest for v5.13-rc1,
splitting per-arch.
I want the x86 maintainers to check the first 5 patches because
I cleaned up the x32 code.
Never mind.
Sending too big patch set tends to fail.
I will apply the generic script parts to my tree,
then split the rest per arch in the next development cycle
(aim for v5.13-rc1)
I know x32 was considered for deprecation, but my motivation is to
clean-up scripts across the tree without changing the functionality.
Masahiro Yamada (27):
scripts: add generic syscalltbl.sh
x86/syscalls: fix -Wmissing-prototypes warnings from COND_SYSCALL()
x86/build: add missing FORCE and fix 'targets' to make if_changed work
x86/entry/x32: rename __x32_compat_sys_* to __x64_compat_sys_*
x86/syscalls: switch to generic syscalltbl.sh
ARM: syscalls: switch to generic syscalltbl.sh
alpha: add missing FORCE and fix 'targets' to make if_changed work
alpha: syscalls: switch to generic syscalltbl.sh
ia64: add missing FORCE and fix 'targets' to make if_changed work
ia64: syscalls: switch to generic syscalltbl.sh
m68k: add missing FORCE and fix 'targets' to make if_changed work
m68k: syscalls: switch to generic syscalltbl.sh
microblaze: add missing FORCE and fix 'targets' to make if_changed
work
microblaze: syscalls: switch to generic syscalltbl.sh
mips: add missing FORCE and fix 'targets' to make if_changed work
mips: syscalls: switch to generic syscalltbl.sh
parisc: add missing FORCE and fix 'targets' to make if_changed work
parisc: syscalls: switch to generic syscalltbl.sh
sh: add missing FORCE and fix 'targets' to make if_changed work
sh: syscalls: switch to generic syscalltbl.sh
sparc: remove wrong comment from arch/sparc/include/asm/Kbuild
sparc: add missing FORCE and fix 'targets' to make if_changed work
sparc: syscalls: switch to generic syscalltbl.sh
powerpc: add missing FORCE and fix 'targets' to make if_changed work
powerpc: syscalls: switch to generic syscalltbl.sh
xtensa: add missing FORCE and fix 'targets' to make if_changed work
xtensa: syscalls: switch to generic syscalltbl.sh
arch/alpha/kernel/syscalls/Makefile | 18 +++----
arch/alpha/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/alpha/kernel/systbls.S | 3 +-
arch/arm/kernel/entry-common.S | 8 +--
arch/arm/tools/Makefile | 9 ++--
arch/arm/tools/syscalltbl.sh | 22 --------
arch/ia64/kernel/entry.S | 3 +-
arch/ia64/kernel/syscalls/Makefile | 19 +++----
arch/ia64/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/m68k/kernel/syscalls/Makefile | 18 +++----
arch/m68k/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/m68k/kernel/syscalltable.S | 3 +-
arch/microblaze/kernel/syscall_table.S | 3 +-
arch/microblaze/kernel/syscalls/Makefile | 18 +++----
arch/microblaze/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/mips/include/asm/Kbuild | 7 ++-
arch/mips/kernel/scall32-o32.S | 4 +-
arch/mips/kernel/scall64-n32.S | 3 +-
arch/mips/kernel/scall64-n64.S | 3 +-
arch/mips/kernel/scall64-o32.S | 4 +-
arch/mips/kernel/syscalls/Makefile | 53 ++++++++-----------
arch/mips/kernel/syscalls/syscalltbl.sh | 36 -------------
arch/parisc/include/asm/Kbuild | 1 -
arch/parisc/kernel/syscall.S | 16 +++---
arch/parisc/kernel/syscalls/Makefile | 34 +++++-------
arch/parisc/kernel/syscalls/syscalltbl.sh | 36 -------------
arch/powerpc/include/asm/Kbuild | 1 -
arch/powerpc/kernel/syscalls/Makefile | 39 +++++---------
arch/powerpc/kernel/syscalls/syscalltbl.sh | 36 -------------
arch/powerpc/kernel/systbl.S | 5 +-
arch/powerpc/platforms/cell/spu_callbacks.c | 2 +-
arch/sh/kernel/syscalls/Makefile | 18 +++----
arch/sh/kernel/syscalls/syscalltbl.sh | 32 -----------
arch/sparc/include/asm/Kbuild | 3 --
arch/sparc/kernel/syscalls/Makefile | 34 +++++-------
arch/sparc/kernel/syscalls/syscalltbl.sh | 36 -------------
arch/sparc/kernel/systbls_32.S | 4 +-
arch/sparc/kernel/systbls_64.S | 8 +--
arch/x86/entry/syscall_32.c | 12 +++--
arch/x86/entry/syscall_64.c | 9 ++--
arch/x86/entry/syscall_x32.c | 27 ++--------
arch/x86/entry/syscalls/Makefile | 33 +++++++-----
arch/x86/entry/syscalls/syscalltbl.sh | 46 ----------------
arch/x86/include/asm/Kbuild | 1 +
arch/x86/include/asm/syscall_wrapper.h | 11 ++--
arch/x86/um/sys_call_table_32.c | 8 +--
arch/x86/um/sys_call_table_64.c | 9 ++--
arch/xtensa/kernel/syscall.c | 3 +-
arch/xtensa/kernel/syscalls/Makefile | 18 +++----
arch/xtensa/kernel/syscalls/syscalltbl.sh | 32 -----------
scripts/syscalltbl.sh | 52 ++++++++++++++++++
51 files changed, 254 insertions(+), 674 deletions(-)
delete mode 100644 arch/alpha/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/arm/tools/syscalltbl.sh
delete mode 100644 arch/ia64/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/m68k/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/microblaze/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/mips/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/parisc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/powerpc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/sh/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/sparc/kernel/syscalls/syscalltbl.sh
delete mode 100644 arch/x86/entry/syscalls/syscalltbl.sh
delete mode 100644 arch/xtensa/kernel/syscalls/syscalltbl.sh
create mode 100644 scripts/syscalltbl.sh
--
2.27.0