Generic Linux architectural discussions
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "Masahiro Yamada" <masahiroy@kernel.org>,
	linux-kernel@vger.kernel.org,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	"linux-csky@vger.kernel.org" <linux-csky@vger.kernel.org>,
	linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev,
	"linux-openrisc@vger.kernel.org" <linux-openrisc@vger.kernel.org>,
	linux-snps-arc@lists.infradead.org
Subject: Re: [GIT PULL] asm-generic updates for 6.11
Date: Wed, 17 Jul 2024 09:18:33 +0200	[thread overview]
Message-ID: <dfa20cd0-03d4-4178-a343-6387dd884e72@app.fastmail.com> (raw)
In-Reply-To: <CAHk-=wjqr_ahprUjddSBdQfSXUtg3Y2dCxHre=-Wa4VGdi7wuw@mail.gmail.com>

On Wed, Jul 17, 2024, at 07:08, Linus Torvalds wrote:
> On Tue, 16 Jul 2024 at 21:57, Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
>   ./arch/arm64/include/generated/uapi/asm/unistd_64.h
>   ./arch/arm64/include/generated/asm/syscall_table_32.h
>   ./arch/arm64/include/generated/asm/syscall_table_64.h
>   ./arch/arm64/include/generated/asm/unistd_32.h
>   ./arch/arm64/include/generated/asm/unistd_compat_32.h
>   ./include/generated/autoconf.h
>   ./usr/include/asm/unistd_64.h
>

I've tried to come up with a patch that avoids including
asm/unistd.h in most files, which would give some relief
and hopefully let you get through the merge window in 
case we can't figure out my Makefile bug quickly.

It's only a small drop in the ocean of excessive header
inclusions, but it's still a step in the right direction
I think. I'll do some more testing on other architectures
with this patch so I can send you something that works.

You can also just revert the three arm64 commits for now

d2a4a07190f4 arm64: rework compat syscall macros
e632bca07c8e arm64: generate 64-bit syscall.tbl
7fe33e9f662c arm64: convert unistd_32.h to syscall.tbl format

since the patch to remove uapi/asm-generic/unistd.h
wasn't part of the 6.11 series yet and nothing else
depends on the arm64 conversion.

      Arnd

 extern const unsigned long sys_call_table[];
diff --git a/arch/arm64/kernel/sys.c b/arch/arm64/kernel/sys.c
index f08408b6e826..274b67f02f3e 100644
--- a/arch/arm64/kernel/sys.c
+++ b/arch/arm64/kernel/sys.c
@@ -13,7 +13,7 @@
 #include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
-#include <linux/syscalls.h>
+#include <linux/syscalls_api.h>
 
 #include <asm/cpufeature.h>
 #include <asm/syscall.h>
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 72a1acd03675..9a535916dc03 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -92,6 +92,7 @@
 #include <linux/sched/coredump.h>
 #include <linux/sched/debug.h>
 #include <linux/sched/stat.h>
+#include <linux/syscalls_api.h>
 #include <linux/posix-timers.h>
 #include <linux/time_namespace.h>
 #include <linux/resctrl.h>
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index e6c00e860951..5144b80027be 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -3,7 +3,6 @@
 #define _LINUX_BINFMTS_H
 
 #include <linux/sched.h>
-#include <linux/unistd.h>
 #include <asm/exec.h>
 #include <uapi/linux/binfmts.h>
 
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 56cebaff0c91..89c307da6e5d 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -17,7 +17,6 @@
 #include <linux/fs.h>
 #include <linux/aio_abi.h>	/* for aio_context_t */
 #include <linux/uaccess.h>
-#include <linux/unistd.h>
 
 #include <asm/compat.h>
 #include <asm/siginfo.h>
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 90507d4afcd6..f1ddc1eb9290 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -9,13 +9,6 @@
 #include <linux/bug.h>			/* For BUG_ON.  */
 #include <linux/pid_namespace.h>	/* For task_active_pid_ns.  */
 #include <uapi/linux/ptrace.h>
-#include <linux/seccomp.h>
-
-/* Add sp to seccomp_data, as seccomp is user API, we don't want to modify it */
-struct syscall_info {
-	__u64			sp;
-	struct seccomp_data	data;
-};
 
 extern int ptrace_access_vm(struct task_struct *tsk, unsigned long addr,
 			    void *buf, int len, unsigned int gup_flags);
@@ -397,8 +390,6 @@ static inline void user_single_step_report(struct pt_regs *regs)
 #define exception_ip(x) instruction_pointer(x)
 #endif
 
-extern int task_current_syscall(struct task_struct *target, struct syscall_info *info);
-
 extern void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact);
 
 /*
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index fff820c3e93e..2613b8f264bb 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -86,7 +86,6 @@ struct mnt_id_req;
 #include <linux/bug.h>
 #include <linux/sem.h>
 #include <asm/siginfo.h>
-#include <linux/unistd.h>
 #include <linux/quota.h>
 #include <linux/key.h>
 #include <linux/personality.h>
diff --git a/include/linux/syscalls_api.h b/include/linux/syscalls_api.h
index 23e012b04db4..bf997576453f 100644
--- a/include/linux/syscalls_api.h
+++ b/include/linux/syscalls_api.h
@@ -1 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef _LINUX_SYSCALLS_API_H
+#define _LINUX_SYSCALLS_API_H
+
 #include <linux/syscalls.h>
+#include <linux/seccomp.h>
+#include <asm/syscall.h>
+
+/* Add sp to seccomp_data, as seccomp is user API, we don't want to modify it */
+struct syscall_info {
+	__u64			sp;
+	struct seccomp_data	data;
+};
+
+extern int task_current_syscall(struct task_struct *target, struct syscall_info *info);
+
+#endif
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 8e193f3a33b3..0dfe926e70df 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -3,7 +3,6 @@
 #define _TRACE_SYSCALL_H
 
 #include <linux/tracepoint.h>
-#include <linux/unistd.h>
 #include <linux/trace_events.h>
 #include <linux/thread_info.h>
 
diff --git a/include/uapi/linux/lsm.h b/include/uapi/linux/lsm.h
index 33d8c9f4aa6b..523a53f12d4f 100644
--- a/include/uapi/linux/lsm.h
+++ b/include/uapi/linux/lsm.h
@@ -11,7 +11,6 @@
 
 #include <linux/stddef.h>
 #include <linux/types.h>
-#include <linux/unistd.h>
 
 /**
  * struct lsm_ctx - LSM context information
diff --git a/kernel/exit.c b/kernel/exit.c
index be81342caf1b..a78a6e97615a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -13,6 +13,7 @@
 #include <linux/sched/task.h>
 #include <linux/sched/task_stack.h>
 #include <linux/sched/cputime.h>
+#include <linux/seccomp.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/capability.h>
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index d5f89f9ef29f..1067da7a8409 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -14,6 +14,7 @@
 #include <linux/sched/mm.h>
 #include <linux/sched/coredump.h>
 #include <linux/sched/task.h>
+#include <linux/seccomp.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/highmem.h>
diff --git a/lib/syscall.c b/lib/syscall.c
index 006e256d2264..5fb67b3699b9 100644
--- a/lib/syscall.c
+++ b/lib/syscall.c
@@ -3,7 +3,7 @@
 #include <linux/sched.h>
 #include <linux/sched/task_stack.h>
 #include <linux/export.h>
-#include <asm/syscall.h>
+#include <linux/syscalls_api.h>
 
 static int collect_syscall(struct task_struct *target, struct syscall_info *info)
 {

      parent reply	other threads:[~2024-07-17  7:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 21:14 [GIT PULL] asm-generic updates for 6.11 Arnd Bergmann
2024-07-16 19:25 ` pr-tracker-bot
2024-07-17  4:02 ` Linus Torvalds
2024-07-17  4:43   ` Arnd Bergmann
2024-07-17  4:57     ` Linus Torvalds
2024-07-17  5:08       ` Linus Torvalds
2024-07-17  6:01         ` Arnd Bergmann
2024-07-17  6:41           ` Johan Hovold
2024-07-17  8:01             ` Arnd Bergmann
2024-07-17  8:17               ` Johan Hovold
2024-07-17  9:36                 ` Arnd Bergmann
2024-07-17 10:54                   ` Arnd Bergmann
2024-07-17 12:45                     ` Arnd Bergmann
2024-07-17  7:18         ` Arnd Bergmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfa20cd0-03d4-4178-a343-6387dd884e72@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-openrisc@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=loongarch@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox