Skip to content

Commit 8defc2a

Browse files
npigginmpe
authored andcommitted
powerpc/64s/interrupt: Fix decrementer storm
The decrementer exception can fail to be cleared when the interrupt returns in the case where the decrementer wraps with the next timer still beyond decrementer_max. This results in a decrementer interrupt storm. This is triggerable with small decrementer system with hard and soft watchdogs disabled. Fix this by always programming the decrementer if there was no timer. Fixes: 0faf20a ("powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use") Reported-by: Alexey Kardashevskiy <[email protected]> Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 22f7ff0 commit 8defc2a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/powerpc/kernel/time.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,9 @@ DEFINE_INTERRUPT_HANDLER_ASYNC(timer_interrupt)
649649
__this_cpu_inc(irq_stat.timer_irqs_event);
650650
} else {
651651
now = *next_tb - now;
652-
if (now <= decrementer_max)
653-
set_dec_or_work(now);
652+
if (now > decrementer_max)
653+
now = decrementer_max;
654+
set_dec_or_work(now);
654655
__this_cpu_inc(irq_stat.timer_irqs_others);
655656
}
656657

0 commit comments

Comments
 (0)