Skip to contentSkip to conversation

x86: Syscall table cleanups

PATCH Applied Brian Gerst 3 participants 10 messages May 24, 2021 – May 25, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover x86: Syscall table cleanups

Here are a few patches following up to the syscall table generation patches that are now in the -tip tree.

Brian Gerst (3):
x86/uml/syscalls: Remove array index from syscall initializers x86/syscalls: Remove -Wno-override-init for syscall tables x86/syscalls: Don't sdjust CFLAGS for syscall tables

 arch/x86/entry/Makefile         | 10 ----------
 arch/x86/um/sys_call_table_32.c |  2 +-
 arch/x86/um/sys_call_table_64.c |  2 +-
 3 files changed, 2 insertions(+), 12 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/3 x86/uml/syscalls: Remove array index from syscall initializers

Commit 44fe4895f47c ("Stop filling syscall arrays with *_sys_ni_syscall") removed the index from the initializers for native x86 syscall tables, but missed the UML syscall tables.

---
 arch/x86/um/sys_call_table_32.c | 2 +-
 arch/x86/um/sys_call_table_64.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/um/sys_call_table_32.c +1 -1
index f8323104e353..0575decb5e54 100644
@@ -31,7 +31,7 @@
 #include <asm/syscalls_32.h>
 
 #undef __SYSCALL
-#define __SYSCALL(nr, sym) [ nr ] = sym,
+#define __SYSCALL(nr, sym) sym,
 
 extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
 
arch/x86/um/sys_call_table_64.c +1 -1
index 5ed665dc785f..95725b5a41ac 100644
@@ -39,7 +39,7 @@
 #include <asm/syscalls_64.h>
 
 #undef __SYSCALL
-#define __SYSCALL(nr, sym) [ nr ] = sym,
+#define __SYSCALL(nr, sym) sym,
 
 extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
 
Signature · 1 line
2.31.1
#4 lore raw

PATCH 2/3 x86/syscalls: Remove -Wno-override-init for syscall tables

In reply to Brian Gerst

Commit 44fe4895f47c ("Stop filling syscall arrays with *_sys_ni_syscall") removes the need for -Wno-override-init, since the table is now filled sequentially instead of overriding a default value.

---
 arch/x86/entry/Makefile | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/entry/Makefile +0 -4
index 08bf95dbc911..94d2843ce80c 100644
@@ -17,10 +17,6 @@ CFLAGS_syscall_64.o		+= -fno-stack-protector
 CFLAGS_syscall_32.o		+= -fno-stack-protector
 CFLAGS_syscall_x32.o		+= -fno-stack-protector
 
-CFLAGS_syscall_64.o		+= $(call cc-option,-Wno-override-init,)
-CFLAGS_syscall_32.o		+= $(call cc-option,-Wno-override-init,)
-CFLAGS_syscall_x32.o		+= $(call cc-option,-Wno-override-init,)
-
 obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y				+= common.o
 
Signature · 1 line
2.31.1
#7 lore raw

PATCH 3/3 x86/syscalls: Don't sdjust CFLAGS for syscall tables

In reply to Brian Gerst

The syscall_*.c files only contain data (the syscall tables). There is no need to adjust CFLAGS for tracing and stack protector since they contain no code.

---
 arch/x86/entry/Makefile | 6 ------
 1 file changed, 6 deletions(-)
arch/x86/entry/Makefile +0 -6
index 94d2843ce80c..7fec5dcf6438 100644
@@ -8,14 +8,8 @@ UBSAN_SANITIZE := n
 KCOV_INSTRUMENT := n
 
 CFLAGS_REMOVE_common.o		= $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_64.o	= $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_32.o	= $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_x32.o	= $(CC_FLAGS_FTRACE)
 
 CFLAGS_common.o			+= -fno-stack-protector
-CFLAGS_syscall_64.o		+= -fno-stack-protector
-CFLAGS_syscall_32.o		+= -fno-stack-protector
-CFLAGS_syscall_x32.o		+= -fno-stack-protector
 
 obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y				+= common.o
Signature · 1 line
2.31.1
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] x86/uml/syscalls: Remove array index from syscall initializers

In reply to Brian Gerst
Quoted 4 lines · Brian Gerst

Commit 44fe4895f47c ("Stop filling syscall arrays with *_sys_ni_syscall") removed the index from the initializers for native x86 syscall tables, but missed the UML syscall tables.

Ah, right.
I missed cleaning up this in UML. Thanks.

Quoted 33 lines
---
 arch/x86/um/sys_call_table_32.c | 2 +-
 arch/x86/um/sys_call_table_64.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/um/sys_call_table_32.c +1 -1
index f8323104e353..0575decb5e54 100644
@@ -31,7 +31,7 @@
 #include <asm/syscalls_32.h>
 
 #undef __SYSCALL
-#define __SYSCALL(nr, sym) [ nr ] = sym,
+#define __SYSCALL(nr, sym) sym,
 
 extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
 
arch/x86/um/sys_call_table_64.c +1 -2
index 5ed665dc785f..95725b5a41ac 100644
@@ -39,7 +39,7 @@
 #include <asm/syscalls_64.h>
 
 #undef __SYSCALL
-#define __SYSCALL(nr, sym) [ nr ] = sym,
+#define __SYSCALL(nr, sym) sym,
 
 extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
 
--
Quoted 2 lines

2.31.1

--
Best Regards
Masahiro Yamada

Reviewed-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] x86/syscalls: Remove -Wno-override-init for syscall tables

In reply to Brian Gerst
Quoted 7 lines · Brian Gerst

Commit 44fe4895f47c ("Stop filling syscall arrays with *_sys_ni_syscall") removes the need for -Wno-override-init, since the table is now filled sequentially instead of overriding a default value.

---

Quoted 19 lines
 arch/x86/entry/Makefile | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/entry/Makefile +0 -5
index 08bf95dbc911..94d2843ce80c 100644
@@ -17,10 +17,6 @@ CFLAGS_syscall_64.o          += -fno-stack-protector
 CFLAGS_syscall_32.o            += -fno-stack-protector
 CFLAGS_syscall_x32.o           += -fno-stack-protector
 
-CFLAGS_syscall_64.o            += $(call cc-option,-Wno-override-init,)
-CFLAGS_syscall_32.o            += $(call cc-option,-Wno-override-init,)
-CFLAGS_syscall_x32.o           += $(call cc-option,-Wno-override-init,)
-
 obj-y                          := entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y                          += common.o
 
--
Quoted 2 lines

2.31.1

--
Best Regards
Masahiro Yamada

Reviewed-by on v1 3/3
#8 lore raw

Re: [PATCH 3/3] x86/syscalls: Don't sdjust CFLAGS for syscall tables

In reply to Brian Gerst
Quoted 7 lines · Brian Gerst

The syscall_*.c files only contain data (the syscall tables). There is no need to adjust CFLAGS for tracing and stack protector since they contain no code.

---

Quoted 25 lines
 arch/x86/entry/Makefile | 6 ------
 1 file changed, 6 deletions(-)
arch/x86/entry/Makefile +0 -7
index 94d2843ce80c..7fec5dcf6438 100644
@@ -8,14 +8,8 @@ UBSAN_SANITIZE := n
 KCOV_INSTRUMENT := n
 
 CFLAGS_REMOVE_common.o         = $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_64.o     = $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_32.o     = $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_x32.o    = $(CC_FLAGS_FTRACE)
 
 CFLAGS_common.o                        += -fno-stack-protector
-CFLAGS_syscall_64.o            += -fno-stack-protector
-CFLAGS_syscall_32.o            += -fno-stack-protector
-CFLAGS_syscall_x32.o           += -fno-stack-protector
 
 obj-y                          := entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y                          += common.o
--

2.31.1

Signature · 2 lines
Best Regards
Masahiro Yamada
merge bot Applied
#9 lore raw

[tip: x86/entry] x86/syscalls: Don't adjust CFLAGS for syscall tables

In reply to Brian Gerst
The following commit has been merged into the x86/entry branch of tip:

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

Commit-ID:     48f7eee81cd53a94699d28959566b41a9dcac1d9
Gitweb:        https://git.kernel.org/tip/48f7eee81cd53a94699d28959566b41a9dcac1d9
Author:        Brian Gerst <[email protected]>
AuthorDate:    Mon, 24 May 2021 14:17:07 -04:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 25 May 2021 16:59:23 +02:00

x86/syscalls: Don't adjust CFLAGS for syscall tables

The syscall_*.c files only contain data (the syscall tables). There is no need to adjust CFLAGS for tracing and stack protector since they contain no code.

---
 arch/x86/entry/Makefile | 6 ------
 1 file changed, 6 deletions(-)
arch/x86/entry/Makefile +0 -6
index 94d2843..7fec5dc 100644
@@ -8,14 +8,8 @@ UBSAN_SANITIZE := n
 KCOV_INSTRUMENT := n
 
 CFLAGS_REMOVE_common.o		= $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_64.o	= $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_32.o	= $(CC_FLAGS_FTRACE)
-CFLAGS_REMOVE_syscall_x32.o	= $(CC_FLAGS_FTRACE)
 
 CFLAGS_common.o			+= -fno-stack-protector
-CFLAGS_syscall_64.o		+= -fno-stack-protector
-CFLAGS_syscall_32.o		+= -fno-stack-protector
-CFLAGS_syscall_x32.o		+= -fno-stack-protector
 
 obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y				+= common.o
merge bot Applied
#6 lore raw

[tip: x86/entry] x86/syscalls: Remove -Wno-override-init for syscall tables

In reply to Brian Gerst
The following commit has been merged into the x86/entry branch of tip:

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

Commit-ID:     fd9e8691f38712892fa2ac73132dcc8b85b07a8f
Gitweb:        https://git.kernel.org/tip/fd9e8691f38712892fa2ac73132dcc8b85b07a8f
Author:        Brian Gerst <[email protected]>
AuthorDate:    Mon, 24 May 2021 14:17:06 -04:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 25 May 2021 16:59:23 +02:00

x86/syscalls: Remove -Wno-override-init for syscall tables

Commit 44fe4895f47c ("Stop filling syscall arrays with *_sys_ni_syscall") removes the need for -Wno-override-init, since the table is now filled sequentially instead of overriding a default value.

---
 arch/x86/entry/Makefile | 4 ----
 1 file changed, 4 deletions(-)
arch/x86/entry/Makefile +0 -4
index 08bf95d..94d2843 100644
@@ -17,10 +17,6 @@ CFLAGS_syscall_64.o		+= -fno-stack-protector
 CFLAGS_syscall_32.o		+= -fno-stack-protector
 CFLAGS_syscall_x32.o		+= -fno-stack-protector
 
-CFLAGS_syscall_64.o		+= $(call cc-option,-Wno-override-init,)
-CFLAGS_syscall_32.o		+= $(call cc-option,-Wno-override-init,)
-CFLAGS_syscall_x32.o		+= $(call cc-option,-Wno-override-init,)
-
 obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y				+= common.o
 
merge bot Applied
#3 lore raw

[tip: x86/entry] x86/uml/syscalls: Remove array index from syscall initializers

In reply to Brian Gerst
The following commit has been merged into the x86/entry branch of tip:

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

Commit-ID:     d48ca5b98fa5d21444e04bb17373d339200b679a
Gitweb:        https://git.kernel.org/tip/d48ca5b98fa5d21444e04bb17373d339200b679a
Author:        Brian Gerst <[email protected]>
AuthorDate:    Mon, 24 May 2021 14:17:05 -04:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 25 May 2021 16:59:23 +02:00

x86/uml/syscalls: Remove array index from syscall initializers

The recent syscall table generator rework removed the index from the initializers for native x86 syscall tables, but missed the UML syscall tables.

Fixes 44fe4895f47c ("Stop filling syscall arrays with *_sys_ni_syscall")
---
 arch/x86/um/sys_call_table_32.c | 2 +-
 arch/x86/um/sys_call_table_64.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/um/sys_call_table_32.c +1 -1
index f832310..0575dec 100644
@@ -31,7 +31,7 @@
 #include <asm/syscalls_32.h>
 
 #undef __SYSCALL
-#define __SYSCALL(nr, sym) [ nr ] = sym,
+#define __SYSCALL(nr, sym) sym,
 
 extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
 
arch/x86/um/sys_call_table_64.c +1 -1
index 5ed665d..95725b5 100644
@@ -39,7 +39,7 @@
 #include <asm/syscalls_64.h>
 
 #undef __SYSCALL
-#define __SYSCALL(nr, sym) [ nr ] = sym,
+#define __SYSCALL(nr, sym) sym,
 
 extern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);