]> git.proxmox.com Git - mirror_qemu.git/commitdiff
replay: don't process async events when warping the clock
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Tue, 27 Feb 2018 09:53:16 +0000 (12:53 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 12 Mar 2018 16:10:38 +0000 (17:10 +0100)
Virtual clock is warped from iothread and vcpu thread. When the hardware
events associated with warp checkpoint, then interrupt delivering may be
non-deterministic if checkpoint is processed in different threads in record
and replay.
This patch disables event processing for clock warp checkpoint and leaves
all hardware events to other checkpoints (e.g., virtual clock).

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20180227095316.1060.4134.stgit@pasha-VirtualBox>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
replay/replay-events.c
replay/replay.c

index 54dd9d260680721cafab4a1a96c00b9b9a524dcb..3d5fc8a479c077e7aeb1ac68aa30557dd4132a6f 100644 (file)
@@ -205,6 +205,7 @@ static void replay_save_event(Event *event, int checkpoint)
 void replay_save_events(int checkpoint)
 {
     g_assert(replay_mutex_locked());
+    g_assert(checkpoint != CHECKPOINT_CLOCK_WARP_START);
     while (!QTAILQ_EMPTY(&events_list)) {
         Event *event = QTAILQ_FIRST(&events_list);
         replay_save_event(event, checkpoint);
index eae8daf18ab8e9c2eb10b82441f27b5aedd58e69..822826140118eaf0575bbfa8050efeb9d4b390d3 100644 (file)
@@ -211,7 +211,12 @@ bool replay_checkpoint(ReplayCheckpoint checkpoint)
     } else if (replay_mode == REPLAY_MODE_RECORD) {
         g_assert(replay_mutex_locked());
         replay_put_event(EVENT_CHECKPOINT + checkpoint);
-        replay_save_events(checkpoint);
+        /* This checkpoint belongs to several threads.
+           Processing events from different threads is
+           non-deterministic */
+        if (checkpoint != CHECKPOINT_CLOCK_WARP_START) {
+            replay_save_events(checkpoint);
+        }
         res = true;
     }
 out: