[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 pavel.dovga...@ispras.ru --- Makefile.target |1 + qapi-schema.json | 32

[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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga

[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 pbonz...@redhat.com Subject: [PATCH] cpu-exec: add a new CF_USE_ICOUNT cflag Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- include/exec/exec-all.h |5 +++-- translate-all.c |3 +++ 2 files

[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 pavel.dovga...@ispras.ru --- cpu-exec.c

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

2014-12-08 Thread Pavel Dovgalyuk
-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- 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

[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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga

[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 pavel.dovga...@ispras.ru --- cpu-exec.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 pbonz...@redhat.com Subject: [PATCH] translate: check cflags instead of use_icount global Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- target-alpha/translate.c|8 --- target-arm/translate-a64.c

[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 pavel.dovga...@ispras.ru --- replay/Makefile.objs |1 replay/replay-events.c | 217 ++ replay/replay-internal.h | 27 ++ replay/replay.h |4 + 4 files changed

[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 pavel.dovga...@ispras.ru --- include/qemu/timer.h |7 +++ qemu-timer.c |2 ++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/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 pbonz...@redhat.com Subject: [PATCH] gen-icount: check cflags instead of use_icount global Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- include/exec/gen-icount.h |6 +++--- target-alpha/translate.c

[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 pavel.dovga...@ispras.ru --- cpus.c | 18 +- 1 files changed, 9 insertions

[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
to 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 pavel.dovga...@ispras.ru --- 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

[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 pavel.dovga...@ispras.ru --- include/sysemu/sysemu.h |1 + replay/replay-internal.h |2 ++ replay/replay.c | 11 +++ replay/replay.h |5 + vl.c

[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 pavel.dovga...@ispras.ru --- block.c | 11 +++ cpus.c

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

2014-12-08 Thread Pavel Dovgalyuk
This patch introduces command line options for enabling recording or replaying virtual machine behavior. -record option starts recording of the execution and saves it into the log, specified with fname parameter. -replay option is intended for replaying previously saved log. Signed-off-by: Pavel

[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 pavel.dovga...@ispras.ru --- async.c | 46

[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 pavel.dovga...@ispras.ru --- block.c

[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 pavel.dovga...@ispras.ru --- block/raw-posix.c |6 - block/raw-win32.c |4 +++- include/block/thread-pool.h |4

[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 pavel.dovga...@ispras.ru --- block.c |2 - exec.c |1 replay/replay-internal.h |2 + replay

[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 pavel.dovga...@ispras.ru --- include/ui/input.h |2 + replay/Makefile.objs |1 replay/replay-events.c | 48

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: if (!cpu_can_do_io(cpu

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

2015-01-22 Thread Pavel Dovgalyuk
optional features of replay to make patches cleaner * Minor changes and code cleanup were made --- Pavel Dovgalyuk (21): i386: partial revert of interrupt poll fix replay: global variables and function stubs sysemu: system functions for replay replay: internal functions

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

2015-01-22 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 pavel.dovga...@ispras.ru --- Makefile.target |1 + qapi-schema.json | 18 ++ replay

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

2015-01-22 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- cpu-exec.c

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

2015-01-22 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga

[Qemu-devel] [RFC PATCH v8 17/21] replay: replay aio requests

2015-01-22 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 pavel.dovga...@ispras.ru --- block.c

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

2015-01-22 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 pavel.dovga...@ispras.ru --- async.c | 25

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

2015-01-22 Thread Pavel Dovgalyuk
This patch introduces command line options for enabling recording or replaying virtual machine behavior. -record option starts recording of the execution and saves it into the log, specified with fname parameter. -replay option is intended for replaying previously saved log. Signed-off-by: Pavel

[Qemu-devel] [RFC PATCH v8 19/21] replay: initialization and deinitialization

2015-01-22 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 pavel.dovga...@ispras.ru --- block.c |2 - exec.c |1 replay/replay-internal.c |1 replay/replay

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

2015-01-22 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 pavel.dovga...@ispras.ru --- cpu-exec.c

[Qemu-devel] [RFC PATCH v8 16/21] replay: bottom halves

2015-01-22 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 pavel.dovga...@ispras.ru --- async.c | 24 +++- dma-helpers.c

[Qemu-devel] [RFC PATCH v8 21/21] replay: recording of the user input

2015-01-22 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 pavel.dovga...@ispras.ru --- include/ui/input.h |2 + replay/Makefile.objs |1 replay/replay-events.c | 55

[Qemu-devel] [RFC PATCH v8 10/21] replay: asynchronous events infrastructure

2015-01-22 Thread Pavel Dovgalyuk
, or checkpoint in the iothread. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/Makefile.objs |1 replay/replay-events.c | 228 ++ replay/replay-internal.h | 33 ++- replay/replay.h |4 + 4 files changed

[Qemu-devel] [RFC PATCH v8 18/21] replay: thread pool

2015-01-22 Thread Pavel Dovgalyuk
This patch modifies thread pool to allow replaying asynchronous thread tasks synchronously in replay mode. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- block/raw-posix.c |6 - block/raw-win32.c |4 +++- include/block/thread-pool.h |4

[Qemu-devel] [RFC PATCH v8 11/21] replay: recording and replaying clock ticks

2015-01-22 Thread Pavel Dovgalyuk
to 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 v8 06/21] replay: introduce icount event

2015-01-22 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 pavel.dovga...@ispras.ru --- replay/replay-internal.c | 16 replay/replay

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

2015-01-22 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. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- cpus.c |4 ++-- include/exec/exec-all.h

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

2015-01-22 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. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/replay-internal.c | 25

[Qemu-devel] [RFC PATCH v8 12/21] replay: recording and replaying different timers

2015-01-22 Thread Pavel Dovgalyuk
lead to non-determinism. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- hw/timer/mc146818rtc.c |3 + hw/timer/pl031.c |3 + include/qemu-common.h|1 replay/replay-internal.h |4 + replay/replay-time.c | 132

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

2015-01-22 Thread Pavel Dovgalyuk
This patch records and replays simulator shutdown event. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/replay-internal.h |2 ++ replay/replay.c | 12 replay/replay.h |5 + vl.c |1 + 4 files changed, 20

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

2015-01-22 Thread Pavel Dovgalyuk
This patch adds functions to perform read and write operations with replay log. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/Makefile.objs |1 replay/replay-internal.c | 141 ++ replay/replay-internal.h | 50

[Qemu-devel] [RFC PATCH v8 09/21] replay: interrupts and exceptions

2015-01-22 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 v8 14/21] replay: checkpoints

2015-01-22 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 pavel.dovga...@ispras.ru --- block.c | 11 ++ cpus.c

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

2015-02-18 Thread Pavel Dovgalyuk
This patch records and replays simulator shutdown event. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/replay-internal.h |2 ++ replay/replay.c | 12 replay/replay.h |5 + vl.c

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

2015-02-18 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 pavel.dovga...@ispras.ru --- async.c | 24 +++- dma-helpers.c

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

2015-02-18 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- cpus.c

[Qemu-devel] [RFC PATCH v9 12/23] timer: replace time() with QEMU_CLOCK_HOST

2015-02-18 Thread Pavel Dovgalyuk
This patch replaces time() function calls with calls to qemu_clock_get_ns(QEMU_CLOCK_HOST). It makes such requests deterministic in record/replay mode of icount. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- vl.c | 12 1 files changed, 8 insertions(+), 4 deletions

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

2015-02-18 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 pavel.dovga...@ispras.ru --- hw/bt/hci.c |7 +++ include

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

2015-02-18 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga

[Qemu-devel] [RFC PATCH v9 10/23] replay: asynchronous events infrastructure

2015-02-18 Thread Pavel Dovgalyuk
, or checkpoint in the iothread. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/Makefile.objs |1 replay/replay-events.c | 229 ++ replay/replay-internal.h | 31 ++ replay/replay.h |6 + 4 files changed

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

2015-02-18 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 pavel.dovga...@ispras.ru --- cpus.c

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

2015-02-18 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 pavel.dovga...@ispras.ru --- async.c | 25

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

2015-02-18 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 pavel.dovga...@ispras.ru --- block.c | 12 cpus.c

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

2015-02-18 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 pavel.dovga...@ispras.ru --- include/ui/input.h |2 + replay/Makefile.objs |1 replay/replay-events.c | 31 + replay

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

2015-02-18 Thread Pavel Dovgalyuk
This patch adds global variables, defines, functions declarations, and function stubs for deterministic VM replay used by external modules. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru

[Qemu-devel] [RFC PATCH v9 09/23] replay: interrupts and exceptions

2015-02-18 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 v9 20/23] replay: initialization and deinitialization

2015-02-18 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 pavel.dovga...@ispras.ru --- block.c |2 - exec.c |1 replay/replay-internal.h |2 + replay

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

2015-02-18 Thread Pavel Dovgalyuk
This patch introduces command line options for enabling recording or replaying virtual machine behavior. -record option starts recording of the execution and saves it into the log, specified with fname parameter. -replay option is intended for replaying previously saved log. Signed-off-by: Pavel

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

2015-02-18 Thread Pavel Dovgalyuk
This patch moves typedefs for QemuOpts and related types to qemu/typedefs.h file. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- 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 v9 00/23] Deterministic replay core

2015-02-18 Thread Pavel Dovgalyuk
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 Dovgalyuk (23): i386: partial revert of interrupt

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

2015-02-18 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 pavel.dovga...@ispras.ru --- cpus.c

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

2015-02-18 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga

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

2015-02-18 Thread Pavel Dovgalyuk
This patch adds functions to perform read and write operations with replay log. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/Makefile.objs |1 replay/replay-internal.c | 143 ++ replay/replay-internal.h | 44

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

2015-02-18 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- cpu-exec.c

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

2015-02-18 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/replay

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

2015-02-18 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 pavel.dovga...@ispras.ru --- block.c

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

2015-02-18 Thread Pavel Dovgalyuk
This patch modifies thread pool to allow replaying asynchronous thread tasks synchronously in replay mode. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- block/raw-posix.c |6 - block/raw-win32.c |4 +++- include/block/thread-pool.h |4

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

2015-01-12 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. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- cpus.c |4 ++-- include/exec/exec-all.h

[Qemu-devel] [RFC PATCH v7 17/21] replay: replay aio requests

2015-01-12 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 pavel.dovga...@ispras.ru --- block.c

[Qemu-devel] [RFC PATCH v7 06/21] cpu-exec: allow temporary disabling icount

2015-01-12 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga

[Qemu-devel] [RFC PATCH v7 07/21] cpu: replay instructions sequence

2015-01-12 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 pavel.dovga...@ispras.ru --- cpu-exec.c

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

2015-01-12 Thread Pavel Dovgalyuk
This patch fixes icount warp rt timer. It should be based on virtual_rt clock to be deterministic. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- cpus.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cpus.c b/cpus.c index 0c368f2..8787277 100644

[Qemu-devel] [RFC PATCH v7 18/21] replay: thread pool

2015-01-12 Thread Pavel Dovgalyuk
This patch modifies thread pool to allow replaying asynchronous thread tasks synchronously in replay mode. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- block/raw-posix.c |6 - block/raw-win32.c |4 +++- include/block/thread-pool.h |4

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

2015-01-12 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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- cpu-exec.c

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

2015-01-12 Thread Pavel Dovgalyuk
This patch introduces command line options for enabling recording or replaying virtual machine behavior. -record option starts recording of the execution and saves it into the log, specified with fname parameter. -replay option is intended for replaying previously saved log. Signed-off-by: Pavel

[Qemu-devel] [RFC PATCH v7 21/21] replay: recording of the user input

2015-01-12 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 pavel.dovga...@ispras.ru --- include/ui/input.h |2 + replay/Makefile.objs |1 replay/replay-events.c | 48

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

2015-01-12 Thread Pavel Dovgalyuk
to 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 v7 00/21] Deterministic replay core

2015-01-12 Thread Pavel Dovgalyuk
: * 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 Dovgalyuk (21

[Qemu-devel] [RFC PATCH v7 13/21] replay: recording and replaying different timers

2015-01-12 Thread Pavel Dovgalyuk
lead to non-determinism. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- 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

[Qemu-devel] [RFC PATCH v7 19/21] replay: initialization and deinitialization

2015-01-12 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 pavel.dovga...@ispras.ru --- block.c |2 - exec.c |1 replay/replay-internal.h |2 + replay

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

2015-01-12 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 pavel.dovga...@ispras.ru --- Makefile.target |1 + qapi-schema.json | 32

[Qemu-devel] [RFC PATCH v7 05/21] replay: introduce icount event

2015-01-12 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 pavel.dovga...@ispras.ru --- replay/replay-internal.c | 14 ++ replay/replay

[Qemu-devel] [RFC PATCH v7 08/21] replay: interrupts and exceptions

2015-01-12 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 v7 09/21] replay: asynchronous events infrastructure

2015-01-12 Thread Pavel Dovgalyuk
, or checkpoint in the iothread. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/Makefile.objs |1 replay/replay-events.c | 217 ++ replay/replay-internal.h | 27 ++ replay/replay.h |4 + 4 files changed

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

2015-01-12 Thread Pavel Dovgalyuk
This patch adds functions to perform read and write operations with replay log. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- replay/Makefile.objs |1 replay/replay-internal.c | 141 ++ replay/replay-internal.h | 50

[Qemu-devel] [RFC PATCH v7 16/21] replay: bottom halves

2015-01-12 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 pavel.dovga...@ispras.ru --- async.c | 46

[Qemu-devel] [RFC PATCH v7 11/21] timer: fix usage of clock functions

2015-01-12 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 v7 14/21] replay: shutdown event

2015-01-12 Thread Pavel Dovgalyuk
This patch records and replays simulator shutdown event. Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru --- include/sysemu/sysemu.h |1 + replay/replay-internal.h |2 ++ replay/replay.c | 11 +++ replay/replay.h |5 + vl.c

[Qemu-devel] [RFC PATCH v7 15/21] replay: checkpoints

2015-01-12 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 pavel.dovga...@ispras.ru --- block.c | 11 +++ cpus.c

[Qemu-devel] [PATCH] win64: perform correct setjmp calls

2015-02-08 Thread Pavel Dovgalyuk
On w64, setjmp is implemented by _setjmp which needs a second parameter. This parameter should be NULL to allow using longjump from generated code. This patch replaces all usages of setjmp.h with new header files which replaces setjmp with _setjmp function on win64 platform. Signed-off-by: Pavel

[Qemu-devel] [RFC PATCH v10 00/24] Deterministic replay core

2015-02-27 Thread Pavel Dovgalyuk
) * Removed some optional features of replay to make patches cleaner * Minor changes and code cleanup were made --- Pavel Dovgalyuk (24): i386: partial revert of interrupt poll fix replay: global variables and function stubs sysemu: system functions for replay replay

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

2015-02-27 Thread Pavel Dovgalyuk
This patch adds global variables, defines, functions declarations, and function stubs for deterministic VM replay used by external modules. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga...@ispras.ru

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

2015-02-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 pbonz...@redhat.com Signed-off-by: Pavel Dovgalyuk pavel.dovga

[Qemu-devel] [RFC PATCH v10 22/24] replay: replay blockers for devices

2015-02-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 pavel.dovga...@ispras.ru --- hw/bt/hci.c |7 +++ include

[Qemu-devel] [RFC PATCH v10 16/24] aio: replace stack of bottom halves with queue

2015-02-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 pavel.dovga...@ispras.ru --- async.c | 26

[Qemu-devel] [RFC PATCH v10 19/24] replay: thread pool

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

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