Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

asm-generic: Conditionally enable do_softirq_own_stack() via Kconfig.

Remove the CONFIG_PREEMPT_RT symbol from the ifdef around
do_softirq_own_stack() and move it to Kconfig instead.

Enable softirq stacks based on SOFTIRQ_ON_OWN_STACK which depends on
HAVE_SOFTIRQ_ON_OWN_STACK and its default value is set to !PREEMPT_RT.
This ensures that softirq stacks are not used on PREEMPT_RT and avoids
a 'select' statement on an option which has a 'depends' statement.

Link: https://lore.kernel.org/YvN5E%2FPrHfUhggr7@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Sebastian Andrzej Siewior and committed by
Arnd Bergmann
8cbb2b50 b90cb105

+13 -10
+3
arch/Kconfig
··· 923 923 Architecture provides a function to run __do_softirq() on a 924 924 separate stack. 925 925 926 + config SOFTIRQ_ON_OWN_STACK 927 + def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT 928 + 926 929 config ALTERNATE_USER_ADDRESS_SPACE 927 930 bool 928 931 help
+1 -1
arch/arm/kernel/irq.c
··· 70 70 } 71 71 } 72 72 73 - #ifndef CONFIG_PREEMPT_RT 73 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 74 74 static void ____do_softirq(void *arg) 75 75 { 76 76 __do_softirq();
+1 -1
arch/parisc/kernel/irq.c
··· 480 480 *irq_stack_in_use = 1; 481 481 } 482 482 483 - #ifndef CONFIG_PREEMPT_RT 483 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 484 484 void do_softirq_own_stack(void) 485 485 { 486 486 execute_on_irq_stack(__do_softirq, 0);
+2 -2
arch/powerpc/kernel/irq.c
··· 199 199 } 200 200 } 201 201 202 - #ifndef CONFIG_PREEMPT_RT 202 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 203 203 static __always_inline void call_do_softirq(const void *sp) 204 204 { 205 205 /* Temporarily switch r1 to sp, call __do_softirq() then restore r1. */ ··· 335 335 void *softirq_ctx[NR_CPUS] __read_mostly; 336 336 void *hardirq_ctx[NR_CPUS] __read_mostly; 337 337 338 - #ifndef CONFIG_PREEMPT_RT 338 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 339 339 void do_softirq_own_stack(void) 340 340 { 341 341 call_do_softirq(softirq_ctx[smp_processor_id()]);
+1 -1
arch/s390/include/asm/softirq_stack.h
··· 5 5 #include <asm/lowcore.h> 6 6 #include <asm/stacktrace.h> 7 7 8 - #ifndef CONFIG_PREEMPT_RT 8 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 9 9 static inline void do_softirq_own_stack(void) 10 10 { 11 11 call_on_stack(0, S390_lowcore.async_stack, void, __do_softirq);
+1 -1
arch/sh/kernel/irq.c
··· 149 149 hardirq_ctx[cpu] = NULL; 150 150 } 151 151 152 - #ifndef CONFIG_PREEMPT_RT 152 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 153 153 void do_softirq_own_stack(void) 154 154 { 155 155 struct thread_info *curctx;
+1 -1
arch/sparc/kernel/irq_64.c
··· 855 855 set_irq_regs(old_regs); 856 856 } 857 857 858 - #ifndef CONFIG_PREEMPT_RT 858 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 859 859 void do_softirq_own_stack(void) 860 860 { 861 861 void *orig_sp, *sp = softirq_stack[smp_processor_id()];
+1 -1
arch/x86/include/asm/irq_stack.h
··· 203 203 IRQ_CONSTRAINTS, regs, vector); \ 204 204 } 205 205 206 - #ifndef CONFIG_PREEMPT_RT 206 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 207 207 /* 208 208 * Macro to invoke __do_softirq on the irq stack. This is only called from 209 209 * task context when bottom halves are about to be reenabled and soft
+1 -1
arch/x86/kernel/irq_32.c
··· 132 132 return 0; 133 133 } 134 134 135 - #ifndef CONFIG_PREEMPT_RT 135 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 136 136 void do_softirq_own_stack(void) 137 137 { 138 138 struct irq_stack *irqstk;
+1 -1
include/asm-generic/softirq_stack.h
··· 2 2 #ifndef __ASM_GENERIC_SOFTIRQ_STACK_H 3 3 #define __ASM_GENERIC_SOFTIRQ_STACK_H 4 4 5 - #if defined(CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK) && !defined(CONFIG_PREEMPT_RT) 5 + #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK 6 6 void do_softirq_own_stack(void); 7 7 #else 8 8 static inline void do_softirq_own_stack(void)