]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
asm-generic: Conditionally enable do_softirq_own_stack() via Kconfig.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 25 Aug 2022 08:25:05 +0000 (10:25 +0200)
committerArnd Bergmann <arnd@arndb.de>
Mon, 5 Sep 2022 15:20:55 +0000 (17:20 +0200)
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>
arch/Kconfig
arch/arm/kernel/irq.c
arch/parisc/kernel/irq.c
arch/powerpc/kernel/irq.c
arch/s390/include/asm/softirq_stack.h
arch/sh/kernel/irq.c
arch/sparc/kernel/irq_64.c
arch/x86/include/asm/irq_stack.h
arch/x86/kernel/irq_32.c
include/asm-generic/softirq_stack.h

index 5dbf11a5ba4e8ea2879b780f23d543d78ac31ebc..8b311e400ec140fcee6f377e11b17176d404a885 100644 (file)
@@ -923,6 +923,9 @@ config HAVE_SOFTIRQ_ON_OWN_STACK
          Architecture provides a function to run __do_softirq() on a
          separate stack.
 
+config SOFTIRQ_ON_OWN_STACK
+       def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
+
 config ALTERNATE_USER_ADDRESS_SPACE
        bool
        help
index 034cb48c9eeb8c7e541124d9eb34d8b40cc21d63..fe28fc1f759d9372ef6f44e43a0b959d67579c8d 100644 (file)
@@ -70,7 +70,7 @@ static void __init init_irq_stacks(void)
        }
 }
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 static void ____do_softirq(void *arg)
 {
        __do_softirq();
index fbb882cb8dbb5f9316af05f7c9f45faf90701cec..b05055f3ba4b8aa406c3a0881bb65b5984ce51f7 100644 (file)
@@ -480,7 +480,7 @@ static void execute_on_irq_stack(void *func, unsigned long param1)
        *irq_stack_in_use = 1;
 }
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 void do_softirq_own_stack(void)
 {
        execute_on_irq_stack(__do_softirq, 0);
index 0f17268c1f0bbdcb6126eb2108cc0a7c30fbbbaa..9ede61a5a469efb7f4252412c2a5c98c5f77c48b 100644 (file)
@@ -199,7 +199,7 @@ static inline void check_stack_overflow(unsigned long sp)
        }
 }
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 static __always_inline void call_do_softirq(const void *sp)
 {
        /* Temporarily switch r1 to sp, call __do_softirq() then restore r1. */
@@ -335,7 +335,7 @@ void *mcheckirq_ctx[NR_CPUS] __read_mostly;
 void *softirq_ctx[NR_CPUS] __read_mostly;
 void *hardirq_ctx[NR_CPUS] __read_mostly;
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 void do_softirq_own_stack(void)
 {
        call_do_softirq(softirq_ctx[smp_processor_id()]);
index af68d6c1d5840ecf0d06e65cd7dcd449d1a27219..1ac5115d3115ee5738ed27cb7411c6702b5d4aae 100644 (file)
@@ -5,7 +5,7 @@
 #include <asm/lowcore.h>
 #include <asm/stacktrace.h>
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 static inline void do_softirq_own_stack(void)
 {
        call_on_stack(0, S390_lowcore.async_stack, void, __do_softirq);
index 90927673807802cb9ee4157994045c100e9dcc1e..4e6835de54cf8e773bd2b5b53df29e6ce7d2aa88 100644 (file)
@@ -149,7 +149,7 @@ void irq_ctx_exit(int cpu)
        hardirq_ctx[cpu] = NULL;
 }
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 void do_softirq_own_stack(void)
 {
        struct thread_info *curctx;
index 41fa1be980a33463adbde4c50b0dbade80203e9f..72da2e10e2559ab8ea1dc19c63af917b6ca2a492 100644 (file)
@@ -855,7 +855,7 @@ void __irq_entry handler_irq(int pil, struct pt_regs *regs)
        set_irq_regs(old_regs);
 }
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 void do_softirq_own_stack(void)
 {
        void *orig_sp, *sp = softirq_stack[smp_processor_id()];
index 63f818aedf770c65579d4bd48a38f9147a104542..147cb8fdda92e9e0a9a2e74bb876968af8ba29dc 100644 (file)
                              IRQ_CONSTRAINTS, regs, vector);           \
 }
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 /*
  * Macro to invoke __do_softirq on the irq stack. This is only called from
  * task context when bottom halves are about to be reenabled and soft
index e5dd6da78713bc1f37def623d2bf07577ea981ae..01833ebf5e8e3582992a8860460bbe555923eb30 100644 (file)
@@ -132,7 +132,7 @@ int irq_init_percpu_irqstack(unsigned int cpu)
        return 0;
 }
 
-#ifndef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 void do_softirq_own_stack(void)
 {
        struct irq_stack *irqstk;
index d3e2d81656e042f3a74579403470311dc7f3c732..2a67aed9ac5287bc5c6df3bd374b9f2493fd803a 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef __ASM_GENERIC_SOFTIRQ_STACK_H
 #define __ASM_GENERIC_SOFTIRQ_STACK_H
 
-#if defined(CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK) && !defined(CONFIG_PREEMPT_RT)
+#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 void do_softirq_own_stack(void);
 #else
 static inline void do_softirq_own_stack(void)