summary refs log tree commit diff stats
path: root/accel/kvm/kvm-accel-ops.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-08-11 09:52:46 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-09-17 19:00:56 +0200
commitd5e33b5f8f5a787bc4bb38bd0b9a8c3e3a0aa9f0 (patch)
tree3407645edce0806c0c480b1c721859ca6d39745f /accel/kvm/kvm-accel-ops.c
parent9a191d3782d707062c42b9fc9f22d9f55d4ed375 (diff)
downloadfocaccia-qemu-d5e33b5f8f5a787bc4bb38bd0b9a8c3e3a0aa9f0.tar.gz
focaccia-qemu-d5e33b5f8f5a787bc4bb38bd0b9a8c3e3a0aa9f0.zip
accel: make all calls to qemu_process_cpu_events look the same
There is no reason for some accelerators to use qemu_process_cpu_events_common
(which is separated from qemu_process_cpu_events() specifically for round
robin TCG).  They can also check for events directly on the first pass through
the loop, instead of setting cpu->exit_request to true.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel/kvm/kvm-accel-ops.c')
-rw-r--r--accel/kvm/kvm-accel-ops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c
index 65a7f76a69..8ed6945c2f 100644
--- a/accel/kvm/kvm-accel-ops.c
+++ b/accel/kvm/kvm-accel-ops.c
@@ -47,13 +47,14 @@ static void *kvm_vcpu_thread_fn(void *arg)
     qemu_guest_random_seed_thread_part2(cpu->random_seed);
 
     do {
+        qemu_process_cpu_events(cpu);
+
         if (cpu_can_run(cpu)) {
             r = kvm_cpu_exec(cpu);
             if (r == EXCP_DEBUG) {
                 cpu_handle_guest_debug(cpu);
             }
         }
-        qemu_process_cpu_events(cpu);
     } while (!cpu->unplug || cpu_can_run(cpu));
 
     kvm_destroy_vcpu(cpu);