Files
qemu-reims-vgpu/accel
Stian Halseth 3992091713 accel/tcg: Do not flush and retry in place in tb_gen_code
When the code buffer is full in a serial context, tb_gen_code() flushes
it and retries in place. cpu_exec_loop() then chains its last_tb, now
freed, into the new TB. When that TB is invalidated, tb_jmp_unlink()
follows the stale entry and qemu crashes inside its SIGSEGV handler.

Always queue the flush and leave through cpu_loop_exit(), as before
commit ebf7a5d294. This also brings back the cleanup in
cpu_loop_exit() and cpu_exec_longjmp_cleanup() that the retry skipped.

Since commit 25e5c6a320 ("accel/tcg: Allow cross-page goto_tb
chaining in user-only builds"), user-only builds hit this easily,
e.g. qemu-sparc64 -tb-size 1 on a program writing next to its PLT.

Cc: qemu-stable@nongnu.org
Fixes: ebf7a5d294 ("accel/tcg: Improve buffer overflow in tb_gen_code")
Suggested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Stian Halseth <stian@itx.no>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2026-10-30 07:06:15 -05:00
..
2026-06-26 00:48:22 +02:00
2026-02-27 08:18:31 +01:00