mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
replay: wake up vCPU when replaying
In record/replay icount mode vCPU thread and iothread synchronize the execution using the checkpoints. vCPU thread processes the virtual timers and iothread processes all others. When iothread wants to wake up sleeping vCPU thread, it sends dummy queued work. Therefore it could be the following sequence of the events in record mode: - IO: sending dummy work - IO: processing timers - CPU: wakeup - CPU: clearing dummy work - CPU: processing virtual timers But due to the races in replay mode the sequence may change: - IO: sending dummy work - CPU: wakeup - CPU: clearing dummy work - CPU: sleeping again because nothing to do - IO: Processing timers - CPU: zzzz In this case vCPU will not wake up, because dummy work is not to be set up again. This patch tries to wake up the vCPU when it sleeps and the icount warp checkpoint isn't met. It means that vCPU has something to do, because there are no other reasons of non-matching warp checkpoint. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> -- v5: improve checking that vCPU is still sleeping Message-Id: <20180912081945.3228.19776.stgit@pasha-VirtualBox> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
0a7fa00a13
commit
0c08185f8f
3 changed files with 36 additions and 10 deletions
|
@ -120,6 +120,9 @@ void replay_shutdown_request(ShutdownCause cause);
|
|||
Returns 0 in PLAY mode if checkpoint was not found.
|
||||
Returns 1 in all other cases. */
|
||||
bool replay_checkpoint(ReplayCheckpoint checkpoint);
|
||||
/*! Used to determine that checkpoint is pending.
|
||||
Does not proceed to the next event in the log. */
|
||||
bool replay_has_checkpoint(void);
|
||||
|
||||
/* Asynchronous events queue */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue