replay: fix icount request when replaying clock access
commit366a85e4bb748794b1ae0ca0ccc2d95f316679a0
authorPavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
Tue, 16 Feb 2021 12:51:44 +0000 (16 15:51 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Feb 2021 16:15:39 +0000 (16 17:15 +0100)
treeccbf65483b2908cc8ea997c735ca3cebe1510319
parent82e2756897810b6e17e0c352101878b97b1e2688
replay: fix icount request when replaying clock access

Record/replay provides REPLAY_CLOCK_LOCKED macro to access
the clock when vm_clock_seqlock is locked. This macro is
needed because replay internals operate icount. In locked case
replay use icount_get_raw_locked for icount request, which prevents
excess locking which leads to deadlock. But previously only
record code used *_locked function and replay did not.
Therefore sometimes clock access lead to deadlocks.
This patch fixes clock access for replay too and uses *_locked
icount access function.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-Id: <161347990483.1313189.8371838968343494161.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/sysemu/replay.h
replay/replay-internal.c
replay/replay-time.c
replay/replay.c
stubs/replay-tools.c