- Aug 21, 2020
-
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 26, 2020
-
-
Pavel Dovgaluk authored
Sometimes virtual timer callbacks depend on order of virtual timer processing and warping of virtual clock. Therefore every callback should be logged to make replay deterministic. This patch creates a checkpoint before every virtual timer callback. With these checkpoints virtual timers processing and clock warping events order is completely deterministic. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Acked-by:
Alex Bennée <alex.bennee@linaro.org> -- v2: - remove mutex lock/unlock for virtual clock checkpoint since it is not process any asynchronous events (commit ca9759c2) - bump record/replay log file version Message-Id: <159012932716.27256.8854065545365559921.stgit@pasha-ThinkPad-X280> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 12, 2020
-
-
Pavel Dovgaluk authored
When QEMU is used without any graphical window, QEMU execution is terminated with the signal (e.g., Ctrl-C). Signal processing in QEMU does not include qemu_system_shutdown_request call. That is why shutdown event is not recorded by record/replay in this case. This patch adds shutdown event to the end of the record log. Now every replay will shutdown the machine at the end. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <159012995470.27967.18129611453659045726.stgit@pasha-ThinkPad-X280> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 10, 2020
-
-
Pavel Dovgaluk authored
In record/replay icount mode main loop thread and vCPU thread do not perform simultaneously. They take replay mutex to synchronize the actions. Sometimes vCPU thread waits for locking the mutex for very long time, because main loop releases the mutex and takes it back again. Standard qemu mutex do not provide the ordering capabilities. This patch adds a "queue" for replay mutex. Therefore thread ordering becomes more "fair". Threads are executed in the same order as they are trying to take the mutex. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <158823802979.28101.9340462887738957616.stgit@pasha-ThinkPad-X280> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jan 07, 2020
-
-
Pavel Dovgaluk authored
Record/replay feature of icount allows deterministic running of execution scenarios. Some CPUs and peripheral devices read random numbers from external sources making deterministic execution impossible. This patch adds recording and replaying of random read operations into guest-random module, which is used by the virtual hardware. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <157675984852.14505.15709141760677102489.stgit@pasha-Precision-3630-Tower> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 14, 2019
-
-
Pavel Dovgaluk authored
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> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Pavel Dovgaluk authored
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> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- Aug 21, 2019
-
-
Kővágó, Zoltán authored
Signed-off-by:
Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: c5193e687fc6cc0f60cb3e90fe69ddf2027d0df1.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Aug 20, 2019
-
-
Pavel Dovgaluk authored
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> Message-Id: <156404428377.18669.15476429889039912070.stgit@pasha-Precision-3630-Tower> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
This patch removes refactoring artifacts from the replay/replay-time.c Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <156404427799.18669.8072341590511911277.stgit@pasha-Precision-3630-Tower> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
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> Message-Id: <156404427238.18669.12378772823692338069.stgit@pasha-Precision-3630-Tower> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
This is a fix which was missed by patch 74c0b816, which added current_step parameter to the replay_advance_current_step function. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <156404425561.18669.13015037579222450241.stgit@pasha-Precision-3630-Tower> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Dr. David Alan Gilbert authored
Now we're not using the 'last' field in the timer, remove it from replay. Bump the version number of the replay structure since we've removed the field. Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190724115823.4199-4-dgilbert@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Aug 16, 2019
-
-
Markus Armbruster authored
sysemu/sysemu.h is a rather unfocused dumping ground for stuff related to the system-emulator. Evidence: * It's included widely: in my "build everything" tree, changing sysemu/sysemu.h still triggers a recompile of some 1100 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h, down from 5400 due to the previous two commits). * It pulls in more than a dozen additional headers. Split stuff related to run state management into its own header sysemu/runstate.h. Touching sysemu/sysemu.h now recompiles some 850 objects. qemu/uuid.h also drops from 1100 to 850, and qapi/qapi-types-run-state.h from 4400 to 4200. Touching new sysemu/runstate.h recompiles some 500 objects. Since I'm touching MAINTAINERS to add sysemu/runstate.h anyway, also add qemu/main-loop.h. Suggested-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190812052359.30071-30-armbru@redhat.com> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> [Unbreak OS-X build]
-
Markus Armbruster authored
In my "build everything" tree, changing sysemu/sysemu.h triggers a recompile of some 5400 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). Almost a third of its inclusions are actually superfluous. Delete them. Downgrade two more to qapi/qapi-types-run-state.h, and move one from char/serial.h to char/serial.c. hw/semihosting/config.c, monitor/monitor.c, qdev-monitor.c, and stubs/semihost.c define variables declared in sysemu/sysemu.h without including it. The compiler is cool with that, but include it anyway. This doesn't reduce actual use much, as it's still included into widely included headers. The next commit will tackle that. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Alistair Francis <alistair.francis@wdc.com> Message-Id: <20190812052359.30071-27-armbru@redhat.com> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org>
-
Markus Armbruster authored
In my "build everything" tree, changing qemu/main-loop.h triggers a recompile of some 5600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). It includes block/aio.h, which in turn includes qemu/event_notifier.h, qemu/notify.h, qemu/processor.h, qemu/qsp.h, qemu/queue.h, qemu/thread-posix.h, qemu/thread.h, qemu/timer.h, and a few more. Include qemu/main-loop.h only where it's needed. Touching it now recompiles only some 1700 objects. For block/aio.h and qemu/event_notifier.h, these numbers drop from 5600 to 2800. For the others, they shrink only slightly. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190812052359.30071-21-armbru@redhat.com> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by:
Philippe Mathieu-Daudé <philmd@redhat.com>
-
- Jun 12, 2019
-
-
Markus Armbruster authored
No header includes qemu-common.h after this commit, as prescribed by qemu-common.h's file comment. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-5-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and net/tap-bsd.c fixed up]
-
- Nov 08, 2018
-
-
Peter Maydell authored
Currently replay_get_byte() does not check for an error from getc(). Coverity points out (CID 1390622) that this could result in unexpected behaviour (such as looping forever, if we use the replay_get_dword() return value for a loop count). We don't expect reads from the replay log to fail, and if they do there is no way we can continue. So make them fatal errors. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-id: 20181106153330.5139-1-peter.maydell@linaro.org
-
- Oct 19, 2018
-
-
Paolo Bonzini authored
This avoids lock recursion when REPLAY_CLOCK is called inside the timers spinlock. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
As QEMU becomes more multi-threaded and non-synchronized, checkpoints move from thread to thread. And the event queue that processed at checkpoints should belong to the same thread in both record and replay executions. This patch disables asynchronous event processing at virtual clock checkpoint, because it may be invoked in different threads at record and replay. This patch is temporary fix until the checkpoints are completely refactored. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20181018063345.7433.11678.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Oct 02, 2018
-
-
Pavel Dovgaluk authored
This patch enables using -loadvm in recording mode to allow starting the execution recording from any of the available snapshots. It also fixes loading of the record/replay state, therefore snapshots created in replay mode may also be used for starting the new recording. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20180912081939.3228.56131.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
This patch adds events processing when emulation finishes instead of just cleaning the queue. Now the bdrv coroutines will be in consistent state when emulator closes. It allows correct polling of the block layer at exit. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20180912081859.3228.79735.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
In record/replay icount mode vCPU thread and iothread synchronize the execution using the checkpoints. vCPU thread processes the virtual timers and iothread processes all others. When iothread wants to wake up sleeping vCPU thread, it sends dummy queued work. Therefore it could be the following sequence of the events in record mode: - IO: sending dummy work - IO: processing timers - CPU: wakeup - CPU: clearing dummy work - CPU: processing virtual timers But due to the races in replay mode the sequence may change: - IO: sending dummy work - CPU: wakeup - CPU: clearing dummy work - CPU: sleeping again because nothing to do - IO: Processing timers - CPU: zzzz In this case vCPU will not wake up, because dummy work is not to be set up again. This patch tries to wake up the vCPU when it sleeps and the icount warp checkpoint isn't met. It means that vCPU has something to do, because there are no other reasons of non-matching warp checkpoint. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> -- v5: improve checking that vCPU is still sleeping Message-Id: <20180912081945.3228.19776.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Sep 25, 2018
-
-
Thomas Huth authored
These files can not be executed on the host, so they should not be marked as executable. Reviewed-by:
David Hildenbrand <david@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Mar 12, 2018
-
-
Pavel Dovgaluk authored
This patch fixes saving and loading the snapshots in the replay mode. It is required for the snapshots created in the moment when the header of the asynchronous event is read. This information was not saved in the snapshot. After loading the vmstate replay continued with the file offset passed the event header. The event header is lost in this case and replay hangs. Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Message-Id: <20180227095322.1060.53929.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
Virtual clock is warped from iothread and vcpu thread. When the hardware events associated with warp checkpoint, then interrupt delivering may be non-deterministic if checkpoint is processed in different threads in record and replay. This patch disables event processing for clock warp checkpoint and leaves all hardware events to other checkpoints (e.g., virtual clock). Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20180227095316.1060.4134.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
Pavel Dovgaluk authored
This patch adds a flag which denies recursive call of replay_checkpoint function. Checkpoints may be accompanied by the hardware events. When event is processed, virtual device may invoke timer modification functions that also invoke the checkpoint function. This leads to infinite loop. Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20180227095305.1060.56463.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
Pavel Dovgaluk authored
This patch adds error reporting when fwrite cannot completely save the buffer to the file. Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20180227095259.1060.86410.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
Alex Bennée authored
Now instead of using the replay_lock to guard the output of the log we now use it to protect the whole execution section. This replaces what the BQL used to do when it was held during TCG execution. We also introduce some rules for locking order - mainly that you cannot take the replay_mutex while holding the BQL. This leads to some slight sophistry during start-up and extending the replay_mutex_destroy function to unlock the mutex without checking for the BQL condition so it can be cleanly dropped in the non-replay case. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Tested-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20180227095248.1060.40374.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Alex Bennée <alex.bennee@linaro.org>
-
Pavel Dovgaluk authored
Replay mutex is held by vCPU thread and destroy function is called from atexit of the main thread. Therefore we cannot destroy it safely. Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180227095254.1060.96971.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
Alex Bennée authored
The replay_mutex_lock/unlock/locked functions are now going to be used for ensuring lock-step behaviour between the two threads. Make them public API functions and also provide stubs for non-QEMU builds on common paths. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20180227095242.1060.16601.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alex Bennée authored
This is modelled after the iothread mutex lock. We keep a TLS flag to indicate when that thread has acquired the lock and assert we don't double-lock or release when we shouldn't have. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Tested-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20180227095237.1060.44661.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Alex Bennée authored
This time commit 802f045a broke the replay file format. Also add a comment about this to replay-internal.h. Signed-off-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180227095231.1060.91180.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Pavel Dovgaluk authored
This patch adds saving/restoring of the host clock field 'last'. It is used in host clock calculation and therefore clock may become incorrect when using restored vmstate. Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180227095226.1060.50975.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
Pavel Dovgaluk authored
This patch does not allows saving/loading vmstate when replay events queue is not empty. There is no reliable way to save events queue, because it describes internal coroutine state. Therefore saving and loading operations should be deferred to another record/replay step. Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20180227095214.1060.32939.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
Pavel Dovgaluk authored
This patch fixes assignment to internal events_enabled variable. Now it is set only in record/replay mode. This affects the behavior of the external functions that check this flag. Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180227095209.1060.45884.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
Pavel Dovgaluk authored
Asynchronous events saved at checkpoints may invoke callbacks when processed. These callbacks may also generate/read new events (e.g. clock reads). Therefore event processing flag must be reset before callback invocation. Signed-off-by:
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180227095203.1060.70831.stgit@pasha-VirtualBox> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
-
- Mar 02, 2018
-
-
Markus Armbruster authored
In my "build everything" tree, a change to the types in qapi-schema.json triggers a recompile of about 4800 out of 5100 objects. The previous commit split up qmp-commands.h, qmp-event.h, qmp-visit.h, qapi-types.h. Each of these headers still includes all its shards. Reduce compile time by including just the shards we actually need. To illustrate the benefits: adding a type to qapi/migration.json now recompiles some 2300 instead of 4800 objects. The next commit will improve it further. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180211093607.27351-24-armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> [eblake: rebase to master] Signed-off-by:
Eric Blake <eblake@redhat.com>
-
- Feb 09, 2018
-
-
Markus Armbruster authored
qemu-common.h includes qemu/option.h, but most places that include the former don't actually need the latter. Drop the include, and add it to the places that actually need it. While there, drop superfluous includes of both headers, and separate #include from file comment with a blank line. This cleanup makes the number of objects depending on qemu/option.h drop from 4545 (out of 4743) to 284 in my "build everything" tree. Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-20-armbru@redhat.com> [Semantic conflict with commit bdd6a90a in block/nvme.c resolved]
-
Markus Armbruster authored
This cleanup makes the number of objects depending on qapi/error.h drop from 1910 (out of 4743) to 1612 in my "build everything" tree. While there, separate #include from file comment with a blank line, and drop a useless comment on why qemu/osdep.h is included first. Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-5-armbru@redhat.com> [Semantic conflict with commit 34e304e9 resolved, OSX breakage fixed]
-