[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v4 20/23] replay: avoid recursive call of checkp
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [RFC PATCH v4 20/23] replay: avoid recursive call of checkpoints |
Date: |
Fri, 19 Jan 2018 11:45:06 +0300 |
User-agent: |
StGit/0.17.1-dirty |
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 <address@hidden>
---
replay/replay.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/replay/replay.c b/replay/replay.c
index 585c5de..c676dd4 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -176,13 +176,24 @@ void replay_shutdown_request(ShutdownCause cause)
bool replay_checkpoint(ReplayCheckpoint checkpoint)
{
bool res = false;
+ static bool in_checkpoint;
assert(EVENT_CHECKPOINT + checkpoint <= EVENT_CHECKPOINT_LAST);
- replay_save_instructions();
if (!replay_file) {
return true;
}
+ if (in_checkpoint) {
+ /* If we are already in checkpoint, then there is no need
+ for additional synchronization.
+ Recursion occurs when HW event modifies timers.
+ Timer modification may invoke the checkpoint and
+ proceed to recursion. */
+ return true;
+ }
+ in_checkpoint = true;
+
+ replay_save_instructions();
if (replay_mode == REPLAY_MODE_PLAY) {
g_assert(replay_mutex_locked());
@@ -204,6 +215,7 @@ bool replay_checkpoint(ReplayCheckpoint checkpoint)
res = true;
}
out:
+ in_checkpoint = false;
return res;
}
- Re: [Qemu-devel] [RFC PATCH v4 13/23] cpus: only take BQL for sleeping threads, (continued)
- Re: [Qemu-devel] [RFC PATCH v4 13/23] cpus: only take BQL for sleeping threads, Paolo Bonzini, 2018/01/19
- Re: [Qemu-devel] [RFC PATCH v4 13/23] cpus: only take BQL for sleeping threads, Pavel Dovgalyuk, 2018/01/19
- Re: [Qemu-devel] [RFC PATCH v4 13/23] cpus: only take BQL for sleeping threads, Paolo Bonzini, 2018/01/19
- Re: [Qemu-devel] [RFC PATCH v4 13/23] cpus: only take BQL for sleeping threads, Pavel Dovgalyuk, 2018/01/19
- Re: [Qemu-devel] [RFC PATCH v4 13/23] cpus: only take BQL for sleeping threads, Pavel Dovgalyuk, 2018/01/19
- Re: [Qemu-devel] [RFC PATCH v4 13/23] cpus: only take BQL for sleeping threads, Paolo Bonzini, 2018/01/19
[Qemu-devel] [RFC PATCH v4 15/23] replay/replay-internal.c: track holding of replay_lock, Pavel Dovgalyuk, 2018/01/19
[Qemu-devel] [RFC PATCH v4 16/23] replay: make locking visible outside replay code, Pavel Dovgalyuk, 2018/01/19
[Qemu-devel] [RFC PATCH v4 17/23] replay: push replay_mutex_lock up the call tree, Pavel Dovgalyuk, 2018/01/19
[Qemu-devel] [RFC PATCH v4 18/23] replay: don't destroy mutex at exit, Pavel Dovgalyuk, 2018/01/19
[Qemu-devel] [RFC PATCH v4 20/23] replay: avoid recursive call of checkpoints,
Pavel Dovgalyuk <=
[Qemu-devel] [RFC PATCH v4 19/23] replay: check return values of fwrite, Pavel Dovgalyuk, 2018/01/19
[Qemu-devel] [RFC PATCH v4 21/23] scripts/replay-dump.py: replay log dumper, Pavel Dovgalyuk, 2018/01/19
[Qemu-devel] [RFC PATCH v4 22/23] replay: don't process async events when warping the clock, Pavel Dovgalyuk, 2018/01/19
[Qemu-devel] [RFC PATCH v4 23/23] replay: save vmstate of the asynchronous events, Pavel Dovgalyuk, 2018/01/19
Re: [Qemu-devel] [RFC PATCH v4 00/23] replay additions, no-reply, 2018/01/19