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 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | #include <asm/io.h> | 18 | #include <asm/io.h> |
| 19 | 19 | ||
| 20 | #include <asm/softirq_stack.h> | ||
| 20 | #include <asm/smp.h> | 21 | #include <asm/smp.h> |
| 21 | #include <asm/ldcw.h> | 22 | #include <asm/ldcw.h> |
| 22 | 23 | ||
| @@ -65,6 +65,7 @@ · 64 unmodified lines | |||
| 65 | #include <asm/livepatch.h> | 65 | #include <asm/livepatch.h> |
| 66 | #include <asm/asm-prototypes.h> | 66 | #include <asm/asm-prototypes.h> |
| 67 | #include <asm/hw_irq.h> | 67 | #include <asm/hw_irq.h> |
| 68 | #include <asm/softirq_stack.h> | ||
| 68 | 69 | ||
| 69 | #ifdef CONFIG_PPC64 | 70 | #ifdef CONFIG_PPC64 |
| 70 | #include <asm/paca.h> | 71 | #include <asm/paca.h> |
| @@ -27,6 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
| 28 | #include <asm/hw_irq.h> | 28 | #include <asm/hw_irq.h> |
| 29 | #include <asm/stacktrace.h> | 29 | #include <asm/stacktrace.h> |
| 30 | #include <asm/softirq_stack.h> | ||
| 30 | #include "entry.h" | 31 | #include "entry.h" |
| 31 | 32 | ||
| 32 | DEFINE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat); | 33 | DEFINE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat); |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | |||
| 20 | #include <linux/uaccess.h> | 20 | #include <linux/uaccess.h> |
| 21 | #include <asm/thread_info.h> | 21 | #include <asm/thread_info.h> |
| 22 | #include <cpu/mmu_context.h> | 22 | #include <cpu/mmu_context.h> |
| 23 | #include <asm/softirq_stack.h> | ||
| 23 | 24 | ||
| 24 | atomic_t irq_err_count; | 25 | atomic_t irq_err_count; |
| 25 | 26 | ||
| @@ -42,6 +42,7 @@ · 41 unmodified lines | |||
| 42 | #include <asm/head.h> | 42 | #include <asm/head.h> |
| 43 | #include <asm/hypervisor.h> | 43 | #include <asm/hypervisor.h> |
| 44 | #include <asm/cacheflush.h> | 44 | #include <asm/cacheflush.h> |
| 45 | #include <asm/softirq_stack.h> | ||
| 45 | 46 | ||
| 46 | #include "entry.h" | 47 | #include "entry.h" |
| 47 | #include "cpumap.h" | 48 | #include "cpumap.h" |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | #include <asm/apic.h> | 23 | #include <asm/apic.h> |
| 24 | #include <asm/nospec-branch.h> | 24 | #include <asm/nospec-branch.h> |
| 25 | #include <asm/softirq_stack.h> | ||
| 25 | 26 | ||
| 26 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 27 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
| 27 | 28 | ||
| @@ -20,6 +20,7 @@ · 19 unmodified lines | |||
| 20 | #include <linux/sched/task_stack.h> | 20 | #include <linux/sched/task_stack.h> |
| 21 | 21 | ||
| 22 | #include <asm/cpu_entry_area.h> | 22 | #include <asm/cpu_entry_area.h> |
| 23 | #include <asm/softirq_stack.h> | ||
| 23 | #include <asm/irq_stack.h> | 24 | #include <asm/irq_stack.h> |
| 24 | #include <asm/io_apic.h> | 25 | #include <asm/io_apic.h> |
| 25 | #include <asm/apic.h> | 26 | #include <asm/apic.h> |
| @@ -51,6 +51,7 @@ mandatory-y += sections.h · 50 unmodified lines | |||
| 51 | mandatory-y += serial.h | 51 | mandatory-y += serial.h |
| 52 | mandatory-y += shmparam.h | 52 | mandatory-y += shmparam.h |
| 53 | mandatory-y += simd.h | 53 | mandatory-y += simd.h |
| 54 | mandatory-y += softirq_stack.h | ||
| 54 | mandatory-y += switch_to.h | 55 | mandatory-y += switch_to.h |
| 55 | mandatory-y += timex.h | 56 | mandatory-y += timex.h |
| 56 | mandatory-y += tlbflush.h | 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 | asmlinkage void do_softirq(void); | 569 | asmlinkage void do_softirq(void); |
| 570 | asmlinkage void __do_softirq(void); | 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 | extern void open_softirq(int nr, void (*action)(struct softirq_action *)); | 572 | extern void open_softirq(int nr, void (*action)(struct softirq_action *)); |
| 582 | extern void softirq_init(void); | 573 | extern void softirq_init(void); |
| 583 | extern void __raise_softirq_irqoff(unsigned int nr); | 574 | extern void __raise_softirq_irqoff(unsigned int nr); |
| @@ -26,6 +26,8 @@ · 25 unmodified lines | |||
| 26 | #include <linux/tick.h> | 26 | #include <linux/tick.h> |
| 27 | #include <linux/irq.h> | 27 | #include <linux/irq.h> |
| 28 | 28 | ||
| 29 | #include <asm/softirq_stack.h> | ||
| 30 | |||
| 29 | #define CREATE_TRACE_POINTS | 31 | #define CREATE_TRACE_POINTS |
| 30 | #include <trace/events/irq.h> | 32 | #include <trace/events/irq.h> |
| 31 | 33 | ||