softirq: Move __ARCH_HAS_DO_SOFTIRQ to Kconfig
authorThomas Gleixner <tglx@linutronix.de>
Tue, 9 Feb 2021 23:40:52 +0000 (00:40 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 10 Feb 2021 22:34:16 +0000 (23:34 +0100)
To prepare for inlining do_softirq_own_stack() replace
__ARCH_HAS_DO_SOFTIRQ with a Kconfig switch and select it in the affected
architectures.

This allows in the next step to move the function prototype and the inline
stub into a seperate asm-generic header file which is required to avoid
include recursion.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210210002513.181713427@linutronix.de
14 files changed:
arch/Kconfig
arch/parisc/Kconfig
arch/parisc/include/asm/hardirq.h
arch/powerpc/Kconfig
arch/powerpc/include/asm/irq.h
arch/s390/Kconfig
arch/s390/include/asm/hardirq.h
arch/sh/Kconfig
arch/sh/include/asm/irq.h
arch/sparc/Kconfig
arch/sparc/include/asm/irq_64.h
arch/x86/Kconfig
arch/x86/include/asm/irq.h
include/linux/interrupt.h

index 24862d1..7eab9d0 100644 (file)
@@ -759,6 +759,12 @@ config HAVE_IRQ_EXIT_ON_IRQ_STACK
          This spares a stack switch and improves cache usage on softirq
          processing.
 
+config HAVE_SOFTIRQ_ON_OWN_STACK
+       bool
+       help
+         Architecture provides a function to run __do_softirq() on a
+         seperate stack.
+
 config PGTABLE_LEVELS
        int
        default 2
index 78b1762..7cd88c0 100644 (file)
@@ -63,6 +63,7 @@ config PARISC
        select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE
        select HAVE_KPROBES_ON_FTRACE
        select HAVE_DYNAMIC_FTRACE_WITH_REGS
+       select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS
        select SET_FS
 
        help
index fad29aa..1e4fbd0 100644 (file)
 #include <linux/threads.h>
 #include <linux/irq.h>
 
-#ifdef CONFIG_IRQSTACKS
-#define __ARCH_HAS_DO_SOFTIRQ
-#endif
-
 typedef struct {
        unsigned int __softirq_pending;
        unsigned int kernel_stack_usage;
index 107bb43..888d1ad 100644 (file)
@@ -237,6 +237,7 @@ config PPC
        select MMU_GATHER_PAGE_SIZE
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_RELIABLE_STACKTRACE         if PPC_BOOK3S_64 && CPU_LITTLE_ENDIAN
+       select HAVE_SOFTIRQ_ON_OWN_STACK
        select HAVE_SYSCALL_TRACEPOINTS
        select HAVE_VIRT_CPU_ACCOUNTING
        select HAVE_IRQ_TIME_ACCOUNTING
index 4f983ca..f3f264e 100644 (file)
@@ -37,8 +37,6 @@ extern int distribute_irqs;
 
 struct pt_regs;
 
-#define __ARCH_HAS_DO_SOFTIRQ
-
 #if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
 /*
  * Per-cpu stacks for handling critical, debug and machine check
index c72874f..e00c02a 100644 (file)
@@ -182,6 +182,7 @@ config S390
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_RELIABLE_STACKTRACE
        select HAVE_RSEQ
+       select HAVE_SOFTIRQ_ON_OWN_STACK
        select HAVE_SYSCALL_TRACEPOINTS
        select HAVE_VIRT_CPU_ACCOUNTING
        select HAVE_VIRT_CPU_ACCOUNTING_IDLE
index dfbc3c6..58668ff 100644 (file)
@@ -18,7 +18,6 @@
 #define or_softirq_pending(x)  (S390_lowcore.softirq_pending |= (x))
 
 #define __ARCH_IRQ_STAT
-#define __ARCH_HAS_DO_SOFTIRQ
 #define __ARCH_IRQ_EXIT_IRQS_DISABLED
 
 static inline void ack_bad_irq(unsigned int irq)
index 5fa5802..b49d5e0 100644 (file)
@@ -56,6 +56,7 @@ config SUPERH
        select HAVE_PERF_EVENTS
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_UID16
+       select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS
        select HAVE_STACKPROTECTOR
        select HAVE_SYSCALL_TRACEPOINTS
        select IRQ_FORCED_THREADING
index 6d44c32..839551c 100644 (file)
@@ -51,7 +51,6 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);
 #ifdef CONFIG_IRQSTACKS
 extern void irq_ctx_init(int cpu);
 extern void irq_ctx_exit(int cpu);
-# define __ARCH_HAS_DO_SOFTIRQ
 #else
 # define irq_ctx_init(cpu) do { } while (0)
 # define irq_ctx_exit(cpu) do { } while (0)
index c9c34dc..f0d22d5 100644 (file)
@@ -97,6 +97,7 @@ config SPARC64
        select ARCH_HAS_PTE_SPECIAL
        select PCI_DOMAINS if PCI
        select ARCH_HAS_GIGANTIC_PAGE
+       select HAVE_SOFTIRQ_ON_OWN_STACK
 
 config ARCH_PROC_KCORE_TEXT
        def_bool y
index 4d748e9..154df2c 100644 (file)
@@ -93,7 +93,6 @@ void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
 
 extern void *hardirq_stack[NR_CPUS];
 extern void *softirq_stack[NR_CPUS];
-#define __ARCH_HAS_DO_SOFTIRQ
 
 #define NO_IRQ         0xffffffff
 
index e17ce87..019e0e1 100644 (file)
@@ -221,6 +221,7 @@ config X86
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_RELIABLE_STACKTRACE         if X86_64 && (UNWINDER_FRAME_POINTER || UNWINDER_ORC) && STACK_VALIDATION
        select HAVE_FUNCTION_ARG_ACCESS_API
+       select HAVE_SOFTIRQ_ON_OWN_STACK
        select HAVE_STACKPROTECTOR              if CC_HAS_SANE_STACKPROTECTOR
        select HAVE_STACK_VALIDATION            if X86_64
        select HAVE_STATIC_CALL
index 528c8a7..f70d2ca 100644 (file)
@@ -25,8 +25,6 @@ static inline int irq_canonicalize(int irq)
 
 extern int irq_init_percpu_irqstack(unsigned int cpu);
 
-#define __ARCH_HAS_DO_SOFTIRQ
-
 struct irq_desc;
 
 extern void fixup_irqs(void);
index bb8ff90..f0b918f 100644 (file)
@@ -569,7 +569,7 @@ struct softirq_action
 asmlinkage void do_softirq(void);
 asmlinkage void __do_softirq(void);
 
-#ifdef __ARCH_HAS_DO_SOFTIRQ
+#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
 void do_softirq_own_stack(void);
 #else
 static inline void do_softirq_own_stack(void)