handle_interruption() enables interrupts when the trapping context had them enabled, so the FP assist trap (code 14) and the unaligned access handler can run preemptible. Both bump a per-CPU counter with __inc_irq_stat(), which is only safe with preemption disabled. A task can migrate in the middle of the read-modify-write and lose an update to another CPU's count, and with CONFIG_DEBUG_PREEMPT it warns: BUG: using __this_cpu_add() in preemptible [00000000] code: systemd-timesyn/1338 caller is __this_cpu_preempt_check+0x38/0x4c ... Backtrace: show_stack+0x68/0x80 dump_stack_lvl+0x1a8/0x260 dump_stack+0x34/0x48 check_preemption_disabled+0x18c/0x194 __this_cpu_preempt_check+0x38/0x4c handle_interruption+0x674/0x106c (The rest of the trace is garbage from the unwinder bug fixed by "parisc: unwind: Stop at interruptions from user space".) Use inc_irq_stat() instead. Fixes: d0c3be806a3f ("parisc: show number of FPE and unaligned access handler calls in /proc/interrupts") Cc: stable@vger.kernel.org Signed-off-by: Matt Turner --- arch/parisc/kernel/traps.c | 2 +- arch/parisc/kernel/unaligned.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 4c7c5df80bd0..b3528696e572 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -633,7 +633,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs) case 14: /* Assist Exception Trap, i.e. floating point exception. */ die_if_kernel("Floating point exception", regs, 0); /* quiet */ - __inc_irq_stat(irq_fpassist_count); + inc_irq_stat(irq_fpassist_count); perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0); handle_fpe(regs); return; diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index fb64d9ce0b17..454daf1f22d4 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -378,7 +378,7 @@ void handle_unaligned(struct pt_regs *regs) int modify = 0; int ret = ERR_NOTHANDLED; - __inc_irq_stat(irq_unaligned_count); + inc_irq_stat(irq_unaligned_count); perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, regs->ior); /* log a message with pacing */ -- 2.56.1