]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
softirq: Move do_softirq_own_stack() to generic asm header
authorThomas Gleixner <tglx@linutronix.de>
Tue, 9 Feb 2021 23:40:53 +0000 (00:40 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 10 Feb 2021 22:34:16 +0000 (23:34 +0100)
To avoid include recursion hell move the do_softirq_own_stack() related
content into a generic asm header and include it from all places in arch/
which need the prototype.

This allows architectures to provide an inline implementation of
do_softirq_own_stack() without introducing a lot of #ifdeffery all over the
place.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210210002513.289960691@linutronix.de
arch/parisc/kernel/irq.c
arch/powerpc/kernel/irq.c
arch/s390/kernel/irq.c
arch/sh/kernel/irq.c
arch/sparc/kernel/irq_64.c
arch/x86/kernel/irq_32.c
arch/x86/kernel/irq_64.c
include/asm-generic/Kbuild
include/asm-generic/softirq_stack.h [new file with mode: 0644]
include/linux/interrupt.h
kernel/softirq.c

index 49cd6d2caefb7f9e2db6098de3cbe0311e6e71c0..1632d525ad640027e6ed4259db417f6e6291b44a 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/types.h>
 #include <asm/io.h>
 
+#include <asm/softirq_stack.h>
 #include <asm/smp.h>
 #include <asm/ldcw.h>
 
index 6b1eca53e36cc834b853822a9ee7faf886bf7e04..96296d3383a79deb7463de0a747f3ab1d801640a 100644 (file)
@@ -65,6 +65,7 @@
 #include <asm/livepatch.h>
 #include <asm/asm-prototypes.h>
 #include <asm/hw_irq.h>
+#include <asm/softirq_stack.h>
 
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
index f8a8b9428ae2775a7ebf636eb5b11b595662a440..a1a2f75f3c0905283e853c675d826ac51d452d3b 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/irq.h>
 #include <asm/hw_irq.h>
 #include <asm/stacktrace.h>
+#include <asm/softirq_stack.h>
 #include "entry.h"
 
 DEFINE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
index ab5f790b0cd2778465530f38959721678a25b632..ef0f0827cf5756beb32e38d887520efe7edae6ff 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/uaccess.h>
 #include <asm/thread_info.h>
 #include <cpu/mmu_context.h>
+#include <asm/softirq_stack.h>
 
 atomic_t irq_err_count;
 
index 3ec9f1402aad357bacb23e73e65801e3ee58253d..c8848bb681a11537497d63e1f029c12fdeac2cee 100644 (file)
@@ -42,6 +42,7 @@
 #include <asm/head.h>
 #include <asm/hypervisor.h>
 #include <asm/cacheflush.h>
+#include <asm/softirq_stack.h>
 
 #include "entry.h"
 #include "cpumap.h"
index 0b79efc87be527a08b91ffb8e6849ec9743d7a95..044902d5a3c4afc37c0a422a9a980b5dbf1f4bc9 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <asm/apic.h>
 #include <asm/nospec-branch.h>
+#include <asm/softirq_stack.h>
 
 #ifdef CONFIG_DEBUG_STACKOVERFLOW
 
index b88fdb9686e64484e393855a6709ad9be53b7a41..f335c39108348811cfe9f670e1841a136f6d4fab 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/sched/task_stack.h>
 
 #include <asm/cpu_entry_area.h>
+#include <asm/softirq_stack.h>
 #include <asm/irq_stack.h>
 #include <asm/io_apic.h>
 #include <asm/apic.h>
index 267f6dfb8960b0c2131c6f91ee1bc482f8fb3993..bd684188e2dcaf52079a14f6e505c6d59ea68fc2 100644 (file)
@@ -51,6 +51,7 @@ mandatory-y += sections.h
 mandatory-y += serial.h
 mandatory-y += shmparam.h
 mandatory-y += simd.h
+mandatory-y += softirq_stack.h
 mandatory-y += switch_to.h
 mandatory-y += timex.h
 mandatory-y += tlbflush.h
diff --git a/include/asm-generic/softirq_stack.h b/include/asm-generic/softirq_stack.h
new file mode 100644 (file)
index 0000000..eceeecf
--- /dev/null
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef __ASM_GENERIC_SOFTIRQ_STACK_H
+#define __ASM_GENERIC_SOFTIRQ_STACK_H
+
+#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
+void do_softirq_own_stack(void);
+#else
+static inline void do_softirq_own_stack(void)
+{
+       __do_softirq();
+}
+#endif
+
+#endif
index f0b918f393a22e44bbe844bfb918354ddde22be6..967e2576715348c5b75c7f1a3d882d9dd14b8276 100644 (file)
@@ -569,15 +569,6 @@ struct softirq_action
 asmlinkage void do_softirq(void);
 asmlinkage void __do_softirq(void);
 
-#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
-void do_softirq_own_stack(void);
-#else
-static inline void do_softirq_own_stack(void)
-{
-       __do_softirq();
-}
-#endif
-
 extern void open_softirq(int nr, void (*action)(struct softirq_action *));
 extern void softirq_init(void);
 extern void __raise_softirq_irqoff(unsigned int nr);
index 9d71046ea247dc6aac0868881f2018f9599d072f..9908ec4a9bfed905b500e5a0040553acbb986ce1 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/tick.h>
 #include <linux/irq.h>
 
+#include <asm/softirq_stack.h>
+
 #define CREATE_TRACE_POINTS
 #include <trace/events/irq.h>