diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-12-08 12:35:27 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-01-19 12:28:59 +0100 |
commit | 72c603f82f2267c93fadf37aac2412d1b19645d2 (patch) | |
tree | 1da8a28e9bb0e68aa529ac1373dc4f620e5570ff /util | |
parent | 24128132866d8486e8f0b4bdf647ced03b5ef522 (diff) |
util/async: Only call icount_notify_exit() if icount is enabled
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>
Diffstat (limited to 'util')
-rw-r--r-- | util/async.c | 16 |
1 files changed, 9 insertions, 7 deletions
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() */ |