summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2022-01-24 15:39:28 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2022-01-25 06:50:10 +0100
commit8defc2a5dd8f4c0cb19ecbaca8d3e89ab98524da (patch)
tree78608ba49ddba38f09811bf36ebdd12534df8520 /arch/powerpc
parentKVM: PPC: Book3S HV Nested: Fix nested HFSCR being clobbered with multiple vCPUs (diff)
downloadlinux-8defc2a5dd8f4c0cb19ecbaca8d3e89ab98524da.tar.xz
linux-8defc2a5dd8f4c0cb19ecbaca8d3e89ab98524da.zip
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: 0faf20a1ad16 ("powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use") Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220124143930.3923442-1-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/time.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 62361cc7281c..cd0b8b71ecdd 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -649,8 +649,9 @@ DEFINE_INTERRUPT_HANDLER_ASYNC(timer_interrupt)
__this_cpu_inc(irq_stat.timer_irqs_event);
} else {
now = *next_tb - now;
- if (now <= decrementer_max)
- set_dec_or_work(now);
+ if (now > decrementer_max)
+ now = decrementer_max;
+ set_dec_or_work(now);
__this_cpu_inc(irq_stat.timer_irqs_others);
}