Skip to contentSkip to conversation

entry: Split generic entry into generic exception and syscall entry

PATCH Applied Linus Walleij 4 participants 4 messages Jun 24, 2025 – Jul 1, 2025

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

PATCH 1/1 entry: Split generic entry into generic exception and syscall entry

From: Jinjie Ruan <[email protected]>

Currently CONFIG_GENERIC_ENTRY enables both the generic exception entry logic and the generic syscall entry logic, which are otherwise loosely coupled.

Introduce separate config options for these so that architectures can select the two independently. This will make it easier for architectures to migrate to generic entry code.

---
This was split off from Jinjie's series for ARM64 generic entry and rebased.

It is needed to split both the ARM64 and ARM32 generic entry patches in two parts.

---
 MAINTAINERS                      |   1 +
 arch/Kconfig                     |   9 +
 include/linux/entry-common.h     | 382 +-------------------------------------
 include/linux/irq-entry-common.h | 389 +++++++++++++++++++++++++++++++++++++++
 kernel/entry/Makefile            |   3 +-
 kernel/entry/common.c            | 113 +-----------
 kernel/entry/syscall-common.c    | 112 +++++++++++
 kernel/sched/core.c              |   8 +-
 8 files changed, 519 insertions(+), 498 deletions(-)
MAINTAINERS +1 -0
index a92290fffa163f9fe8fe3f04bf66426f9a894409..e92292a0e480dfb478362944be1f5a3ef53c4531 100644
@@ -10052,6 +10052,7 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry
 F:	include/linux/entry-common.h
 F:	include/linux/entry-kvm.h
+F:	include/linux/irq-entry-common.h
 F:	kernel/entry/
 
 GENERIC GPIO I2C DRIVER
arch/Kconfig +9 -0
index a3308a220f86413085cdd101611b689078b998be..9233fbfd8dd32d9a4656488843e9825ff99d6bd8 100644
@@ -64,8 +64,17 @@ config HOTPLUG_PARALLEL
 	bool
 	select HOTPLUG_SPLIT_STARTUP
 
+config GENERIC_IRQ_ENTRY
+	bool
+
+config GENERIC_SYSCALL
+	bool
+	depends on GENERIC_IRQ_ENTRY
+
 config GENERIC_ENTRY
 	bool
+	select GENERIC_IRQ_ENTRY
+	select GENERIC_SYSCALL
 
 config KPROBES
 	bool "Kprobes"
include/linux/entry-common.h +1 -381

413 lines not on this page · raw message

include/linux/irq-entry-common.h new file +389 -0

389 lines not on this page · raw message

kernel/entry/Makefile +2 -1
index d4b8bd0af79b0d7334041d3ee9b5459b598905c1..77fcd83dd663139bd96a102bfee7f65822e941b3 100644
@@ -12,5 +12,6 @@ ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING
 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_IRQ_ENTRY) 	+= common.o
+obj-$(CONFIG_GENERIC_SYSCALL) 		+= syscall-common.o syscall_user_dispatch.o
 obj-$(CONFIG_KVM_XFER_TO_GUEST_WORK)	+= kvm.o
kernel/entry/common.c +1 -112

131 lines not on this page · raw message

kernel/entry/syscall-common.c new file +112 -0

112 lines not on this page · raw message

kernel/sched/core.c +4 -4
index dce50fa57471dffc4311b9d393ae300a43d38d20..e6269e7954f3cbaac322a68f1f85c4ef3e95cc73 100644
@@ -69,8 +69,8 @@
 #include <linux/livepatch_sched.h>
 
 #ifdef CONFIG_PREEMPT_DYNAMIC
-# ifdef CONFIG_GENERIC_ENTRY
-#  include <linux/entry-common.h>
+# ifdef CONFIG_GENERIC_IRQ_ENTRY
+#  include <linux/irq-entry-common.h>
 # endif
 #endif
 
@@ -7427,8 +7427,8 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write);
 
 #ifdef CONFIG_PREEMPT_DYNAMIC
 
-#ifdef CONFIG_GENERIC_ENTRY
-#include <linux/entry-common.h>
+#ifdef CONFIG_GENERIC_IRQ_ENTRY
+#include <linux/irq-entry-common.h>
 #endif
 
 /*

---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250624-generic-entry-split-b744494637b1

Best regards,

Signature · 1 line
Linus Walleij <[email protected]>
#1 lore raw
Quoted 10 lines · Linus Walleij

From: Jinjie Ruan <[email protected]>

Currently CONFIG_GENERIC_ENTRY enables both the generic exception entry logic and the generic syscall entry logic, which are otherwise loosely coupled.

Introduce separate config options for these so that architectures can select the two independently. This will make it easier for architectures to migrate to generic entry code.

Quoted 6 lines

I merged this into tip based of v6.16-rc1 and tagged it so the commit can be pulled into arm[64] trees if needed.

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git entry-split-for-arm

Thanks,

tglx

#2 lore raw
Quoted 18 lines · Thomas Gleixner
Quoted 10 lines · Linus Walleij

From: Jinjie Ruan <[email protected]>

Currently CONFIG_GENERIC_ENTRY enables both the generic exception entry logic and the generic syscall entry logic, which are otherwise loosely coupled.

Introduce separate config options for these so that architectures can select the two independently. This will make it easier for architectures to migrate to generic entry code.

Quoted 6 lines
Quoted 4 lines

I merged this into tip based of v6.16-rc1 and tagged it so the commit can be pulled into arm[64] trees if needed.

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git entry-split-for-arm

Thanks, much appreciated!

Mark.

merge bot Applied
#3 lore raw
In reply to Linus Walleij
The following commit has been merged into the core/entry branch of tip:

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

Commit-ID:     a70e9f647f501e36a6a092888b1ea7386b7c5664
Gitweb:        https://git.kernel.org/tip/a70e9f647f501e36a6a092888b1ea7386b7c5664
Author:        Jinjie Ruan <[email protected]>
AuthorDate:    Tue, 24 Jun 2025 20:35:56 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 30 Jun 2025 19:52:55 +02:00

entry: Split generic entry into generic exception and syscall entry

Currently CONFIG_GENERIC_ENTRY enables both the generic exception entry logic and the generic syscall entry logic, which are otherwise loosely coupled.

Introduce separate config options for these so that architectures can select the two independently. This will make it easier for architectures to migrate to generic entry code.

[Linus Walleij: rebase onto v6.16-rc1]

---
 MAINTAINERS                      |   1 +-
 arch/Kconfig                     |   9 +-
 include/linux/entry-common.h     | 382 +-----------------------------
 include/linux/irq-entry-common.h | 389 ++++++++++++++++++++++++++++++-
 kernel/entry/Makefile            |   3 +-
 kernel/entry/common.c            | 113 +---------
 kernel/entry/syscall-common.c    | 112 +++++++++-
 kernel/sched/core.c              |   8 +-
 8 files changed, 519 insertions(+), 498 deletions(-)
 create mode 100644 include/linux/irq-entry-common.h
 create mode 100644 kernel/entry/syscall-common.c
MAINTAINERS +1 -0
index a92290f..e92292a 100644
@@ -10052,6 +10052,7 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry
 F:	include/linux/entry-common.h
 F:	include/linux/entry-kvm.h
+F:	include/linux/irq-entry-common.h
 F:	kernel/entry/
 
 GENERIC GPIO I2C DRIVER
arch/Kconfig +9 -0
index a3308a2..9233fbf 100644
@@ -64,8 +64,17 @@ config HOTPLUG_PARALLEL
 	bool
 	select HOTPLUG_SPLIT_STARTUP
 
+config GENERIC_IRQ_ENTRY
+	bool
+
+config GENERIC_SYSCALL
+	bool
+	depends on GENERIC_IRQ_ENTRY
+
 config GENERIC_ENTRY
 	bool
+	select GENERIC_IRQ_ENTRY
+	select GENERIC_SYSCALL
 
 config KPROBES
 	bool "Kprobes"
include/linux/entry-common.h +1 -381

413 lines not on this page · raw message

include/linux/irq-entry-common.h new file +389 -0

389 lines not on this page · raw message

kernel/entry/Makefile +2 -1
index d4b8bd0..77fcd83 100644
@@ -12,5 +12,6 @@ ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING
 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_IRQ_ENTRY) 	+= common.o
+obj-$(CONFIG_GENERIC_SYSCALL) 		+= syscall-common.o syscall_user_dispatch.o
 obj-$(CONFIG_KVM_XFER_TO_GUEST_WORK)	+= kvm.o
kernel/entry/common.c +1 -112

131 lines not on this page · raw message

kernel/entry/syscall-common.c new file +112 -0

112 lines not on this page · raw message

kernel/sched/core.c +4 -4
index dce50fa..e6269e7 100644
@@ -69,8 +69,8 @@
 #include <linux/livepatch_sched.h>
 
 #ifdef CONFIG_PREEMPT_DYNAMIC
-# ifdef CONFIG_GENERIC_ENTRY
-#  include <linux/entry-common.h>
+# ifdef CONFIG_GENERIC_IRQ_ENTRY
+#  include <linux/irq-entry-common.h>
 # endif
 #endif
 
@@ -7427,8 +7427,8 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write);
 
 #ifdef CONFIG_PREEMPT_DYNAMIC
 
-#ifdef CONFIG_GENERIC_ENTRY
-#include <linux/entry-common.h>
+#ifdef CONFIG_GENERIC_IRQ_ENTRY
+#include <linux/irq-entry-common.h>
 #endif
 
 /*