All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes
@ 2019-07-24  8:43 Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 01/14] replay: add missing fix for internal function Pavel Dovgalyuk
                   ` (14 more replies)
  0 siblings, 15 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

The set of patches include the latest fixes for record/replay icount function:
 - fix for icount for the case when translation blocks are chained
 - block operation fixes for rr mode
 - development documentation update
 - some refactoring

These patches make record/replay functional on the latest 4.2 QEMU core.

---

Pavel Dovgalyuk (13):
      block: implement bdrv_snapshot_goto for blkreplay
      replay: disable default snapshot for record/replay
      replay: update docs for record/replay with block devices
      replay: don't drain/flush bdrv queue while RR is working
      replay: finish record/replay before closing the disks
      replay: provide an accessor for rr filename
      replay: add BH oneshot event for block layer
      replay: document development rules
      util/qemu-timer: refactor deadline calculation for external timers
      replay: fix replay shutdown
      replay: refine replay-time module
      replay: rename step-related variables and functions
      icount: clean up cpu_can_io before jumping to the next block

pbonzini@redhat.com (1):
      replay: add missing fix for internal function


 accel/tcg/tcg-runtime.c   |    2 ++
 block/blkreplay.c         |    8 ++++++++
 block/block-backend.c     |    8 +++++---
 block/io.c                |   32 +++++++++++++++++++++++++++++--
 block/iscsi.c             |    5 +++--
 block/nfs.c               |    5 +++--
 block/null.c              |    4 +++-
 block/nvme.c              |    6 ++++--
 block/rbd.c               |    5 +++--
 block/vxhs.c              |    5 +++--
 cpus.c                    |   11 ++++-------
 docs/devel/replay.txt     |   46 +++++++++++++++++++++++++++++++++++++++++++++
 docs/replay.txt           |   12 +++++++++---
 include/qemu/timer.h      |    7 +++----
 include/sysemu/replay.h   |    7 ++++++-
 qtest.c                   |    2 +-
 replay/replay-events.c    |   18 +++++++++++++++++-
 replay/replay-internal.c  |   10 +++++-----
 replay/replay-internal.h  |   11 ++++++-----
 replay/replay-snapshot.c  |    6 +++---
 replay/replay-time.c      |   36 ++++++++++++++++-------------------
 replay/replay.c           |   39 +++++++++++++++++++++++---------------
 stubs/Makefile.objs       |    1 +
 stubs/replay-user.c       |    9 +++++++++
 tests/ptimer-test-stubs.c |    4 ++--
 tests/ptimer-test.c       |    4 ++--
 util/qemu-timer.c         |   41 ++++++++++++++++++++++++++++++++--------
 vl.c                      |   11 +++++++++--
 28 files changed, 259 insertions(+), 96 deletions(-)
 create mode 100644 docs/devel/replay.txt
 create mode 100644 stubs/replay-user.c

-- 
Pavel Dovgalyuk


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 01/14] replay: add missing fix for internal function
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
@ 2019-07-24  8:43 ` Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 02/14] block: implement bdrv_snapshot_goto for blkreplay Pavel Dovgalyuk
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: pbonzini@redhat.com <pbonzini@redhat.com>

This is a fix which was missed by patch
74c0b816adfc6aa1b01b4426fdf385e32e35cbac, which added current_step
parameter to the replay_advance_current_step function.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 replay/replay-internal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/replay/replay-internal.c b/replay/replay-internal.c
index 9e41ed1dcf..979f3a0b39 100644
--- a/replay/replay-internal.c
+++ b/replay/replay-internal.c
@@ -228,7 +228,7 @@ void replay_mutex_unlock(void)
 
 void replay_advance_current_step(uint64_t current_step)
 {
-    int diff = (int)(replay_get_current_step() - replay_state.current_step);
+    int diff = (int)(current_step - replay_state.current_step);
 
     /* Time can only go forward */
     assert(diff >= 0);



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 02/14] block: implement bdrv_snapshot_goto for blkreplay
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 01/14] replay: add missing fix for internal function Pavel Dovgalyuk
@ 2019-07-24  8:43 ` Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 03/14] replay: disable default snapshot for record/replay Pavel Dovgalyuk
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>

This patch enables making snapshots with blkreplay used in
block devices.
This function is required to make bdrv_snapshot_goto without
calling .bdrv_open which is not implemented.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Acked-by: Kevin Wolf <kwolf@redhat.com>
---
 block/blkreplay.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/blkreplay.c b/block/blkreplay.c
index 2b7931b940..c96ac8f4bc 100644
--- a/block/blkreplay.c
+++ b/block/blkreplay.c
@@ -126,6 +126,12 @@ static int coroutine_fn blkreplay_co_flush(BlockDriverState *bs)
     return ret;
 }
 
+static int blkreplay_snapshot_goto(BlockDriverState *bs,
+                                   const char *snapshot_id)
+{
+    return bdrv_snapshot_goto(bs->file->bs, snapshot_id, NULL);
+}
+
 static BlockDriver bdrv_blkreplay = {
     .format_name            = "blkreplay",
     .instance_size          = 0,
@@ -140,6 +146,8 @@ static BlockDriver bdrv_blkreplay = {
     .bdrv_co_pwrite_zeroes  = blkreplay_co_pwrite_zeroes,
     .bdrv_co_pdiscard       = blkreplay_co_pdiscard,
     .bdrv_co_flush          = blkreplay_co_flush,
+
+    .bdrv_snapshot_goto     = blkreplay_snapshot_goto,
 };
 
 static void bdrv_blkreplay_init(void)



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 03/14] replay: disable default snapshot for record/replay
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 01/14] replay: add missing fix for internal function Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 02/14] block: implement bdrv_snapshot_goto for blkreplay Pavel Dovgalyuk
@ 2019-07-24  8:43 ` Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 04/14] replay: update docs for record/replay with block devices Pavel Dovgalyuk
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>

This patch disables setting '-snapshot' option on by default
in record/replay mode. This is needed for creating vmstates in record
and replay modes.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Acked-by: Kevin Wolf <kwolf@redhat.com>
---
 vl.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index b426b32134..b73fd078a8 100644
--- a/vl.c
+++ b/vl.c
@@ -1202,7 +1202,7 @@ static void configure_blockdev(BlockdevOptionsQueue *bdo_queue,
         qapi_free_BlockdevOptions(bdo->bdo);
         g_free(bdo);
     }
-    if (snapshot || replay_mode != REPLAY_MODE_NONE) {
+    if (snapshot) {
         qemu_opts_foreach(qemu_find_opts("drive"), drive_enable_snapshot,
                           NULL, NULL);
     }
@@ -3051,7 +3051,13 @@ int main(int argc, char **argv, char **envp)
                 drive_add(IF_PFLASH, -1, optarg, PFLASH_OPTS);
                 break;
             case QEMU_OPTION_snapshot:
-                snapshot = 1;
+                {
+                    Error *blocker = NULL;
+                    snapshot = 1;
+                    error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED,
+                               "-snapshot");
+                    replay_add_blocker(blocker);
+                }
                 break;
             case QEMU_OPTION_numa:
                 opts = qemu_opts_parse_noisily(qemu_find_opts("numa"),



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 04/14] replay: update docs for record/replay with block devices
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (2 preceding siblings ...)
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 03/14] replay: disable default snapshot for record/replay Pavel Dovgalyuk
@ 2019-07-24  8:43 ` Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 05/14] replay: don't drain/flush bdrv queue while RR is working Pavel Dovgalyuk
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch updates the description of the command lines for using
record/replay with attached block devices.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 docs/replay.txt |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/docs/replay.txt b/docs/replay.txt
index ee6aee9861..ce97c3f72f 100644
--- a/docs/replay.txt
+++ b/docs/replay.txt
@@ -27,7 +27,7 @@ Usage of the record/replay:
  * First, record the execution with the following command line:
     qemu-system-i386 \
      -icount shift=7,rr=record,rrfile=replay.bin \
-     -drive file=disk.qcow2,if=none,id=img-direct \
+     -drive file=disk.qcow2,if=none,snapshot,id=img-direct \
      -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \
      -device ide-hd,drive=img-blkreplay \
      -netdev user,id=net1 -device rtl8139,netdev=net1 \
@@ -35,7 +35,7 @@ Usage of the record/replay:
  * After recording, you can replay it by using another command line:
     qemu-system-i386 \
      -icount shift=7,rr=replay,rrfile=replay.bin \
-     -drive file=disk.qcow2,if=none,id=img-direct \
+     -drive file=disk.qcow2,if=none,snapshot,id=img-direct \
      -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \
      -device ide-hd,drive=img-blkreplay \
      -netdev user,id=net1 -device rtl8139,netdev=net1 \
@@ -223,7 +223,7 @@ Block devices record/replay module intercepts calls of
 bdrv coroutine functions at the top of block drivers stack.
 To record and replay block operations the drive must be configured
 as following:
- -drive file=disk.qcow2,if=none,id=img-direct
+ -drive file=disk.qcow2,if=none,snapshot,id=img-direct
  -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay
  -device ide-hd,drive=img-blkreplay
 
@@ -252,6 +252,12 @@ This snapshot is created at start of recording and restored at start
 of replaying. It also can be loaded while replaying to roll back
 the execution.
 
+'snapshot' flag of the disk image must be removed to save the snapshots
+in the overlay (or original image) instead of using the temporary overlay.
+ -drive file=disk.ovl,if=none,id=img-direct
+ -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay
+ -device ide-hd,drive=img-blkreplay
+
 Use QEMU monitor to create additional snapshots. 'savevm <name>' command
 created the snapshot and 'loadvm <name>' restores it. To prevent corruption
 of the original disk image, use overlay files linked to the original images.



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 05/14] replay: don't drain/flush bdrv queue while RR is working
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (3 preceding siblings ...)
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 04/14] replay: update docs for record/replay with block devices Pavel Dovgalyuk
@ 2019-07-24  8:43 ` Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 06/14] replay: finish record/replay before closing the disks Pavel Dovgalyuk
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

In record/replay mode bdrv queue is controlled by replay mechanism.
It does not allow saving or loading the snapshots
when bdrv queue is not empty. Stopping the VM is not blocked by nonempty
queue, but flushing the queue is still impossible there,
because it may cause deadlocks in replay mode.
This patch disables bdrv_drain_all and bdrv_flush_all in
record/replay mode.

Stopping the machine when the IO requests are not finished is needed
for the debugging. E.g., breakpoint may be set at the specified step,
and forcing the IO requests to finish may break the determinism
of the execution.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Acked-by: Kevin Wolf <kwolf@redhat.com>
---
 block/io.c |   28 ++++++++++++++++++++++++++++
 cpus.c     |    2 --
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/block/io.c b/block/io.c
index 06305c6ea6..2e71bcb8d6 100644
--- a/block/io.c
+++ b/block/io.c
@@ -32,6 +32,7 @@
 #include "qemu/cutils.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
+#include "sysemu/replay.h"
 
 #define NOT_DONE 0x7fffffff /* used while emulated sync operation in progress */
 
@@ -598,6 +599,15 @@ void bdrv_drain_all_begin(void)
         return;
     }
 
+    /*
+     * bdrv queue is managed by record/replay,
+     * waiting for finishing the I/O requests may
+     * be infinite
+     */
+    if (replay_events_enabled()) {
+        return;
+    }
+
     /* AIO_WAIT_WHILE() with a NULL context can only be called from the main
      * loop AioContext, so make sure we're in the main context. */
     assert(qemu_get_current_aio_context() == qemu_get_aio_context());
@@ -627,6 +637,15 @@ void bdrv_drain_all_end(void)
     BlockDriverState *bs = NULL;
     int drained_end_counter = 0;
 
+    /*
+     * bdrv queue is managed by record/replay,
+     * waiting for finishing the I/O requests may
+     * be endless
+     */
+    if (replay_events_enabled()) {
+        return;
+    }
+
     while ((bs = bdrv_next_all_states(bs))) {
         AioContext *aio_context = bdrv_get_aio_context(bs);
 
@@ -1997,6 +2016,15 @@ int bdrv_flush_all(void)
     BlockDriverState *bs = NULL;
     int result = 0;
 
+    /*
+     * bdrv queue is managed by record/replay,
+     * creating new flush request for stopping
+     * the VM may break the determinism
+     */
+    if (replay_events_enabled()) {
+        return result;
+    }
+
     for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
         AioContext *aio_context = bdrv_get_aio_context(bs);
         int ret;
diff --git a/cpus.c b/cpus.c
index 927a00aa90..a71081b709 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1081,7 +1081,6 @@ static int do_vm_stop(RunState state, bool send_stop)
     }
 
     bdrv_drain_all();
-    replay_disable_events();
     ret = bdrv_flush_all();
 
     return ret;
@@ -2162,7 +2161,6 @@ int vm_prepare_start(void)
     /* We are sending this now, but the CPUs will be resumed shortly later */
     qapi_event_send_resume();
 
-    replay_enable_events();
     cpu_enable_ticks();
     runstate_set(RUN_STATE_RUNNING);
     vm_state_notify(1, RUN_STATE_RUNNING);



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 06/14] replay: finish record/replay before closing the disks
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (4 preceding siblings ...)
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 05/14] replay: don't drain/flush bdrv queue while RR is working Pavel Dovgalyuk
@ 2019-07-24  8:43 ` Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 07/14] replay: provide an accessor for rr filename Pavel Dovgalyuk
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

After recent updates block devices cannot be closed on qemu exit.
This happens due to the block request polling when replay is not finished.
Therefore now we stop execution recording before closing the block devices.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
 replay/replay.c |    2 ++
 vl.c            |    1 +
 2 files changed, 3 insertions(+)

diff --git a/replay/replay.c b/replay/replay.c
index 8b172b2d1b..b75820a1c1 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -385,6 +385,8 @@ void replay_finish(void)
     g_free(replay_snapshot);
     replay_snapshot = NULL;
 
+    replay_mode = REPLAY_MODE_NONE;
+
     replay_finish_events();
 }
 
diff --git a/vl.c b/vl.c
index b73fd078a8..2a341f5ad2 100644
--- a/vl.c
+++ b/vl.c
@@ -4499,6 +4499,7 @@ int main(int argc, char **argv, char **envp)
 
     /* No more vcpu or device emulation activity beyond this point */
     vm_shutdown();
+    replay_finish();
 
     job_cancel_sync_all();
     bdrv_close_all();



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 07/14] replay: provide an accessor for rr filename
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (5 preceding siblings ...)
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 06/14] replay: finish record/replay before closing the disks Pavel Dovgalyuk
@ 2019-07-24  8:43 ` Pavel Dovgalyuk
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 08/14] replay: add BH oneshot event for block layer Pavel Dovgalyuk
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch adds an accessor function for the name of the record/replay
log file. Adding an accessor instead of making variable global,
prevents accidental modification of this variable by other modules.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 include/sysemu/replay.h |    2 ++
 replay/replay.c         |    5 +++++
 2 files changed, 7 insertions(+)

diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index 3a7c58e423..b3f593f2f0 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -71,6 +71,8 @@ void replay_start(void);
 void replay_finish(void);
 /*! Adds replay blocker with the specified error description */
 void replay_add_blocker(Error *reason);
+/* Returns name of the replay log file */
+const char *replay_get_filename(void);
 
 /* Processing the instructions */
 
diff --git a/replay/replay.c b/replay/replay.c
index b75820a1c1..aa534116b5 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -394,3 +394,8 @@ void replay_add_blocker(Error *reason)
 {
     replay_blockers = g_slist_prepend(replay_blockers, reason);
 }
+
+const char *replay_get_filename(void)
+{
+    return replay_filename;
+}



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 08/14] replay: add BH oneshot event for block layer
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (6 preceding siblings ...)
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 07/14] replay: provide an accessor for rr filename Pavel Dovgalyuk
@ 2019-07-24  8:43 ` Pavel Dovgalyuk
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 09/14] replay: document development rules Pavel Dovgalyuk
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

Replay is capable of recording normal BH events, but sometimes
there are single use callbacks scheduled with aio_bh_schedule_oneshot
function. This patch enables recording and replaying such callbacks.
Block layer uses these events for calling the completion function.
Replaying these calls makes the execution deterministic.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Acked-by: Kevin Wolf <kwolf@redhat.com>

--

v6:
 - moved stub function to the separate file for fixing linux-user build
v10:
 - replaced all block layer aio_bh_schedule_oneshot calls
---
 block/block-backend.c    |    8 +++++---
 block/io.c               |    4 ++--
 block/iscsi.c            |    5 +++--
 block/nfs.c              |    5 +++--
 block/null.c             |    4 +++-
 block/nvme.c             |    6 ++++--
 block/rbd.c              |    5 +++--
 block/vxhs.c             |    5 +++--
 include/sysemu/replay.h  |    3 +++
 replay/replay-events.c   |   16 ++++++++++++++++
 replay/replay-internal.h |    1 +
 replay/replay.c          |    2 +-
 stubs/Makefile.objs      |    1 +
 stubs/replay-user.c      |    9 +++++++++
 14 files changed, 57 insertions(+), 17 deletions(-)
 create mode 100644 stubs/replay-user.c

diff --git a/block/block-backend.c b/block/block-backend.c
index 0056b526b8..b8b45e9e82 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -17,6 +17,7 @@
 #include "block/throttle-groups.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/replay.h"
 #include "qapi/error.h"
 #include "qapi/qapi-events-block.h"
 #include "qemu/id.h"
@@ -1296,7 +1297,8 @@ BlockAIOCB *blk_abort_aio_request(BlockBackend *blk,
     acb->blk = blk;
     acb->ret = ret;
 
-    aio_bh_schedule_oneshot(blk_get_aio_context(blk), error_callback_bh, acb);
+    replay_bh_schedule_oneshot_event(blk_get_aio_context(blk),
+                                     error_callback_bh, acb);
     return &acb->common;
 }
 
@@ -1352,8 +1354,8 @@ static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset, int bytes,
 
     acb->has_returned = true;
     if (acb->rwco.ret != NOT_DONE) {
-        aio_bh_schedule_oneshot(blk_get_aio_context(blk),
-                                blk_aio_complete_bh, acb);
+        replay_bh_schedule_oneshot_event(blk_get_aio_context(blk),
+                                         blk_aio_complete_bh, acb);
     }
 
     return &acb->common;
diff --git a/block/io.c b/block/io.c
index 2e71bcb8d6..ebff47e6e1 100644
--- a/block/io.c
+++ b/block/io.c
@@ -367,8 +367,8 @@ static void coroutine_fn bdrv_co_yield_to_drain(BlockDriverState *bs,
     if (bs) {
         bdrv_inc_in_flight(bs);
     }
-    aio_bh_schedule_oneshot(bdrv_get_aio_context(bs),
-                            bdrv_co_drain_bh_cb, &data);
+    replay_bh_schedule_oneshot_event(bdrv_get_aio_context(bs),
+                                     bdrv_co_drain_bh_cb, &data);
 
     qemu_coroutine_yield();
     /* If we are resumed from some other event (such as an aio completion or a
diff --git a/block/iscsi.c b/block/iscsi.c
index 506bf5f875..2ced15066a 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -40,6 +40,7 @@
 #include "qemu/module.h"
 #include "qemu/option.h"
 #include "qemu/uuid.h"
+#include "sysemu/replay.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-misc.h"
 #include "qapi/qmp/qdict.h"
@@ -280,8 +281,8 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
     }
 
     if (iTask->co) {
-        aio_bh_schedule_oneshot(iTask->iscsilun->aio_context,
-                                 iscsi_co_generic_bh_cb, iTask);
+        replay_bh_schedule_oneshot_event(iTask->iscsilun->aio_context,
+                                         iscsi_co_generic_bh_cb, iTask);
     } else {
         iTask->complete = 1;
     }
diff --git a/block/nfs.c b/block/nfs.c
index d93241b3bb..cfd6c956b3 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -37,6 +37,7 @@
 #include "qemu/uri.h"
 #include "qemu/cutils.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/replay.h"
 #include "qapi/qapi-visit-block-core.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qstring.h"
@@ -257,8 +258,8 @@ nfs_co_generic_cb(int ret, struct nfs_context *nfs, void *data,
     if (task->ret < 0) {
         error_report("NFS Error: %s", nfs_get_error(nfs));
     }
-    aio_bh_schedule_oneshot(task->client->aio_context,
-                            nfs_co_generic_bh_cb, task);
+    replay_bh_schedule_oneshot_event(task->client->aio_context,
+                                     nfs_co_generic_bh_cb, task);
 }
 
 static int coroutine_fn nfs_co_preadv(BlockDriverState *bs, uint64_t offset,
diff --git a/block/null.c b/block/null.c
index 699aa295cb..15e1d56746 100644
--- a/block/null.c
+++ b/block/null.c
@@ -17,6 +17,7 @@
 #include "qemu/module.h"
 #include "qemu/option.h"
 #include "block/block_int.h"
+#include "sysemu/replay.h"
 
 #define NULL_OPT_LATENCY "latency-ns"
 #define NULL_OPT_ZEROES  "read-zeroes"
@@ -179,7 +180,8 @@ static inline BlockAIOCB *null_aio_common(BlockDriverState *bs,
         timer_mod_ns(&acb->timer,
                      qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + s->latency_ns);
     } else {
-        aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), null_bh_cb, acb);
+        replay_bh_schedule_oneshot_event(bdrv_get_aio_context(bs),
+                                         null_bh_cb, acb);
     }
     return &acb->common;
 }
diff --git a/block/nvme.c b/block/nvme.c
index c28755cc31..ac652e878c 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -22,6 +22,7 @@
 #include "qemu/option.h"
 #include "qemu/vfio-helpers.h"
 #include "block/block_int.h"
+#include "sysemu/replay.h"
 #include "trace.h"
 
 #include "block/nvme.h"
@@ -350,7 +351,8 @@ static bool nvme_process_completion(BDRVNVMeState *s, NVMeQueuePair *q)
         smp_mb_release();
         *q->cq.doorbell = cpu_to_le32(q->cq.head);
         if (!qemu_co_queue_empty(&q->free_req_queue)) {
-            aio_bh_schedule_oneshot(s->aio_context, nvme_free_req_queue_cb, q);
+            replay_bh_schedule_oneshot_event(s->aio_context,
+                                             nvme_free_req_queue_cb, q);
         }
     }
     q->busy = false;
@@ -934,7 +936,7 @@ static void nvme_rw_cb(void *opaque, int ret)
         /* The rw coroutine hasn't yielded, don't try to enter. */
         return;
     }
-    aio_bh_schedule_oneshot(data->ctx, nvme_rw_cb_bh, data);
+    replay_bh_schedule_oneshot_event(data->ctx, nvme_rw_cb_bh, data);
 }
 
 static coroutine_fn int nvme_co_prw_aligned(BlockDriverState *bs,
diff --git a/block/rbd.c b/block/rbd.c
index 59757b3120..a1ce5b9292 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -22,6 +22,7 @@
 #include "block/qdict.h"
 #include "crypto/secret.h"
 #include "qemu/cutils.h"
+#include "sysemu/replay.h"
 #include "qapi/qmp/qstring.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qjson.h"
@@ -884,8 +885,8 @@ static void rbd_finish_aiocb(rbd_completion_t c, RADOSCB *rcb)
     rcb->ret = rbd_aio_get_return_value(c);
     rbd_aio_release(c);
 
-    aio_bh_schedule_oneshot(bdrv_get_aio_context(acb->common.bs),
-                            rbd_finish_bh, rcb);
+    replay_bh_schedule_oneshot_event(bdrv_get_aio_context(acb->common.bs),
+                                     rbd_finish_bh, rcb);
 }
 
 static int rbd_aio_discard_wrapper(rbd_image_t image,
diff --git a/block/vxhs.c b/block/vxhs.c
index 77fd5eb20d..d79fc97df6 100644
--- a/block/vxhs.c
+++ b/block/vxhs.c
@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "qemu/uuid.h"
 #include "crypto/tlscredsx509.h"
+#include "sysemu/replay.h"
 
 #define VXHS_OPT_FILENAME           "filename"
 #define VXHS_OPT_VDISK_ID           "vdisk-id"
@@ -105,8 +106,8 @@ static void vxhs_iio_callback(void *ctx, uint32_t opcode, uint32_t error)
             trace_vxhs_iio_callback(error);
         }
 
-        aio_bh_schedule_oneshot(bdrv_get_aio_context(acb->common.bs),
-                                vxhs_complete_aio_bh, acb);
+        replay_bh_schedule_oneshot_event(bdrv_get_aio_context(acb->common.bs),
+                                         vxhs_complete_aio_bh, acb);
         break;
 
     default:
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index b3f593f2f0..503bb6258d 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -142,6 +142,9 @@ void replay_enable_events(void);
 bool replay_events_enabled(void);
 /*! Adds bottom half event to the queue */
 void replay_bh_schedule_event(QEMUBH *bh);
+/* Adds oneshot bottom half event to the queue */
+void replay_bh_schedule_oneshot_event(AioContext *ctx,
+    QEMUBHFunc *cb, void *opaque);
 /*! Adds input event to the queue */
 void replay_input_event(QemuConsole *src, InputEvent *evt);
 /*! Adds input sync event to the queue */
diff --git a/replay/replay-events.c b/replay/replay-events.c
index 60d17f6edb..e5bf1bc2e6 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -36,6 +36,9 @@ static void replay_run_event(Event *event)
     case REPLAY_ASYNC_EVENT_BH:
         aio_bh_call(event->opaque);
         break;
+    case REPLAY_ASYNC_EVENT_BH_ONESHOT:
+        ((QEMUBHFunc *)event->opaque)(event->opaque2);
+        break;
     case REPLAY_ASYNC_EVENT_INPUT:
         qemu_input_event_send_impl(NULL, (InputEvent *)event->opaque);
         qapi_free_InputEvent((InputEvent *)event->opaque);
@@ -131,6 +134,17 @@ void replay_bh_schedule_event(QEMUBH *bh)
     }
 }
 
+void replay_bh_schedule_oneshot_event(AioContext *ctx,
+    QEMUBHFunc *cb, void *opaque)
+{
+    if (events_enabled) {
+        uint64_t id = replay_get_current_step();
+        replay_add_event(REPLAY_ASYNC_EVENT_BH_ONESHOT, cb, opaque, id);
+    } else {
+        aio_bh_schedule_oneshot(ctx, cb, opaque);
+    }
+}
+
 void replay_add_input_event(struct InputEvent *event)
 {
     replay_add_event(REPLAY_ASYNC_EVENT_INPUT, event, NULL, 0);
@@ -161,6 +175,7 @@ static void replay_save_event(Event *event, int checkpoint)
         /* save event-specific data */
         switch (event->event_kind) {
         case REPLAY_ASYNC_EVENT_BH:
+        case REPLAY_ASYNC_EVENT_BH_ONESHOT:
             replay_put_qword(event->id);
             break;
         case REPLAY_ASYNC_EVENT_INPUT:
@@ -216,6 +231,7 @@ static Event *replay_read_event(int checkpoint)
     /* Events that has not to be in the queue */
     switch (replay_state.read_event_kind) {
     case REPLAY_ASYNC_EVENT_BH:
+    case REPLAY_ASYNC_EVENT_BH_ONESHOT:
         if (replay_state.read_event_id == -1) {
             replay_state.read_event_id = replay_get_qword();
         }
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index af6f4d55d4..f3cdcfd93e 100644
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -51,6 +51,7 @@ enum ReplayEvents {
 
 enum ReplayAsyncEventKind {
     REPLAY_ASYNC_EVENT_BH,
+    REPLAY_ASYNC_EVENT_BH_ONESHOT,
     REPLAY_ASYNC_EVENT_INPUT,
     REPLAY_ASYNC_EVENT_INPUT_SYNC,
     REPLAY_ASYNC_EVENT_CHAR_READ,
diff --git a/replay/replay.c b/replay/replay.c
index aa534116b5..df019c51ad 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -22,7 +22,7 @@
 
 /* Current version of the replay mechanism.
    Increase it when file format changes. */
-#define REPLAY_VERSION              0xe02007
+#define REPLAY_VERSION              0xe02008
 /* Size of replay log header */
 #define HEADER_SIZE                 (sizeof(uint32_t) + sizeof(uint64_t))
 
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 9c7393b08c..4a50e95ec3 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -20,6 +20,7 @@ stub-obj-y += monitor.o
 stub-obj-y += notify-event.o
 stub-obj-y += qtest.o
 stub-obj-y += replay.o
+stub-obj-y += replay-user.o
 stub-obj-y += runstate-check.o
 stub-obj-y += set-fd-handler.o
 stub-obj-y += sysbus.o
diff --git a/stubs/replay-user.c b/stubs/replay-user.c
new file mode 100644
index 0000000000..2ad9e27203
--- /dev/null
+++ b/stubs/replay-user.c
@@ -0,0 +1,9 @@
+#include "qemu/osdep.h"
+#include "sysemu/replay.h"
+#include "sysemu/sysemu.h"
+
+void replay_bh_schedule_oneshot_event(AioContext *ctx,
+    QEMUBHFunc *cb, void *opaque)
+{
+    aio_bh_schedule_oneshot(ctx, cb, opaque);
+}



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 09/14] replay: document development rules
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (7 preceding siblings ...)
  2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 08/14] replay: add BH oneshot event for block layer Pavel Dovgalyuk
@ 2019-07-24  8:44 ` Pavel Dovgalyuk
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers Pavel Dovgalyuk
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch introduces docs/devel/replay.txt which describes the rules
that should be followed to make virtual devices usable in record/replay mode.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgauk@ispras.ru>

--

v9: fixed external virtual clock description (reported by Artem Pisarenko)
---
 docs/devel/replay.txt |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 docs/devel/replay.txt

diff --git a/docs/devel/replay.txt b/docs/devel/replay.txt
new file mode 100644
index 0000000000..e641c35add
--- /dev/null
+++ b/docs/devel/replay.txt
@@ -0,0 +1,46 @@
+Record/replay mechanism, that could be enabled through icount mode, expects
+the virtual devices to satisfy the following requirements.
+
+The main idea behind this document is that everything that affects
+the guest state during execution in icount mode should be deterministic.
+
+Timers
+======
+
+All virtual devices should use virtual clock for timers that change the guest
+state. Virtual clock is deterministic, therefore such timers are deterministic
+too.
+
+Virtual devices can also use realtime clock for the events that do not change
+the guest state directly. When the clock ticking should depend on VM execution
+speed, use virtual clock with EXTERNAL attribute. It is not deterministic,
+but its speed depends on the guest execution. This clock is used by
+the virtual devices (e.g., slirp routing device) that lie outside the
+replayed guest.
+
+Bottom halves
+=============
+
+Bottom half callbacks, that affect the guest state, should be invoked through
+replay_bh_schedule_event or replay_bh_schedule_oneshot_event functions.
+Their invocations are saved in record mode and synchronized with the existing
+log in replay mode.
+
+Saving/restoring the VM state
+=============================
+
+All fields in the device state structure (including virtual timers)
+should be restored by loadvm to the same values they had before savevm.
+
+Avoid accessing other devices' state, because the order of saving/restoring
+is not defined. It means that you should not call functions like
+'update_irq' in post_load callback. Save everything explicitly to avoid
+the dependencies that may make restoring the VM state non-deterministic.
+
+Stopping the VM
+===============
+
+Stopping the guest should not interfere with its state (with the exception
+of the network connections, that could be broken by the remote timeouts).
+VM can be stopped at any moment of replay by the user. Restarting the VM
+after that stop should not break the replay by the unneeded guest state change.



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (8 preceding siblings ...)
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 09/14] replay: document development rules Pavel Dovgalyuk
@ 2019-07-24  8:44 ` Pavel Dovgalyuk
  2019-07-24 14:28   ` Paolo Bonzini
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 11/14] replay: fix replay shutdown Pavel Dovgalyuk
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

icount-based record/replay uses qemu_clock_deadline_ns_all to measure
the period until vCPU may be interrupted.
This function takes in account the virtual timers, because they belong
to the virtual devices that may generate interrupt request or affect
the virtual machine state.
However, there are a subset of virtual timers, that are marked with
'external' flag. These do not change the virtual machine state and
only based on virtual clock. Calculating the deadling using the external
timers breaks the determinism, because they do not belong to the replayed
part of the virtual machine.
This patch fixes the deadline calculation for this case.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

--

v15 changes:
 - fixed misprint in the test
---
 cpus.c                    |    9 ++++-----
 include/qemu/timer.h      |    7 +++----
 qtest.c                   |    2 +-
 tests/ptimer-test-stubs.c |    4 ++--
 tests/ptimer-test.c       |    4 ++--
 util/qemu-timer.c         |   41 +++++++++++++++++++++++++++++++++--------
 6 files changed, 45 insertions(+), 22 deletions(-)

diff --git a/cpus.c b/cpus.c
index a71081b709..3bce11df8c 100644
--- a/cpus.c
+++ b/cpus.c
@@ -553,7 +553,7 @@ void qtest_clock_warp(int64_t dest)
     assert(qtest_enabled());
     aio_context = qemu_get_aio_context();
     while (clock < dest) {
-        int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+        int64_t deadline = virtual_clock_deadline_ns();
         int64_t warp = qemu_soonest_timeout(dest - clock, deadline);
 
         seqlock_write_lock(&timers_state.vm_clock_seqlock,
@@ -613,7 +613,7 @@ void qemu_start_warp_timer(void)
 
     /* We want to use the earliest deadline from ALL vm_clocks */
     clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT);
-    deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+    deadline = virtual_clock_deadline_ns();
     if (deadline < 0) {
         static bool notified;
         if (!icount_sleep && !notified) {
@@ -1348,7 +1348,7 @@ static int64_t tcg_get_icount_limit(void)
     int64_t deadline;
 
     if (replay_mode != REPLAY_MODE_PLAY) {
-        deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+        deadline = virtual_clock_deadline_ns();
 
         /* Maintain prior (possibly buggy) behaviour where if no deadline
          * was set (as there is no QEMU_CLOCK_VIRTUAL timer) or it is more than
@@ -1369,8 +1369,7 @@ static void handle_icount_deadline(void)
 {
     assert(qemu_in_vcpu_thread());
     if (use_icount) {
-        int64_t deadline =
-            qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+        int64_t deadline = virtual_clock_deadline_ns();
 
         if (deadline == 0) {
             /* Wake up other AioContexts.  */
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 5d978e1634..9df45fbaeb 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -175,16 +175,15 @@ bool qemu_clock_expired(QEMUClockType type);
 bool qemu_clock_use_for_deadline(QEMUClockType type);
 
 /**
- * qemu_clock_deadline_ns_all:
- * @type: the clock type
+ * virtual_clock_deadline_ns:
  *
  * Calculate the deadline across all timer lists associated
- * with a clock (as opposed to just the default one)
+ * with virtual clock (excluding external timers)
  * in nanoseconds, or -1 if no timer is set to expire.
  *
  * Returns: time until expiry in nanoseconds or -1
  */
-int64_t qemu_clock_deadline_ns_all(QEMUClockType type);
+int64_t virtual_clock_deadline_ns(void);
 
 /**
  * qemu_clock_get_main_loop_timerlist:
diff --git a/qtest.c b/qtest.c
index 15e27e911f..825bf558d1 100644
--- a/qtest.c
+++ b/qtest.c
@@ -655,7 +655,7 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
             int ret = qemu_strtoi64(words[1], NULL, 0, &ns);
             g_assert(ret == 0);
         } else {
-            ns = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+            ns = virtual_clock_deadline_ns();
         }
         qtest_clock_warp(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + ns);
         qtest_send_prefix(chr);
diff --git a/tests/ptimer-test-stubs.c b/tests/ptimer-test-stubs.c
index 54b3fd26f6..49acfed76f 100644
--- a/tests/ptimer-test-stubs.c
+++ b/tests/ptimer-test-stubs.c
@@ -88,9 +88,9 @@ int64_t qemu_clock_get_ns(QEMUClockType type)
     return ptimer_test_time_ns;
 }
 
-int64_t qemu_clock_deadline_ns_all(QEMUClockType type)
+int64_t virtual_clock_deadline_ns(void)
 {
-    QEMUTimerList *timer_list = main_loop_tlg.tl[type];
+    QEMUTimerList *timer_list = main_loop_tlg.tl[QEMU_CLOCK_VIRTUAL];
     QEMUTimer *t = timer_list->active_timers.next;
     int64_t deadline = -1;
 
diff --git a/tests/ptimer-test.c b/tests/ptimer-test.c
index b30aad0737..338a4e0c10 100644
--- a/tests/ptimer-test.c
+++ b/tests/ptimer-test.c
@@ -50,13 +50,13 @@ static void ptimer_test_set_qemu_time_ns(int64_t ns)
 
 static void qemu_clock_step(uint64_t ns)
 {
-    int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+    int64_t deadline = virtual_clock_deadline_ns();
     int64_t advanced_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + ns;
 
     while (deadline != -1 && deadline <= advanced_time) {
         ptimer_test_set_qemu_time_ns(deadline);
         ptimer_test_expire_qemu_timers(deadline, QEMU_CLOCK_VIRTUAL);
-        deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+        deadline = virtual_clock_deadline_ns();
     }
 
     ptimer_test_set_qemu_time_ns(advanced_time);
diff --git a/util/qemu-timer.c b/util/qemu-timer.c
index 1cc1b2f2c3..88fbf04469 100644
--- a/util/qemu-timer.c
+++ b/util/qemu-timer.c
@@ -236,6 +236,7 @@ int64_t timerlist_deadline_ns(QEMUTimerList *timer_list)
         qemu_mutex_unlock(&timer_list->active_timers_lock);
         return -1;
     }
+
     expire_time = timer_list->active_timers->expire_time;
     qemu_mutex_unlock(&timer_list->active_timers_lock);
 
@@ -248,19 +249,43 @@ int64_t timerlist_deadline_ns(QEMUTimerList *timer_list)
     return delta;
 }
 
-/* Calculate the soonest deadline across all timerlists attached
- * to the clock. This is used for the icount timeout so we
- * ignore whether or not the clock should be used in deadline
- * calculations.
+/*
+ * Calculate the soonest deadline across all timerlists attached
+ * to the virtual clock (excluding the external timers that do not affect
+ * the replayed guest state.
  */
-int64_t qemu_clock_deadline_ns_all(QEMUClockType type)
+int64_t virtual_clock_deadline_ns(void)
 {
     int64_t deadline = -1;
+    int64_t delta;
+    int64_t expire_time;
+    QEMUTimer *ts;
     QEMUTimerList *timer_list;
-    QEMUClock *clock = qemu_clock_ptr(type);
+    QEMUClock *clock = qemu_clock_ptr(QEMU_CLOCK_VIRTUAL);
+
+    if (!clock->enabled) {
+        return -1;
+    }
+
     QLIST_FOREACH(timer_list, &clock->timerlists, list) {
-        deadline = qemu_soonest_timeout(deadline,
-                                        timerlist_deadline_ns(timer_list));
+        qemu_mutex_lock(&timer_list->active_timers_lock);
+        ts = timer_list->active_timers;
+        /* Skip all external timers */
+        while (ts && (ts->attributes & QEMU_TIMER_ATTR_EXTERNAL)) {
+            ts = ts->next;
+        }
+        if (!ts) {
+            qemu_mutex_unlock(&timer_list->active_timers_lock);
+            continue;
+        }
+        expire_time = ts->expire_time;
+        qemu_mutex_unlock(&timer_list->active_timers_lock);
+
+        delta = expire_time - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
+        if (delta <= 0) {
+            delta = 0;
+        }
+        deadline = qemu_soonest_timeout(deadline, delta);
     }
     return deadline;
 }



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 11/14] replay: fix replay shutdown
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (9 preceding siblings ...)
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers Pavel Dovgalyuk
@ 2019-07-24  8:44 ` Pavel Dovgalyuk
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 12/14] replay: refine replay-time module Pavel Dovgalyuk
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch fixes shutdown of the replay process, which is terminated with
the assert when shutdown event is read from the log.
replay_finish_event reads new data_kind and therefore the value of data_kind
should be preserved to be valid at qemu_system_shutdown_request call.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 replay/replay.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/replay/replay.c b/replay/replay.c
index df019c51ad..73c5d4e207 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -45,14 +45,14 @@ bool replay_next_event_is(int event)
     }
 
     while (true) {
-        if (event == replay_state.data_kind) {
+        unsigned int data_kind = replay_state.data_kind;
+        if (event == data_kind) {
             res = true;
         }
-        switch (replay_state.data_kind) {
+        switch (data_kind) {
         case EVENT_SHUTDOWN ... EVENT_SHUTDOWN_LAST:
             replay_finish_event();
-            qemu_system_shutdown_request(replay_state.data_kind -
-                                         EVENT_SHUTDOWN);
+            qemu_system_shutdown_request(data_kind - EVENT_SHUTDOWN);
             break;
         default:
             /* clock, time_t, checkpoint and other events */



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 12/14] replay: refine replay-time module
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (10 preceding siblings ...)
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 11/14] replay: fix replay shutdown Pavel Dovgalyuk
@ 2019-07-24  8:44 ` Pavel Dovgalyuk
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 13/14] replay: rename step-related variables and functions Pavel Dovgalyuk
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch removes refactoring artifacts from the replay/replay-time.c

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 replay/replay-time.c |   36 ++++++++++++++++--------------------
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/replay/replay-time.c b/replay/replay-time.c
index 5154cb0ce9..49c9e5d8b2 100644
--- a/replay/replay-time.c
+++ b/replay/replay-time.c
@@ -14,18 +14,19 @@
 #include "replay-internal.h"
 #include "qemu/error-report.h"
 
-int64_t replay_save_clock(ReplayClockKind kind, int64_t clock, int64_t raw_icount)
+int64_t replay_save_clock(ReplayClockKind kind, int64_t clock,
+                          int64_t raw_icount)
 {
-    if (replay_file) {
-        g_assert(replay_mutex_locked());
+    g_assert(replay_file);
+    g_assert(replay_mutex_locked());
 
-        /* Due to the caller's locking requirements we get the icount from it
-         * instead of using replay_save_instructions().
-         */
-        replay_advance_current_step(raw_icount);
-        replay_put_event(EVENT_CLOCK + kind);
-        replay_put_qword(clock);
-    }
+    /*
+     * Due to the caller's locking requirements we get the icount from it
+     * instead of using replay_save_instructions().
+     */
+    replay_advance_current_step(raw_icount);
+    replay_put_event(EVENT_CLOCK + kind);
+    replay_put_qword(clock);
 
     return clock;
 }
@@ -47,20 +48,15 @@ void replay_read_next_clock(ReplayClockKind kind)
 /*! Reads next clock event from the input. */
 int64_t replay_read_clock(ReplayClockKind kind)
 {
+    int64_t ret;
     g_assert(replay_file && replay_mutex_locked());
 
     replay_account_executed_instructions();
 
-    if (replay_file) {
-        int64_t ret;
-        if (replay_next_event_is(EVENT_CLOCK + kind)) {
-            replay_read_next_clock(kind);
-        }
-        ret = replay_state.cached_clock[kind];
-
-        return ret;
+    if (replay_next_event_is(EVENT_CLOCK + kind)) {
+        replay_read_next_clock(kind);
     }
+    ret = replay_state.cached_clock[kind];
 
-    error_report("REPLAY INTERNAL ERROR %d", __LINE__);
-    exit(1);
+    return ret;
 }



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 13/14] replay: rename step-related variables and functions
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (11 preceding siblings ...)
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 12/14] replay: refine replay-time module Pavel Dovgalyuk
@ 2019-07-24  8:44 ` Pavel Dovgalyuk
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block Pavel Dovgalyuk
  2019-07-24 14:35 ` [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Paolo Bonzini
  14 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

This patch renames replay_get_current_step() and related variables
to make these names consistent with existing 'icount' command line
option and future record/replay hmp/qmp commands.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 include/sysemu/replay.h  |    2 +-
 replay/replay-events.c   |    4 ++--
 replay/replay-internal.c |   10 +++++-----
 replay/replay-internal.h |   10 +++++-----
 replay/replay-snapshot.c |    6 +++---
 replay/replay-time.c     |    2 +-
 replay/replay.c          |   22 +++++++++++-----------
 7 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index 503bb6258d..6ed4322447 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -77,7 +77,7 @@ const char *replay_get_filename(void);
 /* Processing the instructions */
 
 /*! Returns number of executed instructions. */
-uint64_t replay_get_current_step(void);
+uint64_t replay_get_current_icount(void);
 /*! Returns number of instructions to execute in replay mode. */
 int replay_get_instructions(void);
 /*! Updates instructions counter in replay mode. */
diff --git a/replay/replay-events.c b/replay/replay-events.c
index e5bf1bc2e6..302b84043a 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -127,7 +127,7 @@ void replay_add_event(ReplayAsyncEventKind event_kind,
 void replay_bh_schedule_event(QEMUBH *bh)
 {
     if (events_enabled) {
-        uint64_t id = replay_get_current_step();
+        uint64_t id = replay_get_current_icount();
         replay_add_event(REPLAY_ASYNC_EVENT_BH, bh, NULL, id);
     } else {
         qemu_bh_schedule(bh);
@@ -138,7 +138,7 @@ void replay_bh_schedule_oneshot_event(AioContext *ctx,
     QEMUBHFunc *cb, void *opaque)
 {
     if (events_enabled) {
-        uint64_t id = replay_get_current_step();
+        uint64_t id = replay_get_current_icount();
         replay_add_event(REPLAY_ASYNC_EVENT_BH_ONESHOT, cb, opaque, id);
     } else {
         aio_bh_schedule_oneshot(ctx, cb, opaque);
diff --git a/replay/replay-internal.c b/replay/replay-internal.c
index 979f3a0b39..ac6c9017fc 100644
--- a/replay/replay-internal.c
+++ b/replay/replay-internal.c
@@ -172,7 +172,7 @@ void replay_fetch_data_kind(void)
         if (!replay_state.has_unread_data) {
             replay_state.data_kind = replay_get_byte();
             if (replay_state.data_kind == EVENT_INSTRUCTION) {
-                replay_state.instructions_count = replay_get_dword();
+                replay_state.instruction_count = replay_get_dword();
             }
             replay_check_error();
             replay_state.has_unread_data = 1;
@@ -226,9 +226,9 @@ void replay_mutex_unlock(void)
     }
 }
 
-void replay_advance_current_step(uint64_t current_step)
+void replay_advance_current_icount(uint64_t current_icount)
 {
-    int diff = (int)(current_step - replay_state.current_step);
+    int diff = (int)(current_icount - replay_state.current_icount);
 
     /* Time can only go forward */
     assert(diff >= 0);
@@ -236,7 +236,7 @@ void replay_advance_current_step(uint64_t current_step)
     if (diff > 0) {
         replay_put_event(EVENT_INSTRUCTION);
         replay_put_dword(diff);
-        replay_state.current_step += diff;
+        replay_state.current_icount += diff;
     }
 }
 
@@ -245,6 +245,6 @@ void replay_save_instructions(void)
 {
     if (replay_file && replay_mode == REPLAY_MODE_RECORD) {
         g_assert(replay_mutex_locked());
-        replay_advance_current_step(replay_get_current_step());
+        replay_advance_current_icount(replay_get_current_icount());
     }
 }
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index f3cdcfd93e..55fca1ac6b 100644
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -65,10 +65,10 @@ typedef enum ReplayAsyncEventKind ReplayAsyncEventKind;
 typedef struct ReplayState {
     /*! Cached clock values. */
     int64_t cached_clock[REPLAY_CLOCK_COUNT];
-    /*! Current step - number of processed instructions and timer events. */
-    uint64_t current_step;
+    /*! Current icount - number of processed instructions. */
+    uint64_t current_icount;
     /*! Number of instructions to be executed before other events happen. */
-    int instructions_count;
+    int instruction_count;
     /*! Type of the currently executed event. */
     unsigned int data_kind;
     /*! Flag which indicates that event is not processed yet. */
@@ -123,8 +123,8 @@ void replay_finish_event(void);
     data_kind variable. */
 void replay_fetch_data_kind(void);
 
-/*! Advance replay_state.current_step to the specified value. */
-void replay_advance_current_step(uint64_t current_step);
+/*! Advance replay_state.current_icount to the specified value. */
+void replay_advance_current_icount(uint64_t current_icount);
 /*! Saves queued events (like instructions and sound). */
 void replay_save_instructions(void);
 
diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c
index 756f48bc02..97d026af30 100644
--- a/replay/replay-snapshot.c
+++ b/replay/replay-snapshot.c
@@ -41,7 +41,7 @@ static int replay_post_load(void *opaque, int version_id)
     } else if (replay_mode == REPLAY_MODE_RECORD) {
         /* This is only useful for loading the initial state.
            Therefore reset all the counters. */
-        state->instructions_count = 0;
+        state->instruction_count = 0;
         state->block_request_id = 0;
     }
 
@@ -56,8 +56,8 @@ static const VMStateDescription vmstate_replay = {
     .post_load = replay_post_load,
     .fields = (VMStateField[]) {
         VMSTATE_INT64_ARRAY(cached_clock, ReplayState, REPLAY_CLOCK_COUNT),
-        VMSTATE_UINT64(current_step, ReplayState),
-        VMSTATE_INT32(instructions_count, ReplayState),
+        VMSTATE_UINT64(current_icount, ReplayState),
+        VMSTATE_INT32(instruction_count, ReplayState),
         VMSTATE_UINT32(data_kind, ReplayState),
         VMSTATE_UINT32(has_unread_data, ReplayState),
         VMSTATE_UINT64(file_offset, ReplayState),
diff --git a/replay/replay-time.c b/replay/replay-time.c
index 49c9e5d8b2..43357c9f24 100644
--- a/replay/replay-time.c
+++ b/replay/replay-time.c
@@ -24,7 +24,7 @@ int64_t replay_save_clock(ReplayClockKind kind, int64_t clock,
      * Due to the caller's locking requirements we get the icount from it
      * instead of using replay_save_instructions().
      */
-    replay_advance_current_step(raw_icount);
+    replay_advance_current_icount(raw_icount);
     replay_put_event(EVENT_CLOCK + kind);
     replay_put_qword(clock);
 
diff --git a/replay/replay.c b/replay/replay.c
index 73c5d4e207..14ee2c4144 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -39,7 +39,7 @@ bool replay_next_event_is(int event)
     bool res = false;
 
     /* nothing to skip - not all instructions used */
-    if (replay_state.instructions_count != 0) {
+    if (replay_state.instruction_count != 0) {
         assert(replay_state.data_kind == EVENT_INSTRUCTION);
         return event == EVENT_INSTRUCTION;
     }
@@ -62,7 +62,7 @@ bool replay_next_event_is(int event)
     return res;
 }
 
-uint64_t replay_get_current_step(void)
+uint64_t replay_get_current_icount(void)
 {
     return cpu_get_icount_raw();
 }
@@ -72,7 +72,7 @@ int replay_get_instructions(void)
     int res = 0;
     replay_mutex_lock();
     if (replay_next_event_is(EVENT_INSTRUCTION)) {
-        res = replay_state.instructions_count;
+        res = replay_state.instruction_count;
     }
     replay_mutex_unlock();
     return res;
@@ -82,16 +82,16 @@ void replay_account_executed_instructions(void)
 {
     if (replay_mode == REPLAY_MODE_PLAY) {
         g_assert(replay_mutex_locked());
-        if (replay_state.instructions_count > 0) {
-            int count = (int)(replay_get_current_step()
-                              - replay_state.current_step);
+        if (replay_state.instruction_count > 0) {
+            int count = (int)(replay_get_current_icount()
+                              - replay_state.current_icount);
 
             /* Time can only go forward */
             assert(count >= 0);
 
-            replay_state.instructions_count -= count;
-            replay_state.current_step += count;
-            if (replay_state.instructions_count == 0) {
+            replay_state.instruction_count -= count;
+            replay_state.current_icount += count;
+            if (replay_state.instruction_count == 0) {
                 assert(replay_state.data_kind == EVENT_INSTRUCTION);
                 replay_finish_event();
                 /* Wake up iothread. This is required because
@@ -273,8 +273,8 @@ static void replay_enable(const char *fname, int mode)
     replay_mutex_init();
 
     replay_state.data_kind = -1;
-    replay_state.instructions_count = 0;
-    replay_state.current_step = 0;
+    replay_state.instruction_count = 0;
+    replay_state.current_icount = 0;
     replay_state.has_unread_data = 0;
 
     /* skip file header for RECORD and check it for PLAY */



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (12 preceding siblings ...)
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 13/14] replay: rename step-related variables and functions Pavel Dovgalyuk
@ 2019-07-24  8:44 ` Pavel Dovgalyuk
  2019-07-24 14:35   ` Paolo Bonzini
  2019-07-24 14:35 ` [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Paolo Bonzini
  14 siblings, 1 reply; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-24  8:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, pbonzini, quintela,
	ciro.santilli, jasowang, crosthwaite.peter, armbru, mreitz,
	alex.bennee, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, artem.k.pisarenko, dgilbert, rth

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

Most of IO instructions can be executed only at the end of the block in
icount mode. Therefore translator can set cpu_can_io flag when translating
the last instruction.
But when the blocks are chained, then this flag is not reset and may
remain set at the beginning of the next block.
This patch resets the flag before "chaining" the translation blocks.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
 accel/tcg/tcg-runtime.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c
index 8a1e408e31..fe6b83d0fc 100644
--- a/accel/tcg/tcg-runtime.c
+++ b/accel/tcg/tcg-runtime.c
@@ -151,6 +151,8 @@ void *HELPER(lookup_tb_ptr)(CPUArchState *env)
     target_ulong cs_base, pc;
     uint32_t flags;
 
+    /* We are going to jump to the next block. can_do_io should be reset */
+    cpu->can_do_io = !use_icount;
     tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, curr_cflags());
     if (tb == NULL) {
         return tcg_ctx->code_gen_epilogue;



^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers Pavel Dovgalyuk
@ 2019-07-24 14:28   ` Paolo Bonzini
  2019-07-25  6:00     ` Pavel Dovgalyuk
  0 siblings, 1 reply; 24+ messages in thread
From: Paolo Bonzini @ 2019-07-24 14:28 UTC (permalink / raw)
  To: Pavel Dovgalyuk, qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, quintela, ciro.santilli,
	jasowang, crosthwaite.peter, armbru, mreitz, alex.bennee,
	maria.klimushenkova, mst, kraxel, boost.lists, thomas.dullien,
	dovgaluk, artem.k.pisarenko, dgilbert, rth

On 24/07/19 10:44, Pavel Dovgalyuk wrote:
> -int64_t qemu_clock_deadline_ns_all(QEMUClockType type)
> +int64_t virtual_clock_deadline_ns(void)
>  {
>      int64_t deadline = -1;
> +    int64_t delta;
> +    int64_t expire_time;
> +    QEMUTimer *ts;
>      QEMUTimerList *timer_list;
> -    QEMUClock *clock = qemu_clock_ptr(type);
> +    QEMUClock *clock = qemu_clock_ptr(QEMU_CLOCK_VIRTUAL);
> +
> +    if (!clock->enabled) {
> +        return -1;
> +    }
> +
>      QLIST_FOREACH(timer_list, &clock->timerlists, list) {
> -        deadline = qemu_soonest_timeout(deadline,
> -                                        timerlist_deadline_ns(timer_list));
> +        qemu_mutex_lock(&timer_list->active_timers_lock);
> +        ts = timer_list->active_timers;
> +        /* Skip all external timers */
> +        while (ts && (ts->attributes & QEMU_TIMER_ATTR_EXTERNAL)) {
> +            ts = ts->next;
> +        }
> +        if (!ts) {
> +            qemu_mutex_unlock(&timer_list->active_timers_lock);
> +            continue;
> +        }
> +        expire_time = ts->expire_time;
> +        qemu_mutex_unlock(&timer_list->active_timers_lock);
> +
> +        delta = expire_time - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
> +        if (delta <= 0) {
> +            delta = 0;
> +        }
> +        deadline = qemu_soonest_timeout(deadline, delta);
>      }
>      return deadline;
>  }
> 

Why would this change be exclusive to QEMU_CLOCK_VIRTUAL?  I don't think
it's useful to remove the argument.  Otherwise, the patch makes sense.

Paolo


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block Pavel Dovgalyuk
@ 2019-07-24 14:35   ` Paolo Bonzini
  2019-07-25  5:55     ` Pavel Dovgalyuk
  0 siblings, 1 reply; 24+ messages in thread
From: Paolo Bonzini @ 2019-07-24 14:35 UTC (permalink / raw)
  To: Pavel Dovgalyuk, qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, quintela, ciro.santilli,
	jasowang, crosthwaite.peter, armbru, mreitz, alex.bennee,
	maria.klimushenkova, mst, kraxel, boost.lists, thomas.dullien,
	dovgaluk, artem.k.pisarenko, dgilbert, rth

On 24/07/19 10:44, Pavel Dovgalyuk wrote:
> From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> 
> Most of IO instructions can be executed only at the end of the block in
> icount mode. Therefore translator can set cpu_can_io flag when translating
> the last instruction.
> But when the blocks are chained, then this flag is not reset and may
> remain set at the beginning of the next block.
> This patch resets the flag before "chaining" the translation blocks.
> 
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> ---
>  accel/tcg/tcg-runtime.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c
> index 8a1e408e31..fe6b83d0fc 100644
> --- a/accel/tcg/tcg-runtime.c
> +++ b/accel/tcg/tcg-runtime.c
> @@ -151,6 +151,8 @@ void *HELPER(lookup_tb_ptr)(CPUArchState *env)
>      target_ulong cs_base, pc;
>      uint32_t flags;
>  
> +    /* We are going to jump to the next block. can_do_io should be reset */
> +    cpu->can_do_io = !use_icount;
>      tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, curr_cflags());
>      if (tb == NULL) {
>          return tcg_ctx->code_gen_epilogue;
> 

This only fixes indirect jumps though.

I think you do not need this patch if you remove the assignment in
cpu_tb_exec, and compile a "move 0 to cpu->can_do_io" in gen_tb_start
instead.

Paolo


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes
  2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
                   ` (13 preceding siblings ...)
  2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block Pavel Dovgalyuk
@ 2019-07-24 14:35 ` Paolo Bonzini
  2019-07-25  8:44   ` Kevin Wolf
  14 siblings, 1 reply; 24+ messages in thread
From: Paolo Bonzini @ 2019-07-24 14:35 UTC (permalink / raw)
  To: Pavel Dovgalyuk, qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, quintela, ciro.santilli,
	jasowang, crosthwaite.peter, armbru, mreitz, alex.bennee,
	maria.klimushenkova, mst, kraxel, boost.lists, thomas.dullien,
	dovgaluk, artem.k.pisarenko, dgilbert, rth

On 24/07/19 10:43, Pavel Dovgalyuk wrote:
> The set of patches include the latest fixes for record/replay icount function:
>  - fix for icount for the case when translation blocks are chained
>  - block operation fixes for rr mode
>  - development documentation update
>  - some refactoring
> 
> These patches make record/replay functional on the latest 4.2 QEMU core.
> 
> ---
> 
> Pavel Dovgalyuk (13):
>       block: implement bdrv_snapshot_goto for blkreplay
>       replay: disable default snapshot for record/replay
>       replay: update docs for record/replay with block devices
>       replay: don't drain/flush bdrv queue while RR is working
>       replay: finish record/replay before closing the disks
>       replay: provide an accessor for rr filename
>       replay: add BH oneshot event for block layer
>       replay: document development rules
>       util/qemu-timer: refactor deadline calculation for external timers
>       replay: fix replay shutdown
>       replay: refine replay-time module
>       replay: rename step-related variables and functions
>       icount: clean up cpu_can_io before jumping to the next block
> 
> pbonzini@redhat.com (1):
>       replay: add missing fix for internal function
> 
> 
>  accel/tcg/tcg-runtime.c   |    2 ++
>  block/blkreplay.c         |    8 ++++++++
>  block/block-backend.c     |    8 +++++---
>  block/io.c                |   32 +++++++++++++++++++++++++++++--
>  block/iscsi.c             |    5 +++--
>  block/nfs.c               |    5 +++--
>  block/null.c              |    4 +++-
>  block/nvme.c              |    6 ++++--
>  block/rbd.c               |    5 +++--
>  block/vxhs.c              |    5 +++--
>  cpus.c                    |   11 ++++-------
>  docs/devel/replay.txt     |   46 +++++++++++++++++++++++++++++++++++++++++++++
>  docs/replay.txt           |   12 +++++++++---
>  include/qemu/timer.h      |    7 +++----
>  include/sysemu/replay.h   |    7 ++++++-
>  qtest.c                   |    2 +-
>  replay/replay-events.c    |   18 +++++++++++++++++-
>  replay/replay-internal.c  |   10 +++++-----
>  replay/replay-internal.h  |   11 ++++++-----
>  replay/replay-snapshot.c  |    6 +++---
>  replay/replay-time.c      |   36 ++++++++++++++++-------------------
>  replay/replay.c           |   39 +++++++++++++++++++++++---------------
>  stubs/Makefile.objs       |    1 +
>  stubs/replay-user.c       |    9 +++++++++
>  tests/ptimer-test-stubs.c |    4 ++--
>  tests/ptimer-test.c       |    4 ++--
>  util/qemu-timer.c         |   41 ++++++++++++++++++++++++++++++++--------
>  vl.c                      |   11 +++++++++--
>  28 files changed, 259 insertions(+), 96 deletions(-)
>  create mode 100644 docs/devel/replay.txt
>  create mode 100644 stubs/replay-user.c
> 

Please separate patches 1 and 9-14, I can merge those.

Paolo


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block
  2019-07-24 14:35   ` Paolo Bonzini
@ 2019-07-25  5:55     ` Pavel Dovgalyuk
  2019-07-25  6:27       ` Paolo Bonzini
  0 siblings, 1 reply; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-25  5:55 UTC (permalink / raw)
  To: 'Paolo Bonzini', 'Pavel Dovgalyuk', qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, quintela, ciro.santilli,
	jasowang, crosthwaite.peter, armbru, mreitz, alex.bennee,
	maria.klimushenkova, mst, kraxel, boost.lists, thomas.dullien,
	artem.k.pisarenko, dgilbert, rth

> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> On 24/07/19 10:44, Pavel Dovgalyuk wrote:
> > From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> >
> > Most of IO instructions can be executed only at the end of the block in
> > icount mode. Therefore translator can set cpu_can_io flag when translating
> > the last instruction.
> > But when the blocks are chained, then this flag is not reset and may
> > remain set at the beginning of the next block.
> > This patch resets the flag before "chaining" the translation blocks.
> >
> > Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> > ---
> >  accel/tcg/tcg-runtime.c |    2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c
> > index 8a1e408e31..fe6b83d0fc 100644
> > --- a/accel/tcg/tcg-runtime.c
> > +++ b/accel/tcg/tcg-runtime.c
> > @@ -151,6 +151,8 @@ void *HELPER(lookup_tb_ptr)(CPUArchState *env)
> >      target_ulong cs_base, pc;
> >      uint32_t flags;
> >
> > +    /* We are going to jump to the next block. can_do_io should be reset */
> > +    cpu->can_do_io = !use_icount;
> >      tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, curr_cflags());
> >      if (tb == NULL) {
> >          return tcg_ctx->code_gen_epilogue;
> >
> 
> This only fixes indirect jumps though.
> 
> I think you do not need this patch if you remove the assignment in
> cpu_tb_exec, and compile a "move 0 to cpu->can_do_io" in gen_tb_start
> instead.

"move 0 to cpu->can_do_io" only for icount mode?
And we'll also need to set can_do_io to 1 somewhere, because it
is checked in non-icount mode too.

Pavel Dovgalyuk



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers
  2019-07-24 14:28   ` Paolo Bonzini
@ 2019-07-25  6:00     ` Pavel Dovgalyuk
  0 siblings, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-25  6:00 UTC (permalink / raw)
  To: 'Paolo Bonzini', 'Pavel Dovgalyuk', qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, quintela, ciro.santilli,
	jasowang, crosthwaite.peter, armbru, mreitz, alex.bennee,
	maria.klimushenkova, mst, kraxel, boost.lists, thomas.dullien,
	artem.k.pisarenko, dgilbert, rth

> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> On 24/07/19 10:44, Pavel Dovgalyuk wrote:
> > -int64_t qemu_clock_deadline_ns_all(QEMUClockType type)
> > +int64_t virtual_clock_deadline_ns(void)
> >  {
> >      int64_t deadline = -1;
> > +    int64_t delta;
> > +    int64_t expire_time;
> > +    QEMUTimer *ts;
> >      QEMUTimerList *timer_list;
> > -    QEMUClock *clock = qemu_clock_ptr(type);
> > +    QEMUClock *clock = qemu_clock_ptr(QEMU_CLOCK_VIRTUAL);
> > +
> > +    if (!clock->enabled) {
> > +        return -1;
> > +    }
> > +
> >      QLIST_FOREACH(timer_list, &clock->timerlists, list) {
> > -        deadline = qemu_soonest_timeout(deadline,
> > -                                        timerlist_deadline_ns(timer_list));
> > +        qemu_mutex_lock(&timer_list->active_timers_lock);
> > +        ts = timer_list->active_timers;
> > +        /* Skip all external timers */
> > +        while (ts && (ts->attributes & QEMU_TIMER_ATTR_EXTERNAL)) {
> > +            ts = ts->next;
> > +        }
> > +        if (!ts) {
> > +            qemu_mutex_unlock(&timer_list->active_timers_lock);
> > +            continue;
> > +        }
> > +        expire_time = ts->expire_time;
> > +        qemu_mutex_unlock(&timer_list->active_timers_lock);
> > +
> > +        delta = expire_time - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
> > +        if (delta <= 0) {
> > +            delta = 0;
> > +        }
> > +        deadline = qemu_soonest_timeout(deadline, delta);
> >      }
> >      return deadline;
> >  }
> >
> 
> Why would this change be exclusive to QEMU_CLOCK_VIRTUAL?  I don't think
> it's useful to remove the argument.  Otherwise, the patch makes sense.

Ok, I'll rewrite this one and keep the argument.

Pavel Dovgalyuk



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block
  2019-07-25  5:55     ` Pavel Dovgalyuk
@ 2019-07-25  6:27       ` Paolo Bonzini
  0 siblings, 0 replies; 24+ messages in thread
From: Paolo Bonzini @ 2019-07-25  6:27 UTC (permalink / raw)
  To: Pavel Dovgalyuk, 'Pavel Dovgalyuk', qemu-devel
  Cc: kwolf, peter.maydell, pavel.dovgaluk, quintela, ciro.santilli,
	jasowang, crosthwaite.peter, armbru, mreitz, alex.bennee,
	maria.klimushenkova, mst, kraxel, boost.lists, thomas.dullien,
	artem.k.pisarenko, dgilbert, rth

On 25/07/19 07:55, Pavel Dovgalyuk wrote:
>>
>> I think you do not need this patch if you remove the assignment in
>> cpu_tb_exec, and compile a "move 0 to cpu->can_do_io" in gen_tb_start
>> instead.
> "move 0 to cpu->can_do_io" only for icount mode?

Yes, using CF_ICOUNT.

> And we'll also need to set can_do_io to 1 somewhere, because it
> is checked in non-icount mode too.

It is already set in qemu_tcg_cpu_thread_fn.

Paolo


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes
  2019-07-24 14:35 ` [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Paolo Bonzini
@ 2019-07-25  8:44   ` Kevin Wolf
  2019-07-25  8:46     ` Pavel Dovgalyuk
  2019-07-31  5:41     ` Pavel Dovgalyuk
  0 siblings, 2 replies; 24+ messages in thread
From: Kevin Wolf @ 2019-07-25  8:44 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: peter.maydell, pavel.dovgaluk, crosthwaite.peter, ciro.santilli,
	jasowang, quintela, qemu-devel, armbru, alex.bennee,
	Pavel Dovgalyuk, maria.klimushenkova, mst, kraxel, boost.lists,
	thomas.dullien, dovgaluk, mreitz, artem.k.pisarenko, dgilbert,
	rth

Am 24.07.2019 um 16:35 hat Paolo Bonzini geschrieben:
> On 24/07/19 10:43, Pavel Dovgalyuk wrote:
> > The set of patches include the latest fixes for record/replay icount function:
> >  - fix for icount for the case when translation blocks are chained
> >  - block operation fixes for rr mode
> >  - development documentation update
> >  - some refactoring
> > 
> > These patches make record/replay functional on the latest 4.2 QEMU core.
> 
> Please separate patches 1 and 9-14, I can merge those.

The block related parts have my Acked-by and the rest looks a bit like
no man's land, so I think you could just take the whole series.

Kevin


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes
  2019-07-25  8:44   ` Kevin Wolf
@ 2019-07-25  8:46     ` Pavel Dovgalyuk
  2019-07-31  5:41     ` Pavel Dovgalyuk
  1 sibling, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-25  8:46 UTC (permalink / raw)
  To: 'Kevin Wolf', 'Paolo Bonzini'
  Cc: peter.maydell, pavel.dovgaluk, crosthwaite.peter, ciro.santilli,
	jasowang, quintela, qemu-devel, armbru, alex.bennee,
	'Pavel Dovgalyuk',
	maria.klimushenkova, mst, kraxel, boost.lists, thomas.dullien,
	mreitz, artem.k.pisarenko, dgilbert, rth

> From: Kevin Wolf [mailto:kwolf@redhat.com]
> 
> Am 24.07.2019 um 16:35 hat Paolo Bonzini geschrieben:
> > On 24/07/19 10:43, Pavel Dovgalyuk wrote:
> > > The set of patches include the latest fixes for record/replay icount function:
> > >  - fix for icount for the case when translation blocks are chained
> > >  - block operation fixes for rr mode
> > >  - development documentation update
> > >  - some refactoring
> > >
> > > These patches make record/replay functional on the latest 4.2 QEMU core.
> >
> > Please separate patches 1 and 9-14, I can merge those.
> 
> The block related parts have my Acked-by and the rest looks a bit like
> no man's land, so I think you could just take the whole series.

I split the series and already sent the modified "no-block" part.
Therefore I'll send the rebased block related patches soon.

Pavel Dovgalyuk



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes
  2019-07-25  8:44   ` Kevin Wolf
  2019-07-25  8:46     ` Pavel Dovgalyuk
@ 2019-07-31  5:41     ` Pavel Dovgalyuk
  1 sibling, 0 replies; 24+ messages in thread
From: Pavel Dovgalyuk @ 2019-07-31  5:41 UTC (permalink / raw)
  To: 'Kevin Wolf', 'Paolo Bonzini'
  Cc: peter.maydell, pavel.dovgaluk, crosthwaite.peter, ciro.santilli,
	jasowang, quintela, qemu-devel, armbru, alex.bennee,
	'Pavel Dovgalyuk',
	maria.klimushenkova, mst, kraxel, boost.lists, thomas.dullien,
	mreitz, artem.k.pisarenko, dgilbert, rth

> From: Kevin Wolf [mailto:kwolf@redhat.com]
> Am 24.07.2019 um 16:35 hat Paolo Bonzini geschrieben:
> > On 24/07/19 10:43, Pavel Dovgalyuk wrote:
> > > The set of patches include the latest fixes for record/replay icount function:
> > >  - fix for icount for the case when translation blocks are chained
> > >  - block operation fixes for rr mode
> > >  - development documentation update
> > >  - some refactoring
> > >
> > > These patches make record/replay functional on the latest 4.2 QEMU core.
> >
> > Please separate patches 1 and 9-14, I can merge those.
> 
> The block related parts have my Acked-by and the rest looks a bit like
> no man's land, so I think you could just take the whole series.

Paolo, I've sent the rest of the patches as a separate series.
But they are rebased upon the first series.
Since Kevin agreed to merge them, can you put them in your queue?

Pavel Dovgalyuk



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-07-31  5:42 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24  8:43 [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 01/14] replay: add missing fix for internal function Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 02/14] block: implement bdrv_snapshot_goto for blkreplay Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 03/14] replay: disable default snapshot for record/replay Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 04/14] replay: update docs for record/replay with block devices Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 05/14] replay: don't drain/flush bdrv queue while RR is working Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 06/14] replay: finish record/replay before closing the disks Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 07/14] replay: provide an accessor for rr filename Pavel Dovgalyuk
2019-07-24  8:43 ` [Qemu-devel] [PATCH for-4.2 08/14] replay: add BH oneshot event for block layer Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 09/14] replay: document development rules Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 10/14] util/qemu-timer: refactor deadline calculation for external timers Pavel Dovgalyuk
2019-07-24 14:28   ` Paolo Bonzini
2019-07-25  6:00     ` Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 11/14] replay: fix replay shutdown Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 12/14] replay: refine replay-time module Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 13/14] replay: rename step-related variables and functions Pavel Dovgalyuk
2019-07-24  8:44 ` [Qemu-devel] [PATCH for-4.2 14/14] icount: clean up cpu_can_io before jumping to the next block Pavel Dovgalyuk
2019-07-24 14:35   ` Paolo Bonzini
2019-07-25  5:55     ` Pavel Dovgalyuk
2019-07-25  6:27       ` Paolo Bonzini
2019-07-24 14:35 ` [Qemu-devel] [PATCH for-4.2 00/14] Some record/replay fixes Paolo Bonzini
2019-07-25  8:44   ` Kevin Wolf
2019-07-25  8:46     ` Pavel Dovgalyuk
2019-07-31  5:41     ` Pavel Dovgalyuk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.