aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-07-01 16:04:35 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-07-04 14:43:45 +0200
commitdd0b228552e4b1d3b680ff4e8033a110536fdc4c (patch)
treec4986c5ee24263841ce71cbaa0e90832d416402f
parent6bb8f2c51b28ce35c83ac4e53bbd85ef37d787c4 (diff)
downloadqemu-dd0b228552e4b1d3b680ff4e8033a110536fdc4c.zip
qemu-dd0b228552e4b1d3b680ff4e8033a110536fdc4c.tar.gz
qemu-dd0b228552e4b1d3b680ff4e8033a110536fdc4c.tar.bz2
accel/tcg: Unregister the RCU before exiting RR thread
Although unreachable, still unregister the RCU before exiting the thread, as documented in "qemu/rcu.h": /* * Important ! * * Each thread containing read-side critical sections must be registered * with rcu_register_thread() before calling rcu_read_lock(). * rcu_unregister_thread() should be called before the thread exits. */ Unregister the RCU to be on par with what is done for other accelerators. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Acked-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Message-Id: <20250702185332.43650-66-philmd@linaro.org>
-rw-r--r--accel/tcg/tcg-accel-ops-rr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c
index 6eec5c9..a578698 100644
--- a/accel/tcg/tcg-accel-ops-rr.c
+++ b/accel/tcg/tcg-accel-ops-rr.c
@@ -302,6 +302,8 @@ static void *rr_cpu_thread_fn(void *arg)
rr_deal_with_unplugged_cpus();
}
+ rcu_unregister_thread();
+
g_assert_not_reached();
}