]> git.ipfire.org Git - thirdparty/qemu.git/commit
icount: don't adjust virtual time backwards after warp
authorNicholas Piggin <npiggin@gmail.com>
Tue, 27 Jun 2023 06:14:06 +0000 (16:14 +1000)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 29 Jun 2023 15:17:49 +0000 (18:17 +0300)
commit5e8838524a74338670dca8a7d2f4dd6347b17f00
tree3a9f961df9322775fc93fba4e45b4c4ff8cb35d3
parenta76c5126ec42370d65795b2255e4fa601ccb989a
icount: don't adjust virtual time backwards after warp

The icount-based QEMU_CLOCK_VIRTUAL runs ahead of the RT clock at times.
When warping, it is possible it is still ahead at the end of the warp,
which causes icount adaptive mode to adjust it backward. This can result
in the machine observing time going backwards.

Prevent this by clamping adaptive adjustment to 0 at minimum.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Message-ID: <20230627061406.241847-1-npiggin@gmail.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 67f85346ca9305d9fb3254ceff735ceaadeb0911)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
softmmu/icount.c