]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/tcg: Unregister the RCU before exiting RR thread
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 1 Jul 2025 14:04:35 +0000 (16:04 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 4 Jul 2025 12:43:45 +0000 (14:43 +0200)
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>

accel/tcg/tcg-accel-ops-rr.c

index 6eec5c9eee913f24a8afc6cc0a948eade3b7e6a8..a578698d071edd05248946bc5ce98163a9ffc184 100644 (file)
@@ -302,6 +302,8 @@ static void *rr_cpu_thread_fn(void *arg)
         rr_deal_with_unplugged_cpus();
     }
 
+    rcu_unregister_thread();
+
     g_assert_not_reached();
 }