x86/softirq: Disable softirq stacks on PREEMPT_RT
authorThomas Gleixner <tglx@linutronix.de>
Fri, 24 Sep 2021 16:12:45 +0000 (18:12 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 27 Sep 2021 10:28:32 +0000 (12:28 +0200)
PREEMPT_RT preempts softirqs and the current implementation avoids
do_softirq_own_stack() and only uses __do_softirq().

Disable the unused softirqs stacks on PREEMPT_RT to safe some memory and
ensure that do_softirq_own_stack() is not used which is not expected.

 [ bigeasy: commit description. ]

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210924161245.2357247-1-bigeasy@linutronix.de
arch/x86/include/asm/irq_stack.h
arch/x86/kernel/irq_32.c

index 562854c60808263798413e3b61b2cbaf230dfd11..ea0c5ab31da409bd67cc6a0893465adc2d9ccdb3 100644 (file)
                              IRQ_CONSTRAINTS, regs, vector);           \
 }
 
+#ifndef CONFIG_PREEMPT_RT
 #define ASM_CALL_SOFTIRQ                                               \
        "call %P[__func]                                \n"
 
        __this_cpu_write(hardirq_stack_inuse, false);                   \
 }
 
+#endif
+
 #else /* CONFIG_X86_64 */
 /* System vector handlers always run on the stack they interrupted. */
 #define run_sysvec_on_irqstack_cond(func, regs)                                \
index 044902d5a3c4afc37c0a422a9a980b5dbf1f4bc9..e5dd6da78713bc1f37def623d2bf07577ea981ae 100644 (file)
@@ -132,6 +132,7 @@ int irq_init_percpu_irqstack(unsigned int cpu)
        return 0;
 }
 
+#ifndef CONFIG_PREEMPT_RT
 void do_softirq_own_stack(void)
 {
        struct irq_stack *irqstk;
@@ -148,6 +149,7 @@ void do_softirq_own_stack(void)
 
        call_on_stack(__do_softirq, isp);
 }
+#endif
 
 void __handle_irq(struct irq_desc *desc, struct pt_regs *regs)
 {