hw/ppc: fix decrementer with BookE timers
authorClément Chigot <chigot@adacore.com>
Mon, 15 Jul 2024 08:46:39 +0000 (10:46 +0200)
committerNicholas Piggin <npiggin@gmail.com>
Sun, 3 Nov 2024 23:09:21 +0000 (09:09 +1000)
commitf10827a845bbbb0354617cc1a69e95e4c1eb18ce
tree66cf7a0ced9cf2f5895ae9936407c91f31eb89d2
parentddf4dd46e5c31bd223f2e867f2cae43bfd41dfb9
hw/ppc: fix decrementer with BookE timers

The BookE decrementer stops at 0, meaning that it won't decremented
towards "negative" values. However, the current logic is inverted: decr
is updated solely when the resulting value would be negative.

Signed-off-by: Clément Chigot <chigot@adacore.com>
Fixes: 8e0a5ac87800 ("hw/ppc: Avoid decrementer rounding errors")
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
hw/ppc/ppc.c