linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: houdek.ryan@fex-emu.org
To: unlisted-recipients:; (no To-header on input)
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Ryan Houdek <Houdek.Ryan@fex-emu.org>
Subject: [PATCH 1/4] Move userspace syscall dispatch outside of common entry
Date: Sat, 29 May 2021 01:16:17 -0700	[thread overview]
Message-ID: <20210529081620.164422-2-Houdek.Ryan@fex-emu.org> (raw)
In-Reply-To: <20210529081620.164422-1-Houdek.Ryan@fex-emu.org>

From: Ryan Houdek <Houdek.Ryan@fex-emu.org>

This will allow other architectures to support userspace syscall
dispatch without supporting the syscall common entry.

Signed-off-by: Ryan Houdek <Houdek.Ryan@fex-emu.org>
---
 arch/Kconfig                          | 4 ++++
 include/linux/syscall_user_dispatch.h | 4 +++-
 kernel/entry/Makefile                 | 3 ++-
 kernel/entry/common.c                 | 3 +--
 kernel/entry/common.h                 | 7 -------
 kernel/entry/syscall_user_dispatch.c  | 2 --
 6 files changed, 10 insertions(+), 13 deletions(-)
 delete mode 100644 kernel/entry/common.h

diff --git a/arch/Kconfig b/arch/Kconfig
index c45b770d3579..def67ebbae83 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -30,7 +30,11 @@ config SET_FS
 config HOTPLUG_SMT
 	bool
 
+config SYSCALL_USER_DISPATCH
+       bool
+
 config GENERIC_ENTRY
+       select SYSCALL_USER_DISPATCH
        bool
 
 config KPROBES
diff --git a/include/linux/syscall_user_dispatch.h b/include/linux/syscall_user_dispatch.h
index a0ae443fb7df..9d1e244d7021 100644
--- a/include/linux/syscall_user_dispatch.h
+++ b/include/linux/syscall_user_dispatch.h
@@ -7,7 +7,7 @@
 
 #include <linux/thread_info.h>
 
-#ifdef CONFIG_GENERIC_ENTRY
+#ifdef CONFIG_SYSCALL_USER_DISPATCH
 
 struct syscall_user_dispatch {
 	char __user	*selector;
@@ -16,6 +16,8 @@ struct syscall_user_dispatch {
 	bool		on_dispatch;
 };
 
+bool syscall_user_dispatch(struct pt_regs *regs);
+
 int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
 			      unsigned long len, char __user *selector);
 
diff --git a/kernel/entry/Makefile b/kernel/entry/Makefile
index 095c775e001e..35684390d56e 100644
--- a/kernel/entry/Makefile
+++ b/kernel/entry/Makefile
@@ -9,5 +9,6 @@ KCOV_INSTRUMENT := n
 CFLAGS_REMOVE_common.o	 = -fstack-protector -fstack-protector-strong
 CFLAGS_common.o		+= -fno-stack-protector
 
-obj-$(CONFIG_GENERIC_ENTRY) 		+= common.o syscall_user_dispatch.o
+obj-$(CONFIG_GENERIC_ENTRY) 		+= common.o
+obj-$(CONFIG_SYSCALL_USER_DISPATCH)	+= syscall_user_dispatch.o
 obj-$(CONFIG_KVM_XFER_TO_GUEST_WORK)	+= kvm.o
diff --git a/kernel/entry/common.c b/kernel/entry/common.c
index a0b3b04fb596..84ea1e66e0b2 100644
--- a/kernel/entry/common.c
+++ b/kernel/entry/common.c
@@ -5,8 +5,7 @@
 #include <linux/highmem.h>
 #include <linux/livepatch.h>
 #include <linux/audit.h>
-
-#include "common.h"
+#include <linux/syscall_user_dispatch.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/syscalls.h>
diff --git a/kernel/entry/common.h b/kernel/entry/common.h
deleted file mode 100644
index f6e6d02f07fe..000000000000
--- a/kernel/entry/common.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _COMMON_H
-#define _COMMON_H
-
-bool syscall_user_dispatch(struct pt_regs *regs);
-
-#endif
diff --git a/kernel/entry/syscall_user_dispatch.c b/kernel/entry/syscall_user_dispatch.c
index c240302f56e2..352da8427b01 100644
--- a/kernel/entry/syscall_user_dispatch.c
+++ b/kernel/entry/syscall_user_dispatch.c
@@ -14,8 +14,6 @@
 
 #include <asm/syscall.h>
 
-#include "common.h"
-
 static void trigger_sigsys(struct pt_regs *regs)
 {
 	struct kernel_siginfo info;
-- 
2.30.2


  reply	other threads:[~2021-05-29  8:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-29  8:16 [PATCH 0/4] arm64: Implement userspace syscall dispatch houdek.ryan
2021-05-29  8:16 ` houdek.ryan [this message]
2021-06-02 15:41   ` [PATCH 1/4] Move userspace syscall dispatch outside of common entry Thomas Gleixner
2021-06-03 10:58     ` Ryan Houdek
2021-05-29  8:16 ` [PATCH 2/4] arm64: Track the sigreturn landing pad location houdek.ryan
2021-05-29  8:16 ` [PATCH 3/4] arm64: Enable userspace syscall dispatch houdek.ryan
2021-05-29  8:16 ` [PATCH 4/4] arm64: tools: Update syscall user dispatch tests houdek.ryan

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=20210529081620.164422-2-Houdek.Ryan@fex-emu.org \
    --to=houdek.ryan@fex-emu.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).