aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorPavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>2021-02-01 10:05:27 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2021-02-08 14:43:55 +0100
commit189012fcd7babafd937c4cabd5c3231be6e85fdc (patch)
tree38c1f6fff3f0b6ebf78ea42c9f714125b9f3cb7d /accel
parent38e0b7904eca7cd32f8953c33701e1f226ecc3fe (diff)
downloadqemu-189012fcd7babafd937c4cabd5c3231be6e85fdc.zip
qemu-189012fcd7babafd937c4cabd5c3231be6e85fdc.tar.gz
qemu-189012fcd7babafd937c4cabd5c3231be6e85fdc.tar.bz2
replay: fix replay of the interrupts
Sometimes interrupt event comes at the same time with the virtual timers. In this case replay tries to proceed the timers, because deadline for them is zero. This patch allows processing interrupts and exceptions by entering the vCPU execution loop, when deadline is zero, but checkpoint associated with virtual timers is not ready to be replayed. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Message-Id: <161216312794.2030770.1709657858900983160.stgit@pasha-ThinkPad-X280> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel')
-rw-r--r--accel/tcg/tcg-accel-ops-icount.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/accel/tcg/tcg-accel-ops-icount.c b/accel/tcg/tcg-accel-ops-icount.c
index 87762b4..13b8fbe 100644
--- a/accel/tcg/tcg-accel-ops-icount.c
+++ b/accel/tcg/tcg-accel-ops-icount.c
@@ -81,7 +81,13 @@ void icount_handle_deadline(void)
int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
QEMU_TIMER_ATTR_ALL);
- if (deadline == 0) {
+ /*
+ * Instructions, interrupts, and exceptions are processed in cpu-exec.
+ * Don't interrupt cpu thread, when these events are waiting
+ * (i.e., there is no checkpoint)
+ */
+ if (deadline == 0
+ && (replay_mode != REPLAY_MODE_PLAY || replay_has_checkpoint())) {
icount_notify_aio_contexts();
}
}