Commit 1f68657238 for qemu.org
commit 1f68657238a74d79b17be0cff68926cae6846d21
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date: Thu Nov 19 23:49:10 2026 +0100
accel/tcg: Check current CPU in icount interrupt handler
Under round-robin TCG, all vCPUs share one host thread,
so qemu_cpu_is_self() is true for every vCPU. The icount
interrupt sanity check can therefore abort when an interrupt
targets a different vCPU sharing the current thread.
Compare current_cpu with the target CPU instead.
Suggested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20261119225514.4080-3-philmd@oss.qualcomm.com>
diff --git a/accel/tcg/tcg-accel-ops-icount.c b/accel/tcg/tcg-accel-ops-icount.c
index d0f7b410fa..0313a4d128 100644
--- a/accel/tcg/tcg-accel-ops-icount.c
+++ b/accel/tcg/tcg-accel-ops-icount.c
@@ -152,7 +152,7 @@ void icount_handle_interrupt(CPUState *cpu, int mask)
int old_mask = cpu->interrupt_request;
tcg_handle_interrupt(cpu, mask);
- if (qemu_cpu_is_self(cpu) &&
+ if (current_cpu == cpu &&
!cpu->neg.can_do_io
&& (mask & ~old_mask) != 0) {
cpu_abort(cpu, "Raised interrupt while not in I/O function");