]> git.proxmox.com Git - mirror_qemu.git/commitdiff
util/async: Only call icount_notify_exit() if icount is enabled
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 8 Dec 2023 11:35:27 +0000 (12:35 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 19 Jan 2024 11:28:59 +0000 (12:28 +0100)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231208113529.74067-6-philmd@linaro.org>

accel/tcg/icount-common.c
stubs/icount.c
util/async.c

index f0f8fc7f1cde798f8ef0bf2f392fe4dcfa0a5e00..a4a747d1dc998f7e791a86ab49c06c3b0eb96341 100644 (file)
@@ -495,7 +495,9 @@ bool icount_configure(QemuOpts *opts, Error **errp)
 
 void icount_notify_exit(void)
 {
-    if (icount_enabled() && current_cpu) {
+    assert(icount_enabled());
+
+    if (current_cpu) {
         qemu_cpu_kick(current_cpu);
         qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
     }
index c2c10dfb6b1a56e45a80e3c2cd360fcfc9dfcc64..1eb35b10a867cc26581be2a515137d72c88da65b 100644 (file)
@@ -45,7 +45,7 @@ void icount_account_warp_timer(void)
 {
     abort();
 }
-
 void icount_notify_exit(void)
 {
+    abort();
 }
index 36a8e76ab0d2de8dc636f1432b1f7785c91867a3..0467890052a6923fe8a6ee81f33527deae22acce 100644 (file)
@@ -94,13 +94,15 @@ static void aio_bh_enqueue(QEMUBH *bh, unsigned new_flags)
     }
 
     aio_notify(ctx);
-    /*
-     * Workaround for record/replay.
-     * vCPU execution should be suspended when new BH is set.
-     * This is needed to avoid guest timeouts caused
-     * by the long cycles of the execution.
-     */
-    icount_notify_exit();
+    if (unlikely(icount_enabled())) {
+        /*
+         * Workaround for record/replay.
+         * vCPU execution should be suspended when new BH is set.
+         * This is needed to avoid guest timeouts caused
+         * by the long cycles of the execution.
+         */
+        icount_notify_exit();
+    }
 }
 
 /* Only called from aio_bh_poll() and aio_ctx_finalize() */