In preparation for removing HANDLE_DOMAIN_IRQ_IRQENTRY, have arch/riscv perform all the irqentry accounting in its entry code. As arch/riscv uses GENERIC_IRQ_MULTI_HANDLER, we can use generic_handle_arch_irq() to do so. Since generic_handle_arch_irq() handles the irq entry and setting the irq regs, and happens before the irqchip code calls handle_IPI(), we can remove the redundant irq entry and irq regs manipulation from handle_IPI(). There should be no functional change as a result of this patch.
Unified · Split
| @@ -63,7 +63,6 @@ config RISCV · 62 unmodified lines | ||
| 63 | 63 | select GENERIC_SMP_IDLE_THREAD |
| 64 | 64 | select GENERIC_TIME_VSYSCALL if MMU && 64BIT |
| 65 | 65 | select HANDLE_DOMAIN_IRQ |
| 66 | − select HANDLE_DOMAIN_IRQ_IRQENTRY | |
| 67 | 66 | select HAVE_ARCH_AUDITSYSCALL |
| 68 | 67 | select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL |
| 69 | 68 | select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL |
| @@ -130,8 +130,7 @@ skip_context_tracking: · 129 unmodified lines | ||
| 130 | 130 | |
| 131 | 131 | /* Handle interrupts */ |
| 132 | 132 | move a0, sp /* pt_regs */ |
| 133 | − la a1, handle_arch_irq | |
| 134 | − REG_L a1, (a1) | |
| 133 | + la a1, generic_handle_arch_irq | |
| 135 | 134 | jr a1 |
| 136 | 135 | 1: |
| 137 | 136 | /* |
| @@ -140,12 +140,9 @@ void arch_irq_work_raise(void) · 139 unmodified lines | ||
| 140 | 140 | |
| 141 | 141 | void handle_IPI(struct pt_regs *regs) |
| 142 | 142 | { |
| 143 | − struct pt_regs *old_regs = set_irq_regs(regs); | |
| 144 | 143 | unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits; |
| 145 | 144 | unsigned long *stats = ipi_data[smp_processor_id()].stats; |
| 146 | 145 | |
| 147 | − irq_enter(); | |
| 148 | − | |
| 149 | 146 | riscv_clear_ipi(); |
| 150 | 147 | |
| 151 | 148 | while (true) { |
| @@ -156,7 +153,7 @@ void handle_IPI(struct pt_regs *regs) · 4 unmodified lines | ||
| 156 | 153 | |
| 157 | 154 | ops = xchg(pending_ipis, 0); |
| 158 | 155 | if (ops == 0) |
| 159 | − goto done; | |
| 156 | + return; | |
| 160 | 157 | |
| 161 | 158 | if (ops & (1 << IPI_RESCHEDULE)) { |
| 162 | 159 | stats[IPI_RESCHEDULE]++; |
| @@ -189,10 +186,6 @@ void handle_IPI(struct pt_regs *regs) · 26 unmodified lines | ||
| 189 | 186 | /* Order data access and bit testing. */ |
| 190 | 187 | mb(); |
| 191 | 188 | } |
| 192 | − | |
| 193 | −done: | |
| 194 | − irq_exit(); | |
| 195 | − set_irq_regs(old_regs); | |
| 196 | 189 | } |
| 197 | 190 | |
| 198 | 191 | static const char * const ipi_names[] = { |