[PATCH 10/10] ARM: run softirqs on the per-CPU IRQ stack

Ard Biesheuvel ardb at kernel.org
Tue Sep 21 02:54:08 PDT 2021


Now that we have enabled IRQ stacks, any softIRQs that are handled over
the back of a hard IRQ will run from the IRQ stack as well. However, any
synchronous softirq processing that happens when re-enabling softIRQs
from task context will still execute on that task's stack.

So let's wire up the existing infrastructure to run these softIRQs from
the IRQ stack as well.

Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
---
 arch/arm/Kconfig      | 2 ++
 arch/arm/kernel/irq.c | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a8c1db0736f3..d46b243e1b26 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1166,6 +1166,8 @@ config CURRENT_POINTER_IN_TPIDRURO
 config IRQSTACKS
 	def_bool y
 	depends on GENERIC_IRQ_MULTI_HANDLER && THREAD_INFO_IN_TASK
+	select HAVE_IRQ_EXIT_ON_IRQ_STACK
+	select HAVE_SOFTIRQ_ON_OWN_STACK
 
 config ARM_CPU_TOPOLOGY
 	bool "Support cpu topology definition"
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 58af2adb1583..feb07f703a98 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -41,6 +41,8 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
+#include "reboot.h"
+
 unsigned long irq_err_count;
 
 #ifdef CONFIG_IRQSTACKS
@@ -60,6 +62,12 @@ static void __init init_irq_stacks(void)
 	}
 }
 
+void do_softirq_own_stack(void)
+{
+	call_with_stack((void *)__do_softirq, NULL,
+			__this_cpu_read(irq_stack_ptr));
+}
+
 #endif
 
 int arch_show_interrupts(struct seq_file *p, int prec)
-- 
2.30.2




More information about the linux-arm-kernel mailing list