]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/hvf: Skip WFI if CPU has work to do
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 3 Oct 2025 14:14:51 +0000 (16:14 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 16 Jan 2026 10:17:28 +0000 (11:17 +0100)
Avoid sleeping vCPU thread for any pending work, not just IRQs.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Message-ID: <20260112103034.65310-13-philmd@linaro.org>

target/arm/hvf/hvf.c

index af28b8e88250ba23e352c943fc85b507cba88082..d74703a3d55e7d7499551e6038d0990254f13d9a 100644 (file)
@@ -1737,8 +1737,11 @@ static void hvf_wfi(CPUState *cpu)
     uint64_t nanos;
     uint32_t cntfrq;
 
-    if (cpu_test_interrupt(cpu, CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIQ)) {
-        /* Interrupt pending, no need to wait */
+    if (cpu_has_work(cpu)) {
+        /*
+         * Don't bother to go into our "low power state" if
+         * we would just wake up immediately.
+         */
         return;
     }