To prepare for inlining do_softirq_own_stack() replace __ARCH_HAS_DO_SOFTIRQ with a Kconfig switch and select it in the affected architectures. This allows in the next step to move the function prototype and the inline stub into a seperate asm-generic header file which is required to avoid include recursion.
Unified · Split
| @@ -759,6 +759,12 @@ config HAVE_IRQ_EXIT_ON_IRQ_STACK · 758 unmodified lines | |||
| 759 | This spares a stack switch and improves cache usage on softirq | 759 | This spares a stack switch and improves cache usage on softirq |
| 760 | processing. | 760 | processing. |
| 761 | 761 | ||
| 762 | config HAVE_SOFTIRQ_ON_OWN_STACK | ||
| 763 | bool | ||
| 764 | help | ||
| 765 | Architecture provides a function to run __do_softirq() on a | ||
| 766 | seperate stack. | ||
| 767 | |||
| 762 | config PGTABLE_LEVELS | 768 | config PGTABLE_LEVELS |
| 763 | int | 769 | int |
| 764 | default 2 | 770 | default 2 |
| @@ -63,6 +63,7 @@ config PARISC · 62 unmodified lines | |||
| 63 | select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE | 63 | select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE |
| 64 | select HAVE_KPROBES_ON_FTRACE | 64 | select HAVE_KPROBES_ON_FTRACE |
| 65 | select HAVE_DYNAMIC_FTRACE_WITH_REGS | 65 | select HAVE_DYNAMIC_FTRACE_WITH_REGS |
| 66 | select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS | ||
| 66 | select SET_FS | 67 | select SET_FS |
| 67 | 68 | ||
| 68 | help | 69 | help |
| @@ -12,10 +12,6 @@ · 11 unmodified lines | |||
| 12 | #include <linux/threads.h> | 12 | #include <linux/threads.h> |
| 13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
| 14 | 14 | ||
| 15 | #ifdef CONFIG_IRQSTACKS | ||
| 16 | #define __ARCH_HAS_DO_SOFTIRQ | ||
| 17 | #endif | ||
| 18 | |||
| 19 | typedef struct { | 15 | typedef struct { |
| 20 | unsigned int __softirq_pending; | 16 | unsigned int __softirq_pending; |
| 21 | unsigned int kernel_stack_usage; | 17 | unsigned int kernel_stack_usage; |
| @@ -237,6 +237,7 @@ config PPC · 236 unmodified lines | |||
| 237 | select MMU_GATHER_PAGE_SIZE | 237 | select MMU_GATHER_PAGE_SIZE |
| 238 | select HAVE_REGS_AND_STACK_ACCESS_API | 238 | select HAVE_REGS_AND_STACK_ACCESS_API |
| 239 | select HAVE_RELIABLE_STACKTRACE if PPC_BOOK3S_64 && CPU_LITTLE_ENDIAN | 239 | select HAVE_RELIABLE_STACKTRACE if PPC_BOOK3S_64 && CPU_LITTLE_ENDIAN |
| 240 | select HAVE_SOFTIRQ_ON_OWN_STACK | ||
| 240 | select HAVE_SYSCALL_TRACEPOINTS | 241 | select HAVE_SYSCALL_TRACEPOINTS |
| 241 | select HAVE_VIRT_CPU_ACCOUNTING | 242 | select HAVE_VIRT_CPU_ACCOUNTING |
| 242 | select HAVE_IRQ_TIME_ACCOUNTING | 243 | select HAVE_IRQ_TIME_ACCOUNTING |
| @@ -37,8 +37,6 @@ extern int distribute_irqs; · 36 unmodified lines | |||
| 37 | 37 | ||
| 38 | struct pt_regs; | 38 | struct pt_regs; |
| 39 | 39 | ||
| 40 | #define __ARCH_HAS_DO_SOFTIRQ | ||
| 41 | |||
| 42 | #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) | 40 | #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) |
| 43 | /* | 41 | /* |
| 44 | * Per-cpu stacks for handling critical, debug and machine check | 42 | * Per-cpu stacks for handling critical, debug and machine check |
| @@ -182,6 +182,7 @@ config S390 · 181 unmodified lines | |||
| 182 | select HAVE_REGS_AND_STACK_ACCESS_API | 182 | select HAVE_REGS_AND_STACK_ACCESS_API |
| 183 | select HAVE_RELIABLE_STACKTRACE | 183 | select HAVE_RELIABLE_STACKTRACE |
| 184 | select HAVE_RSEQ | 184 | select HAVE_RSEQ |
| 185 | select HAVE_SOFTIRQ_ON_OWN_STACK | ||
| 185 | select HAVE_SYSCALL_TRACEPOINTS | 186 | select HAVE_SYSCALL_TRACEPOINTS |
| 186 | select HAVE_VIRT_CPU_ACCOUNTING | 187 | select HAVE_VIRT_CPU_ACCOUNTING |
| 187 | select HAVE_VIRT_CPU_ACCOUNTING_IDLE | 188 | select HAVE_VIRT_CPU_ACCOUNTING_IDLE |
| @@ -18,7 +18,6 @@ · 17 unmodified lines | |||
| 18 | #define or_softirq_pending(x) (S390_lowcore.softirq_pending |= (x)) | 18 | #define or_softirq_pending(x) (S390_lowcore.softirq_pending |= (x)) |
| 19 | 19 | ||
| 20 | #define __ARCH_IRQ_STAT | 20 | #define __ARCH_IRQ_STAT |
| 21 | #define __ARCH_HAS_DO_SOFTIRQ | ||
| 22 | #define __ARCH_IRQ_EXIT_IRQS_DISABLED | 21 | #define __ARCH_IRQ_EXIT_IRQS_DISABLED |
| 23 | 22 | ||
| 24 | static inline void ack_bad_irq(unsigned int irq) | 23 | static inline void ack_bad_irq(unsigned int irq) |
| @@ -56,6 +56,7 @@ config SUPERH · 55 unmodified lines | |||
| 56 | select HAVE_PERF_EVENTS | 56 | select HAVE_PERF_EVENTS |
| 57 | select HAVE_REGS_AND_STACK_ACCESS_API | 57 | select HAVE_REGS_AND_STACK_ACCESS_API |
| 58 | select HAVE_UID16 | 58 | select HAVE_UID16 |
| 59 | select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS | ||
| 59 | select HAVE_STACKPROTECTOR | 60 | select HAVE_STACKPROTECTOR |
| 60 | select HAVE_SYSCALL_TRACEPOINTS | 61 | select HAVE_SYSCALL_TRACEPOINTS |
| 61 | select IRQ_FORCED_THREADING | 62 | select IRQ_FORCED_THREADING |
| @@ -51,7 +51,6 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs); · 50 unmodified lines | |||
| 51 | #ifdef CONFIG_IRQSTACKS | 51 | #ifdef CONFIG_IRQSTACKS |
| 52 | extern void irq_ctx_init(int cpu); | 52 | extern void irq_ctx_init(int cpu); |
| 53 | extern void irq_ctx_exit(int cpu); | 53 | extern void irq_ctx_exit(int cpu); |
| 54 | # define __ARCH_HAS_DO_SOFTIRQ | ||
| 55 | #else | 54 | #else |
| 56 | # define irq_ctx_init(cpu) do { } while (0) | 55 | # define irq_ctx_init(cpu) do { } while (0) |
| 57 | # define irq_ctx_exit(cpu) do { } while (0) | 56 | # define irq_ctx_exit(cpu) do { } while (0) |
| @@ -97,6 +97,7 @@ config SPARC64 · 96 unmodified lines | |||
| 97 | select ARCH_HAS_PTE_SPECIAL | 97 | select ARCH_HAS_PTE_SPECIAL |
| 98 | select PCI_DOMAINS if PCI | 98 | select PCI_DOMAINS if PCI |
| 99 | select ARCH_HAS_GIGANTIC_PAGE | 99 | select ARCH_HAS_GIGANTIC_PAGE |
| 100 | select HAVE_SOFTIRQ_ON_OWN_STACK | ||
| 100 | 101 | ||
| 101 | config ARCH_PROC_KCORE_TEXT | 102 | config ARCH_PROC_KCORE_TEXT |
| 102 | def_bool y | 103 | def_bool y |
| @@ -93,7 +93,6 @@ void arch_trigger_cpumask_backtrace(const struct cpumask *mask, · 92 unmodified lines | |||
| 93 | 93 | ||
| 94 | extern void *hardirq_stack[NR_CPUS]; | 94 | extern void *hardirq_stack[NR_CPUS]; |
| 95 | extern void *softirq_stack[NR_CPUS]; | 95 | extern void *softirq_stack[NR_CPUS]; |
| 96 | #define __ARCH_HAS_DO_SOFTIRQ | ||
| 97 | 96 | ||
| 98 | #define NO_IRQ 0xffffffff | 97 | #define NO_IRQ 0xffffffff |
| 99 | 98 | ||
| @@ -221,6 +221,7 @@ config X86 · 220 unmodified lines | |||
| 221 | select HAVE_REGS_AND_STACK_ACCESS_API | 221 | select HAVE_REGS_AND_STACK_ACCESS_API |
| 222 | select HAVE_RELIABLE_STACKTRACE if X86_64 && (UNWINDER_FRAME_POINTER || UNWINDER_ORC) && STACK_VALIDATION | 222 | select HAVE_RELIABLE_STACKTRACE if X86_64 && (UNWINDER_FRAME_POINTER || UNWINDER_ORC) && STACK_VALIDATION |
| 223 | select HAVE_FUNCTION_ARG_ACCESS_API | 223 | select HAVE_FUNCTION_ARG_ACCESS_API |
| 224 | select HAVE_SOFTIRQ_ON_OWN_STACK | ||
| 224 | select HAVE_STACKPROTECTOR if CC_HAS_SANE_STACKPROTECTOR | 225 | select HAVE_STACKPROTECTOR if CC_HAS_SANE_STACKPROTECTOR |
| 225 | select HAVE_STACK_VALIDATION if X86_64 | 226 | select HAVE_STACK_VALIDATION if X86_64 |
| 226 | select HAVE_STATIC_CALL | 227 | select HAVE_STATIC_CALL |
| @@ -25,8 +25,6 @@ static inline int irq_canonicalize(int irq) · 24 unmodified lines | |||
| 25 | 25 | ||
| 26 | extern int irq_init_percpu_irqstack(unsigned int cpu); | 26 | extern int irq_init_percpu_irqstack(unsigned int cpu); |
| 27 | 27 | ||
| 28 | #define __ARCH_HAS_DO_SOFTIRQ | ||
| 29 | |||
| 30 | struct irq_desc; | 28 | struct irq_desc; |
| 31 | 29 | ||
| 32 | extern void fixup_irqs(void); | 30 | extern void fixup_irqs(void); |
| @@ -569,7 +569,7 @@ 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 __ARCH_HAS_DO_SOFTIRQ | 572 | #ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK |
| 573 | void do_softirq_own_stack(void); | 573 | void do_softirq_own_stack(void); |
| 574 | #else | 574 | #else |
| 575 | static inline void do_softirq_own_stack(void) | 575 | static inline void do_softirq_own_stack(void) |