]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/ppc: Round up the decrementer interval when converting to ns
authorNicholas Piggin <npiggin@gmail.com>
Tue, 8 Aug 2023 04:19:48 +0000 (14:19 +1000)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 25 Sep 2023 20:43:49 +0000 (23:43 +0300)
commitb9a0f1194a06bbc36aefe9f2f0866a8651843e62
tree98795a200fbfb9435195b4a14f485042b92823e1
parentba8cc5693f3f1136e84f23f9ca0b98654134f5ed
hw/ppc: Round up the decrementer interval when converting to ns

The rule of timers is typically that they should never expire before the
timeout, but some time afterward. Rounding timer intervals up when doing
conversion is the right thing to do.

Under most circumstances it is impossible observe the decrementer
interrupt before the dec register has triggered. However with icount
timing, problems can arise. For example setting DEC to 0 can schedule
the timer for now, causing it to fire before any more instructions
have been executed and DEC is still 0.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
(cherry picked from commit eab0888418ab44344864965193cf6cd194ab6858)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/ppc/ppc.c