]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
accel/tcg: Remove dead code from rr_cpu_thread_fn()
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 3 Sep 2024 16:22:16 +0000 (17:22 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 5 Sep 2024 12:12:36 +0000 (13:12 +0100)
The main loop in rr_cpu_thread_fn() can never terminate, so the
code at the end of the function to clean up the RCU subsystem is
dead code. Replace it with g_assert_not_reached().

(This is different from the other cpu_thread_fn for e.g. MTTCG or
for the KVM accelerator -- those can exit, if the vCPU they
are responsible for is unplugged. But the RR cpu thread fn
handles all CPUs in the system in a round-robin way, so even
if one is unplugged it keeps looping.)

Resolves: Coverity CID 1547782
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240815143634.3413679-1-peter.maydell@linaro.org

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

index c59c77da4b3394b2bdd6ba266602d868c32ad252..8ebadf8e9e1bcdcf729b72df84080b549ec2afcf 100644 (file)
@@ -302,9 +302,7 @@ static void *rr_cpu_thread_fn(void *arg)
         rr_deal_with_unplugged_cpus();
     }
 
-    rcu_remove_force_rcu_notifier(&force_rcu);
-    rcu_unregister_thread();
-    return NULL;
+    g_assert_not_reached();
 }
 
 void rr_start_vcpu_thread(CPUState *cpu)