All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] replay: fix replay of the interrupts
@ 2021-01-19 12:39 Pavel Dovgalyuk
  2021-01-22 10:39 ` Philippe Mathieu-Daudé
  2021-01-23 18:15 ` Paolo Bonzini
  0 siblings, 2 replies; 10+ messages in thread
From: Pavel Dovgalyuk @ 2021-01-19 12:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, richard.henderson, pavel.dovgalyuk

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>
---
 accel/tcg/tcg-cpus-icount.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/accel/tcg/tcg-cpus-icount.c b/accel/tcg/tcg-cpus-icount.c
index 9f45432275..a6d2bb8a88 100644
--- a/accel/tcg/tcg-cpus-icount.c
+++ b/accel/tcg/tcg-cpus-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_RECORD || replay_has_checkpoint())) {
         icount_notify_aio_contexts();
     }
 }



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-25 15:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-19 12:39 [PATCH] replay: fix replay of the interrupts Pavel Dovgalyuk
2021-01-22 10:39 ` Philippe Mathieu-Daudé
2021-01-23 18:15 ` Paolo Bonzini
2021-01-25  5:38   ` Pavel Dovgalyuk
2021-01-25  7:13     ` Paolo Bonzini
2021-01-25 12:12       ` Alex Bennée
2021-01-25 12:43         ` Claudio Fontana
2021-01-25 13:01           ` Claudio Fontana
2021-01-25 14:26             ` Alex Bennée
2021-01-25 15:17               ` Claudio Fontana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.