To avoid include recursion hell move the do_softirq_own_stack() related content into a generic asm header and include it from all places in arch/ which need the prototype. This allows architectures to provide an inline implementation of do_softirq_own_stack() without introducing a lot of #ifdeffery all over the place.
Unified · Split
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <linux/types.h> |
| 18 | 18 | #include <asm/io.h> |
| 19 | 19 | |
| 20 | +#include <asm/softirq_stack.h> | |
| 20 | 21 | #include <asm/smp.h> |
| 21 | 22 | #include <asm/ldcw.h> |
| 22 | 23 | |
| @@ -65,6 +65,7 @@ · 64 unmodified lines | ||
| 65 | 65 | #include <asm/livepatch.h> |
| 66 | 66 | #include <asm/asm-prototypes.h> |
| 67 | 67 | #include <asm/hw_irq.h> |
| 68 | +#include <asm/softirq_stack.h> | |
| 68 | 69 | |
| 69 | 70 | #ifdef CONFIG_PPC64 |
| 70 | 71 | #include <asm/paca.h> |
| @@ -27,6 +27,7 @@ · 26 unmodified lines | ||
| 27 | 27 | #include <asm/irq.h> |
| 28 | 28 | #include <asm/hw_irq.h> |
| 29 | 29 | #include <asm/stacktrace.h> |
| 30 | +#include <asm/softirq_stack.h> | |
| 30 | 31 | #include "entry.h" |
| 31 | 32 | |
| 32 | 33 | DEFINE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat); |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <linux/uaccess.h> |
| 21 | 21 | #include <asm/thread_info.h> |
| 22 | 22 | #include <cpu/mmu_context.h> |
| 23 | +#include <asm/softirq_stack.h> | |
| 23 | 24 | |
| 24 | 25 | atomic_t irq_err_count; |
| 25 | 26 | |
| @@ -42,6 +42,7 @@ · 41 unmodified lines | ||
| 42 | 42 | #include <asm/head.h> |
| 43 | 43 | #include <asm/hypervisor.h> |
| 44 | 44 | #include <asm/cacheflush.h> |
| 45 | +#include <asm/softirq_stack.h> | |
| 45 | 46 | |
| 46 | 47 | #include "entry.h" |
| 47 | 48 | #include "cpumap.h" |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | #include <asm/apic.h> |
| 24 | 24 | #include <asm/nospec-branch.h> |
| 25 | +#include <asm/softirq_stack.h> | |
| 25 | 26 | |
| 26 | 27 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
| 27 | 28 | |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <linux/sched/task_stack.h> |
| 21 | 21 | |
| 22 | 22 | #include <asm/cpu_entry_area.h> |
| 23 | +#include <asm/softirq_stack.h> | |
| 23 | 24 | #include <asm/irq_stack.h> |
| 24 | 25 | #include <asm/io_apic.h> |
| 25 | 26 | #include <asm/apic.h> |
| @@ -51,6 +51,7 @@ mandatory-y += sections.h · 50 unmodified lines | ||
| 51 | 51 | mandatory-y += serial.h |
| 52 | 52 | mandatory-y += shmparam.h |
| 53 | 53 | mandatory-y += simd.h |
| 54 | +mandatory-y += softirq_stack.h | |
| 54 | 55 | mandatory-y += switch_to.h |
| 55 | 56 | mandatory-y += timex.h |
| 56 | 57 | mandatory-y += tlbflush.h |
| @@ -0,0 +1,14 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ | |
| 2 | +#ifndef __ASM_GENERIC_SOFTIRQ_STACK_H | |
| 3 | +#define __ASM_GENERIC_SOFTIRQ_STACK_H | |
| 4 | + | |
| 5 | +#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK | |
| 6 | +void do_softirq_own_stack(void); | |
| 7 | +#else | |
| 8 | +static inline void do_softirq_own_stack(void) | |
| 9 | +{ | |
| 10 | + __do_softirq(); | |
| 11 | +} | |
| 12 | +#endif | |
| 13 | + | |
| 14 | +#endif | |
| @@ -569,15 +569,6 @@ struct softirq_action · 568 unmodified lines | ||
| 569 | 569 | asmlinkage void do_softirq(void); |
| 570 | 570 | asmlinkage void __do_softirq(void); |
| 571 | 571 | |
| 572 | −#ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK | |
| 573 | −void do_softirq_own_stack(void); | |
| 574 | −#else | |
| 575 | −static inline void do_softirq_own_stack(void) | |
| 576 | −{ | |
| 577 | − __do_softirq(); | |
| 578 | −} | |
| 579 | −#endif | |
| 580 | − | |
| 581 | 572 | extern void open_softirq(int nr, void (*action)(struct softirq_action *)); |
| 582 | 573 | extern void softirq_init(void); |
| 583 | 574 | extern void __raise_softirq_irqoff(unsigned int nr); |
| @@ -26,6 +26,8 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <linux/tick.h> |
| 27 | 27 | #include <linux/irq.h> |
| 28 | 28 | |
| 29 | +#include <asm/softirq_stack.h> | |
| 30 | + | |
| 29 | 31 | #define CREATE_TRACE_POINTS |
| 30 | 32 | #include <trace/events/irq.h> |
| 31 | 33 | |