[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/36] util/async: Only call icount_notify_exit() if icount is ena
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 14/36] util/async: Only call icount_notify_exit() if icount is enabled |
Date: |
Fri, 19 Jan 2024 12:34:43 +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 | 4 +++-
stubs/icount.c | 2 +-
util/async.c | 16 +++++++++-------
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/accel/tcg/icount-common.c b/accel/tcg/icount-common.c
index f0f8fc7f1c..a4a747d1dc 100644
--- a/accel/tcg/icount-common.c
+++ b/accel/tcg/icount-common.c
@@ -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);
}
diff --git a/stubs/icount.c b/stubs/icount.c
index c2c10dfb6b..1eb35b10a8 100644
--- a/stubs/icount.c
+++ b/stubs/icount.c
@@ -45,7 +45,7 @@ void icount_account_warp_timer(void)
{
abort();
}
-
void icount_notify_exit(void)
{
+ abort();
}
diff --git a/util/async.c b/util/async.c
index 36a8e76ab0..0467890052 100644
--- a/util/async.c
+++ b/util/async.c
@@ -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() */
--
2.41.0
- [PULL 04/36] accel: Do not set CPUState::can_do_io in non-TCG accels, (continued)
- [PULL 04/36] accel: Do not set CPUState::can_do_io in non-TCG accels, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 05/36] target/xtensa: use generic instruction breakpoint infrastructure, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 06/36] tests/tcg/xtensa: add icount/ibreak priority test, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 07/36] accel/tcg: Remove unused tb_invalidate_phys_addr(), Philippe Mathieu-Daudé, 2024/01/19
- [PULL 08/36] accel/tcg: Remove tb_invalidate_phys_page() from system emulation, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 09/36] target/alpha: Extract clk_helper.c from sys_helper.c, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 10/36] target/alpha: Only build sys_helper.c on system emulation, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 11/36] system/cpu-timers: Have icount_configure() return a boolean, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 12/36] system/cpu-timers: Introduce ICountMode enumerator, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 13/36] target/arm: Ensure icount is enabled when emulating INST_RETIRED, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 14/36] util/async: Only call icount_notify_exit() if icount is enabled,
Philippe Mathieu-Daudé <=
- [PULL 15/36] target/sh4: Deprecate the shix machine, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 16/36] hw/block: Deprecate the TC58128 block device, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 17/36] hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 18/36] hw/pflash: refactor pflash_data_write(), Philippe Mathieu-Daudé, 2024/01/19
- [PULL 19/36] hw/pflash: use ldn_{be,le}_p and stn_{be,le}_p, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 20/36] hw/pflash: implement update buffer for block writes, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 21/36] system/replay: Restrict icount to system emulation, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 22/36] system/watchpoint: Move TCG specific code to accel/tcg/, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 23/36] cpus: Restrict 'start-powered-off' property to system emulation, Philippe Mathieu-Daudé, 2024/01/19
- [PULL 24/36] accel: Rename accel_init_ops_interfaces() to include 'system', Philippe Mathieu-Daudé, 2024/01/19