[Qemu-devel] [RFC PATCH v6 08/32] icount: implement icount requesting

2014-12-07 Thread Pavel Dovgalyuk
Replay uses number of executed instructions to determine corrent events injection moments. This patch introduces new function for querying the instructions counter. Signed-off-by: Pavel Dovgalyuk --- cpus.c | 13 ++--- include/qemu/timer.h |1 + 2 files changed, 11

[Qemu-devel] [RFC PATCH v6 09/32] replay: introduce icount event

2014-12-07 Thread Pavel Dovgalyuk
This patch adds icount event to the replay subsystem. This event corresponds to execution of several instructions and used to synchronize input events in the replay phase. Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c | 14 ++ replay/replay-internal.h | 18

[Qemu-devel] [RFC PATCH v6 04/32] replay: global variables and function stubs

2014-12-07 Thread Pavel Dovgalyuk
This patch adds global variables, defines, functions declarations, and function stubs for deterministic VM replay used by external modules. Signed-off-by: Pavel Dovgalyuk --- Makefile.target |1 + qapi-schema.json | 32 replay/Makefile.objs |1

[Qemu-devel] [RFC PATCH v6 15/32] cpu-exec: allow temporary disabling icount

2014-12-08 Thread Pavel Dovgalyuk
This patch is required for deterministic replay to generate an exception by trying executing an instruction without changing icount. It adds new flag to TB for disabling icount while translating it. Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c |6

[Qemu-devel] [RFC PATCH v6 12/32] From 185a3a47d08857a66332ae862b372a153ce92bb9 Mon Sep 17 00:00:00 2001

2014-12-08 Thread Pavel Dovgalyuk
From: Paolo Bonzini Subject: [PATCH] cpu-exec: add a new CF_USE_ICOUNT cflag Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- include/exec/exec-all.h |5 +++-- translate-all.c |3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec

[Qemu-devel] [RFC PATCH v6 07/32] cpu-exec: reset exception_index correctly

2014-12-08 Thread Pavel Dovgalyuk
Exception index is reset at every entry at every entry into cpu_exec() function. This may cause missing the exceptions while replaying them. This patch moves exception_index reset to the locations where they are processed. Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c |3 ++- cpus.c

[Qemu-devel] [RFC PATCH v6 10/32] i386: do not cross the pages boundaries in replay mode

2014-12-08 Thread Pavel Dovgalyuk
e. Signed-off-by: Pavel Dovgalyuk --- target-i386/cpu.h |3 +++ target-i386/translate.c | 14 ++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 015f5b5..ca94f8f 100644 --- a/target-i386/cpu.h +++ b/target-

[Qemu-devel] [RFC PATCH v6 16/32] cpu-exec: invalidate nocache translation if they are interrupted

2014-12-08 Thread Pavel Dovgalyuk
In this case, QEMU might longjmp out of cpu-exec.c and miss the final cleanup in cpu_exec_nocache. Do this manually through a new compile flag. This is important once we add no-icount translations. Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c

[Qemu-devel] [RFC PATCH v6 17/32] cpu: replay instructions sequence

2014-12-08 Thread Pavel Dovgalyuk
This patch adds calls to replay functions into the icount setup block. In record mode number of executed instructions is written to the log. In replay mode number of istructions to execute is taken from the replay log. Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c |1 + cpus.c

[Qemu-devel] [RFC PATCH v6 13/32] From a0cb9e80ba0de409b5ad556109a1c71ce4d8ce19 Mon Sep 17 00:00:00 2001

2014-12-08 Thread Pavel Dovgalyuk
From: Paolo Bonzini Subject: [PATCH] translate: check cflags instead of use_icount global Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- target-alpha/translate.c|8 --- target-arm/translate-a64.c |4 ++-- target-arm/translate.c |4 ++-- target-i386

[Qemu-devel] [RFC PATCH v6 19/32] replay: asynchronous events infrastructure

2014-12-08 Thread Pavel Dovgalyuk
, or checkpoint in the iothread. Signed-off-by: Pavel Dovgalyuk --- replay/Makefile.objs |1 replay/replay-events.c | 217 ++ replay/replay-internal.h | 27 ++ replay/replay.h |4 + 4 files changed, 249 insertions(+), 0

[Qemu-devel] [RFC PATCH v6 20/32] timer: introduce new QEMU_CLOCK_VIRTUAL_RT clock

2014-12-08 Thread Pavel Dovgalyuk
simulator-specific actions. That is why we added new clock which is recorded and replayed when needed. Signed-off-by: Pavel Dovgalyuk --- include/qemu/timer.h |7 +++ qemu-timer.c |2 ++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/include/qemu/timer.h b/include

[Qemu-devel] [RFC PATCH v6 18/32] replay: interrupts and exceptions

2014-12-08 Thread Pavel Dovgalyuk
This patch includes modifications of common cpu files. All interrupts and exceptions occured during recording are written into the replay log. These events allow correct replaying the execution by kicking cpu thread when one of these events is found in the log. Signed-off-by: Pavel Dovgalyuk

[Qemu-devel] [RFC PATCH v6 14/32] From 04bbd21134dd2c6b7309a7f5f2b780aae2757003 Mon Sep 17 00:00:00 2001

2014-12-08 Thread Pavel Dovgalyuk
From: Paolo Bonzini Subject: [PATCH] gen-icount: check cflags instead of use_icount global Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- include/exec/gen-icount.h |6 +++--- target-alpha/translate.c |2 +- target-arm/translate-a64.c|2 +- target

[Qemu-devel] [RFC PATCH v6 21/32] cpus: make icount warp deterministic in replay mode

2014-12-08 Thread Pavel Dovgalyuk
This patch adds saving and replaying warping parameters in record and replay modes. These parameters affect on virtual clock values and therefore should be deterministic. Signed-off-by: Pavel Dovgalyuk --- cpus.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff

[Qemu-devel] [RFC PATCH v6 22/32] timer: fix usage of clock functions

2014-12-08 Thread Pavel Dovgalyuk
This patch replaces calling of get_clock_realtime() everywhere except the timer module. All calls are replaced with host clock requests. Patch also replaces get_clock() calls with realtime clock requests. Usage of this interface simplifies implementation of record/replay. Signed-off-by: Pavel

[Qemu-devel] [RFC PATCH v6 23/32] replay: recording and replaying clock ticks

2014-12-08 Thread Pavel Dovgalyuk
the module, which wants to read the values. Such a design required the clock polling to be synchronized. Sometimes it is not true - e.g. when timeouts for timer lists are checked. In this case we use a cached value of the clock, passing it to the client code. Signed-off-by: Pavel Dovgalyuk

[Qemu-devel] [RFC PATCH v6 24/32] replay: recording and replaying different timers

2014-12-08 Thread Pavel Dovgalyuk
lead to non-determinism. Signed-off-by: Pavel Dovgalyuk --- hw/timer/mc146818rtc.c | 10 hw/timer/pl031.c | 10 include/qemu-common.h|1 replay/replay-internal.h |4 ++ replay/replay-time.c | 112 ++ replay

[Qemu-devel] [RFC PATCH v6 25/32] replay: shutdown event

2014-12-08 Thread Pavel Dovgalyuk
This patch records and replays simulator shutdown event. Signed-off-by: Pavel Dovgalyuk --- include/sysemu/sysemu.h |1 + replay/replay-internal.h |2 ++ replay/replay.c | 11 +++ replay/replay.h |5 + vl.c |8 +++- 5

[Qemu-devel] [RFC PATCH v6 26/32] replay: checkpoints

2014-12-08 Thread Pavel Dovgalyuk
This patch introduces checkpoints that synchronize cpu thread and iothread. When checkpoint is met in the code all asynchronous events from the queue are executed. Signed-off-by: Pavel Dovgalyuk --- block.c | 11 +++ cpus.c |7 ++- include

[Qemu-devel] [RFC PATCH v6 31/32] replay: command line options

2014-12-08 Thread Pavel Dovgalyuk
usly saved log. Signed-off-by: Pavel Dovgalyuk --- cpus.c |3 +- qemu-options.hx | 27 +++ vl.c| 79 ++- 3 files changed, 106 insertions(+), 3 deletions(-) diff --git a/cpus.c b/cpus.c index 2f038e

[Qemu-devel] [RFC PATCH v6 27/32] replay: bottom halves

2014-12-08 Thread Pavel Dovgalyuk
This patch introduces bottom half event for replay queue. It saves the events into the queue and process them at the checkpoints and instructions execution. Signed-off-by: Pavel Dovgalyuk --- async.c | 46 -- dma-helpers.c

[Qemu-devel] [RFC PATCH v6 28/32] replay: replay aio requests

2014-12-08 Thread Pavel Dovgalyuk
This patch adds identifier to aio requests. ID is used for creating bottom halves and identifying them while replaying. The patch also introduces several functions that make possible replaying of the aio requests. Signed-off-by: Pavel Dovgalyuk --- block.c| 81

[Qemu-devel] [RFC PATCH v6 29/32] replay: thread pool

2014-12-08 Thread Pavel Dovgalyuk
This patch modifies thread pool to allow replaying asynchronous thread tasks synchronously in replay mode. Signed-off-by: Pavel Dovgalyuk --- block/raw-posix.c |6 - block/raw-win32.c |4 +++- include/block/thread-pool.h |4 +++- replay/replay-events.c

[Qemu-devel] [RFC PATCH v6 30/32] replay: initialization and deinitialization

2014-12-08 Thread Pavel Dovgalyuk
This patch introduces the functions for enabling the record/replay and for freeing the resources when simulator closes. Signed-off-by: Pavel Dovgalyuk --- block.c |2 - exec.c |1 replay/replay-internal.h |2 + replay/replay.c | 134

[Qemu-devel] [RFC PATCH v6 32/32] replay: recording of the user input

2014-12-08 Thread Pavel Dovgalyuk
This records user input (keyboard and mouse events) in record mode and replays these input events in replay mode. Signed-off-by: Pavel Dovgalyuk --- include/ui/input.h |2 + replay/Makefile.objs |1 replay/replay-events.c | 48 replay/replay-input.c

Re: [Qemu-devel] [RFC PATCH v6 08/32] icount: implement icount requesting

2014-12-09 Thread Pavel Dovgalyuk
No, it worked well and I deleted _nocache version of that function. But I still need _raw one to get the instructions counter. Sent using CloudMagic On вт, Дек 09, 2014 at 8:39 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: On 08/12/2014 08:53, Pavel Dovgalyuk wrote: >   

[Qemu-devel] [RFC PATCH v11 01/23] i386: partial revert of interrupt poll fix

2015-04-27 Thread Pavel Dovgalyuk
Processing CPU_INTERRUPT_POLL requests in cpu_has_work functions break the determinism of cpu_exec. This patch is required to make interrupts processing deterministic. Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c|6 ++ target-i386/cpu.c | 10

[Qemu-devel] [RFC PATCH v11 00/23] Deterministic replay core

2015-04-27 Thread Pavel Dovgalyuk
ested by Kirill Batuzov) * Added QMP versions of replay commands (as suggested by Eric Blake) * Removed some optional features of replay to make patches cleaner * Minor changes and code cleanup were made --- Pavel Dovgalyuk (23): i386: partial revert of interrupt poll fix replay: global

[Qemu-devel] [RFC PATCH v11 04/23] replay: internal functions for replay log

2015-04-27 Thread Pavel Dovgalyuk
This patch adds functions to perform read and write operations with replay log. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/Makefile.objs |1 replay/replay-internal.c | 149 ++ replay/replay-internal.h | 46

[Qemu-devel] [RFC PATCH v11 06/23] replay: introduce icount event

2015-04-27 Thread Pavel Dovgalyuk
This patch adds icount event to the replay subsystem. This event corresponds to execution of several instructions and used to synchronize input events in the replay phase. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c | 24

[Qemu-devel] [RFC PATCH v11 02/23] replay: global variables and function stubs

2015-04-27 Thread Pavel Dovgalyuk
This patch adds global variables, defines, function declarations, and function stubs for deterministic VM replay used by external modules. Reviewed-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Pavel Dovgalyuk --- Makefile.target |1 docs/replay.txt | 167

[Qemu-devel] [RFC PATCH v11 05/23] replay: introduce mutex to protect the replay log

2015-04-27 Thread Pavel Dovgalyuk
This mutex will protect read/write operations for replay log. Using mutex is necessary because most of the events consist of several fields stored in the log. The mutex will help to avoid races. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c | 27

[Qemu-devel] [RFC PATCH v11 13/23] replay: shutdown event

2015-04-27 Thread Pavel Dovgalyuk
This patch records and replays simulator shutdown event. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.h |2 ++ replay/replay.c | 14 ++ replay/replay.h |5 + vl.c |1 + 4 files changed

[Qemu-devel] [RFC PATCH v11 07/23] cpu-exec: allow temporary disabling icount

2015-04-27 Thread Pavel Dovgalyuk
This patch is required for deterministic replay to generate an exception by trying executing an instruction without changing icount. It adds new flag to TB for disabling icount while translating it. Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c |7

[Qemu-devel] [RFC PATCH v11 09/23] i386: interrupt poll processing

2015-04-27 Thread Pavel Dovgalyuk
This patch updates x86_cpu_exec_interrupt function. It can process two interrupt request at a time (poll and another one). This makes its execution non-deterministic. Determinism is requred for recorded icount execution. Signed-off-by: Pavel Dovgalyuk --- target-i386/seg_helper.c |3 +++ 1

[Qemu-devel] [RFC PATCH v11 14/23] replay: checkpoints

2015-04-27 Thread Pavel Dovgalyuk
This patch introduces checkpoints that synchronize cpu thread and iothread. When checkpoint is met in the code all asynchronous events from the queue are executed. Signed-off-by: Pavel Dovgalyuk --- cpus.c |5 + main-loop.c |6 ++ qemu-timer.c

[Qemu-devel] [RFC PATCH v11 03/23] sysemu: system functions for replay

2015-04-27 Thread Pavel Dovgalyuk
This patch removes "static" specifier from several qemu function to make them visible to the replay module. It also invents several system functions that will be used by replay. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpus.c |2 +- include

[Qemu-devel] [RFC PATCH v11 10/23] replay: interrupts and exceptions

2015-04-27 Thread Pavel Dovgalyuk
This patch includes modifications of common cpu files. All interrupts and exceptions occured during recording are written into the replay log. These events allow correct replaying the execution by kicking cpu thread when one of these events is found in the log. Signed-off-by: Pavel Dovgalyuk

[Qemu-devel] [RFC PATCH v11 08/23] cpu: replay instructions sequence

2015-04-27 Thread Pavel Dovgalyuk
called to wake up the iothread. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpus.c | 38 +- replay/replay.c | 33 - replay/replay.h |4 3 files changed, 61 insertions(+), 14 deletions

[Qemu-devel] [RFC PATCH v11 11/23] replay: asynchronous events infrastructure

2015-04-27 Thread Pavel Dovgalyuk
, or checkpoint in the iothread. Signed-off-by: Pavel Dovgalyuk --- replay/Makefile.objs |1 replay/replay-events.c | 227 ++ replay/replay-internal.h | 31 ++ replay/replay.h |6 + 4 files changed, 265 insertions(+), 0

[Qemu-devel] [RFC PATCH v11 20/23] replay: initialization and deinitialization

2015-04-27 Thread Pavel Dovgalyuk
This patch introduces the functions for enabling the record/replay and for freeing the resources when simulator closes. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- exec.c |1 replay/replay-internal.h |2 + replay/replay.c | 134

[Qemu-devel] [RFC PATCH v11 12/23] replay: recording and replaying clock ticks

2015-04-27 Thread Pavel Dovgalyuk
the values. Such a design required the clock polling to be synchronized. Sometimes it is not true - e.g. when timeouts for timer lists are checked. In this case we use a cached value of the clock, passing it to the client code. Signed-off-by: Pavel Dovgalyuk --- cpus.c |3

[Qemu-devel] [RFC PATCH v11 15/23] aio: replace stack of bottom halves with queue

2015-04-27 Thread Pavel Dovgalyuk
Bottom halves in AIO context are stored and removes in LIFO order. It makes their execution non-deterministic. This patch replaces the stack with queue to preserve the order of bottom halves processing. Signed-off-by: Pavel Dovgalyuk --- async.c | 26

[Qemu-devel] [RFC PATCH v11 17/23] replay: replay aio requests

2015-04-27 Thread Pavel Dovgalyuk
This patch adds identifier to aio requests. ID is used for creating bottom halves and identifying them while replaying. The patch also introduces several functions that make possible replaying of the aio requests. Signed-off-by: Pavel Dovgalyuk --- block.c| 82

[Qemu-devel] [RFC PATCH v11 22/23] replay: command line options

2015-04-27 Thread Pavel Dovgalyuk
log. Signed-off-by: Pavel Dovgalyuk --- qemu-options.hx |8 ++-- replay/replay.c |4 vl.c| 15 +-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 319d971..a6f42c4 100644 --- a/qemu-options.hx +

[Qemu-devel] [RFC PATCH v11 18/23] replay: thread pool

2015-04-27 Thread Pavel Dovgalyuk
This patch modifies thread pool to allow replaying asynchronous thread tasks synchronously in replay mode. Signed-off-by: Pavel Dovgalyuk --- block/raw-posix.c |6 - block/raw-win32.c |4 +++- include/block/thread-pool.h |4 +++- replay/replay-events.c

[Qemu-devel] [RFC PATCH v11 16/23] replay: bottom halves

2015-04-27 Thread Pavel Dovgalyuk
This patch introduces bottom half event for replay queue. It saves the events into the queue and process them at the checkpoints and instructions execution. Signed-off-by: Pavel Dovgalyuk --- async.c | 24 +++- dma-helpers.c|4 +++- hw/ide

[Qemu-devel] [RFC PATCH v11 23/23] replay: recording of the user input

2015-04-27 Thread Pavel Dovgalyuk
This records user input (keyboard and mouse events) in record mode and replays these input events in replay mode. Signed-off-by: Pavel Dovgalyuk --- include/ui/input.h |2 + replay/Makefile.objs |1 replay/replay-events.c | 31 + replay/replay-input.c| 159

[Qemu-devel] [RFC PATCH v11 19/23] typedef: add typedef for QemuOpts

2015-04-27 Thread Pavel Dovgalyuk
This patch moves typedefs for QemuOpts and related types to qemu/typedefs.h file. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- include/qemu/option.h |5 + include/qemu/typedefs.h |3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu

[Qemu-devel] [RFC PATCH v11 21/23] replay: replay blockers for devices

2015-04-27 Thread Pavel Dovgalyuk
Some devices are not supported by record/replay subsystem. This patch introduces replay blocker which denies starting record/replay if such devices are included into the configuration. Signed-off-by: Pavel Dovgalyuk --- hw/bt/hci.c |7 +++ include/qapi/qmp/qerror.h |3

[Qemu-devel] [PATCH v14 01/21] i386: partial revert of interrupt poll fix

2015-05-25 Thread Pavel Dovgalyuk
Processing CPU_INTERRUPT_POLL requests in cpu_has_work functions break the determinism of cpu_exec. This patch is required to make interrupts processing deterministic. Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c|6 ++ target-i386/cpu.c | 10

[Qemu-devel] [PATCH v14 00/21] Deterministic replay core

2015-05-25 Thread Pavel Dovgalyuk
zini) v2 changes: * Patches are split to be reviewable and bisectable (as suggested by Kirill Batuzov) * Added QMP versions of replay commands (as suggested by Eric Blake) * Removed some optional features of replay to make patches cleaner * Minor changes and code cleanup were made --- Pavel

[Qemu-devel] [PATCH v14 06/21] replay: introduce icount event

2015-05-25 Thread Pavel Dovgalyuk
This patch adds icount event to the replay subsystem. This event corresponds to execution of several instructions and used to synchronize input events in the replay phase. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c | 24

[Qemu-devel] [PATCH v14 08/21] cpu: replay instructions sequence

2015-05-25 Thread Pavel Dovgalyuk
called to wake up the iothread. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpus.c | 38 +- replay/replay.c | 33 - replay/replay.h |4 3 files changed, 61 insertions(+), 14 deletions

[Qemu-devel] [PATCH v14 05/21] replay: introduce mutex to protect the replay log

2015-05-25 Thread Pavel Dovgalyuk
This mutex will protect read/write operations for replay log. Using mutex is necessary because most of the events consist of several fields stored in the log. The mutex will help to avoid races. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c | 27

[Qemu-devel] [PATCH v14 02/21] replay: global variables and function stubs

2015-05-25 Thread Pavel Dovgalyuk
This patch adds global variables, defines, function declarations, and function stubs for deterministic VM replay used by external modules. Reviewed-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Pavel Dovgalyuk --- Makefile.target |1 docs/replay.txt | 167

[Qemu-devel] [PATCH v14 10/21] replay: interrupts and exceptions

2015-05-25 Thread Pavel Dovgalyuk
This patch includes modifications of common cpu files. All interrupts and exceptions occured during recording are written into the replay log. These events allow correct replaying the execution by kicking cpu thread when one of these events is found in the log. Signed-off-by: Pavel Dovgalyuk

[Qemu-devel] [PATCH v14 12/21] replay: recording and replaying clock ticks

2015-05-25 Thread Pavel Dovgalyuk
the values. Such a design required the clock polling to be synchronized. Sometimes it is not true - e.g. when timeouts for timer lists are checked. In this case we use a cached value of the clock, passing it to the client code. Signed-off-by: Pavel Dovgalyuk --- cpus.c |3

[Qemu-devel] [PATCH v14 03/21] sysemu: system functions for replay

2015-05-25 Thread Pavel Dovgalyuk
This patch removes "static" specifier from several qemu function to make them visible to the replay module. It also invents several system functions that will be used by replay. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpus.c |2 +- include

[Qemu-devel] [PATCH v14 07/21] cpu-exec: allow temporary disabling icount

2015-05-25 Thread Pavel Dovgalyuk
This patch is required for deterministic replay to generate an exception by trying executing an instruction without changing icount. It adds new flag to TB for disabling icount while translating it. Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- cpu-exec.c |7

[Qemu-devel] [PATCH v14 14/21] replay: checkpoints

2015-05-25 Thread Pavel Dovgalyuk
This patch introduces checkpoints that synchronize cpu thread and iothread. When checkpoint is met in the code all asynchronous events from the queue are executed. Signed-off-by: Pavel Dovgalyuk --- cpus.c |5 + main-loop.c |6 ++ qemu-timer.c

[Qemu-devel] [PATCH v14 13/21] replay: shutdown event

2015-05-25 Thread Pavel Dovgalyuk
This patch records and replays simulator shutdown event. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.h |2 ++ replay/replay.c | 14 ++ replay/replay.h |5 + vl.c |1 + 4 files changed

[Qemu-devel] [PATCH v14 09/21] i386: interrupt poll processing

2015-05-25 Thread Pavel Dovgalyuk
This patch updates x86_cpu_exec_interrupt function. It can process two interrupt request at a time (poll and another one). This makes its execution non-deterministic. Determinism is requred for recorded icount execution. Signed-off-by: Pavel Dovgalyuk --- target-i386/seg_helper.c |3 +++ 1

[Qemu-devel] [PATCH v14 04/21] replay: internal functions for replay log

2015-05-25 Thread Pavel Dovgalyuk
This patch adds functions to perform read and write operations with replay log. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- replay/Makefile.objs |1 replay/replay-internal.c | 149 ++ replay/replay-internal.h | 46

[Qemu-devel] [PATCH v14 16/21] replay: ptimer

2015-05-25 Thread Pavel Dovgalyuk
This patch adds deterministic replay for hardware periodic countdown timers. Signed-off-by: Pavel Dovgalyuk --- hw/core/ptimer.c |7 ++- replay/replay-events.c | 17 + replay/replay-internal.h |1 + replay/replay.h |2 ++ 4 files changed, 26

[Qemu-devel] [PATCH v14 11/21] replay: asynchronous events infrastructure

2015-05-25 Thread Pavel Dovgalyuk
, or checkpoint in the iothread. Signed-off-by: Pavel Dovgalyuk --- replay/Makefile.objs |1 replay/replay-events.c | 227 ++ replay/replay-internal.h | 31 ++ replay/replay.h |6 + 4 files changed, 265 insertions(+), 0

[Qemu-devel] [PATCH v14 17/21] typedef: add typedef for QemuOpts

2015-05-25 Thread Pavel Dovgalyuk
This patch moves typedefs for QemuOpts and related types to qemu/typedefs.h file. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- include/qemu/option.h |5 + include/qemu/typedefs.h |3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu

[Qemu-devel] [PATCH v14 15/21] bottom halves: introduce bh call function

2015-05-25 Thread Pavel Dovgalyuk
This patch introduces aio_bh_call function. It is used to execute bottom halves as callbacks without adding them to the queue. Signed-off-by: Pavel Dovgalyuk --- async.c |7 ++- include/block/aio.h |5 + 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a

[Qemu-devel] [PATCH v14 19/21] replay: replay blockers for devices

2015-05-25 Thread Pavel Dovgalyuk
Some devices are not supported by record/replay subsystem. This patch introduces replay blocker which denies starting record/replay if such devices are included into the configuration. Signed-off-by: Pavel Dovgalyuk --- hw/bt/hci.c |7 +++ include/qapi/qmp/qerror.h |3

[Qemu-devel] [PATCH v14 21/21] replay: ptimer

2015-05-25 Thread Pavel Dovgalyuk
and callback is executed. Binding callback moment to one of the checkpoints makes it deterministic. Signed-off-by: Pavel Dovgalyuk --- include/ui/input.h |2 + replay/Makefile.objs |1 replay/replay-events.c | 31 + replay/replay-input.c| 159

[Qemu-devel] [PATCH v14 18/21] replay: initialization and deinitialization

2015-05-25 Thread Pavel Dovgalyuk
This patch introduces the functions for enabling the record/replay and for freeing the resources when simulator closes. Reviewed-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- exec.c |1 replay/replay-internal.h |2 + replay/replay.c | 134

[Qemu-devel] [PATCH v14 20/21] replay: command line options

2015-05-25 Thread Pavel Dovgalyuk
log. Signed-off-by: Pavel Dovgalyuk --- qemu-options.hx |8 ++-- replay/replay.c |4 vl.c| 15 +-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index ec356f6..fcb5ddc 100644 --- a/qemu-options.hx +

Re: [Qemu-devel] [PULL v3 00/18] Record/replay core for 2.5-rc1

2015-11-06 Thread Pavel Dovgalyuk
ther character devices nor network are supported > yet). > > Pavel, can you prepare a page on the wiki? Yes, how can I make it? Pavel Dovgalyuk

[Qemu-devel] [PATCH 0/3] Deterministic replay extensions

2016-02-08 Thread Pavel Dovgalyuk
and serial communication ports (e.g., telnet terminal). --- Pavel Dovgalyuk (3): replay: character devices replay: introduce new checkpoint for icount warp replay: introduce block devices record/replay block/block-backend.c | 71 +++--- cpus.c

[Qemu-devel] [PATCH 1/3] replay: character devices

2016-02-08 Thread Pavel Dovgalyuk
allow controlling the replaying through gdb. Signed-off-by: Pavel Dovgalyuk --- gdbstub.c|2 - include/sysemu/char.h| 26 include/sysemu/replay.h | 12 ++ qemu-char.c | 56 --- replay/Makefile.objs |1

[Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-08 Thread Pavel Dovgalyuk
voked record/replay checkpoints. Queue is flushed at checkpoints and information about processed requests is recorded to the log. In replay phase the queue is matched with events read from the log. Therefore block devices requests are processed deterministically. Signed-off-by: Pavel Dovgalyuk ---

[Qemu-devel] [PATCH 2/3] replay: introduce new checkpoint for icount warp

2016-02-08 Thread Pavel Dovgalyuk
) may be called from different thread. This patch introduces new checkpoint which distinguished warp checkpoint calls from different threads. Signed-off-by: Pavel Dovgalyuk --- cpus.c |9 + include/qemu/timer.h|3 ++- include/sysemu/replay.h |1 + main-loop.c

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-09 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 09.02.2016 um 06:55 hat Pavel Dovgalyuk geschrieben: > > This patch introduces a set of functions that implement recording > > and replaying of block devices' operations. These functions form a thin > > layer between

[Qemu-devel] [PATCH v2 0/4] Deterministic replay extensions

2016-02-10 Thread Pavel Dovgalyuk
for qemu internal operations (e.g., migration). v2 changes: - removed obsolete call of qemu_clock_warp - fixed record/replay of aio_cancel - simplified call sequence for blk_aio_ functions in non-replay mode (as suggested by Kevin Wolf) --- Pavel Dovgalyuk (4): replay: character devices

[Qemu-devel] [PATCH v2 2/4] icount: remove obsolete warp call

2016-02-10 Thread Pavel Dovgalyuk
qemu_clock_warp call in qemu_tcg_wait_io_event function is not needed anymore, because it is called in every iteration of main_loop_wait. Signed-off-by: Pavel Dovgalyuk --- cpus.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/cpus.c b/cpus.c index 898426c..01c9809

[Qemu-devel] [PATCH v2 1/4] replay: character devices

2016-02-10 Thread Pavel Dovgalyuk
allow controlling the replaying through gdb. Signed-off-by: Pavel Dovgalyuk --- gdbstub.c|2 - include/sysemu/char.h| 26 include/sysemu/replay.h | 12 ++ qemu-char.c | 56 --- replay/Makefile.objs |1

[Qemu-devel] [PATCH v2 3/4] replay: introduce new checkpoint for icount warp

2016-02-10 Thread Pavel Dovgalyuk
) may be called from different thread. This patch introduces new checkpoint which distinguished warp checkpoint calls from different threads. Signed-off-by: Pavel Dovgalyuk --- cpus.c |7 --- include/qemu/timer.h|3 ++- include/sysemu/replay.h |1 + main-loop.c

[Qemu-devel] [PATCH v2 4/4] replay: introduce block devices record/replay

2016-02-10 Thread Pavel Dovgalyuk
voked record/replay checkpoints. Queue is flushed at checkpoints and information about processed requests is recorded to the log. In replay phase the queue is matched with events read from the log. Therefore block devices requests are processed deterministically. Signed-off-by: Pavel Dovgalyuk ---

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-10 Thread Pavel Dovgalyuk
> -Original Message- > Am 09.02.2016 um 12:52 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > But even this doesn't feel completely right, because block drivers are > > > already layered and there is no ne

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-10 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 10.02.2016 um 13:05 hat Pavel Dovgalyuk geschrieben: > > > Am 09.02.2016 um 12:52 hat Pavel Dovgalyuk geschrieben: > > > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > > But even this doesn'

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-10 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 10.02.2016 um 13:51 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > Am 10.02.2016 um 13:05 hat Pavel Dovgalyuk geschrieben: > > > > > Am 09.02.2016 um 12:52 hat Pavel Do

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-10 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 10.02.2016 um 13:51 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > Am 10.02.2016 um 13:05 hat Pavel Dovgalyuk geschrieben: > > > > > Am 09.02.2016 um 12:52 hat Pavel Do

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-11 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 11.02.2016 um 07:05 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > Am 10.02.2016 um 13:51 hat Pavel Dovgalyuk geschrieben: > > > > However, I don't under

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-11 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 11.02.2016 um 12:00 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > Am 11.02.2016 um 07:05 hat Pavel Dovgalyuk geschrieben: > > > > > From: Kevin Wolf [mailto:kw...@re

Re: [Qemu-devel] [PATCH v2 4/4] replay: introduce block devices record/replay

2016-02-11 Thread Pavel Dovgalyuk
> From: Stefan Hajnoczi [mailto:stefa...@redhat.com] > On Wed, Feb 10, 2016 at 12:13:23PM +0300, Pavel Dovgalyuk wrote: > > @@ -784,7 +798,11 @@ BlockAIOCB *blk_aio_flush(BlockBackend *blk, > > return blk_abort_aio_request(blk, cb, opaque, -ENOMEDIUM); > >

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-12 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 11.02.2016 um 12:00 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > Am 11.02.2016 um 07:05 hat Pavel Dovgalyuk geschrieben: > > > > > From: Kevin Wolf [mailto:kw...@re

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-12 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 10.02.2016 um 13:51 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > Am 10.02.2016 um 13:05 hat Pavel Dovgalyuk geschrieben: > > > > > Am 09.02.2016 um 12:52 hat Pavel Do

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-15 Thread Pavel Dovgalyuk
, in order for this to work, we actually need to take the mutex > before calling blkreplay_run_event(), which is called directly from the > replay code (which runs in the mainloop thread? Or vcpu?). blkreplay_run_event() is called from replay code which is protected by mutex. This function may be called from io and vcpu threads, because both of them have replay functions invocations. > So I think you need to have a aio_context_acquire(bs->aio_context) and > aio_context_release(bs->aio_context) around the function; either here or > in the calling replay code. And what about coroutine code? Does it call aio_context_acquire somewhere? Pavel Dovgalyuk

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-15 Thread Pavel Dovgalyuk
> From: Pavel Dovgalyuk [mailto:dovga...@ispras.ru] > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > > > > > int blkreplay_co_readv() > > > > { > > > > BlockReplayState *s = bs->opaque; > > > >

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-15 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 15.02.2016 um 10:14 hat Pavel Dovgalyuk geschrieben: > > > From: Pavel Dovgalyuk [mailto:dovga...@ispras.ru] > > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > >

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-15 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 15.02.2016 um 10:14 hat Pavel Dovgalyuk geschrieben: > > > From: Pavel Dovgalyuk [mailto:dovga...@ispras.ru] > > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > >

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-15 Thread Pavel Dovgalyuk
added to the queue. > And I still don't understand why aio_poll() doesn't work and where it > hangs. aio_poll hangs if "req = block_request_insert(reqid, bs, qemu_coroutine_self());" line is executed after bdrv_co_readv. When bdrv_co_readv yields, replay_run_block_event has no information about pending request and cannot jump to its coroutine. Maybe I should implement aio_poll execution there to make progress in that case? > > qemu_coroutine_enter(req->co, NULL); > > } > > } Pavel Dovgalyuk

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-15 Thread Pavel Dovgalyuk
he coroutine and in the main "coroutine" that executes > > > aio_poll()? I've tried to replace usleep with aio_poll. In this case replay cannot be made, because of recursive mutex lock: aio_poll -> qemu_clock_get_ns -> -> replay_run_block_event -> aio_poll -> qemu_clock_get_ns -> -> Pavel Dovgalyuk

Re: [Qemu-devel] [PATCH 3/3] replay: introduce block devices record/replay

2016-02-15 Thread Pavel Dovgalyuk
> From: Kevin Wolf [mailto:kw...@redhat.com] > Am 15.02.2016 um 15:24 hat Pavel Dovgalyuk geschrieben: > > > From: Kevin Wolf [mailto:kw...@redhat.com] > > > > > > There could be asynchronous events that occur in non-cpu threads. > > > > For now the

<    1   2   3   4   5   6   7   8   9   10   >