[RFC PATCH RESEND 11/42] accel/split: Register MTTCG

Philippe Mathieu-Daudé posted 42 patches 7 months, 3 weeks ago
[RFC PATCH RESEND 11/42] accel/split: Register MTTCG
Posted by Philippe Mathieu-Daudé 7 months, 3 weeks ago
FIXME: Use sw-hooks?

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/split/split-accel-ops.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/accel/split/split-accel-ops.c b/accel/split/split-accel-ops.c
index efef0d60fde..2c7945b6331 100644
--- a/accel/split/split-accel-ops.c
+++ b/accel/split/split-accel-ops.c
@@ -14,9 +14,12 @@
 #include "system/cpus.h"
 #include "split-accel.h"
 
+#include "accel/tcg/tcg-accel-ops-mttcg.h"
+
 static void *split_cpu_thread_routine(void *arg)
 {
     AccelState *as = current_accel();
+    void *sw_force_rcu;
     CPUState *cpu = arg;
     AccelCPUState *acs;
     int r;
@@ -24,6 +27,7 @@ static void *split_cpu_thread_routine(void *arg)
     /* TODO: check accel allowed */
 
     rcu_register_thread();
+    sw_force_rcu = mttcg_vcpu_register(cpu);
 
     bql_lock();
     qemu_thread_get_self(cpu->thread);
@@ -84,6 +88,7 @@ static void *split_cpu_thread_routine(void *arg)
     cpu_thread_signal_destroyed(cpu);
     bql_unlock();
 
+    mttcg_vcpu_unregister(cpu, sw_force_rcu);
     rcu_unregister_thread();
 
     return NULL;
-- 
2.49.0


Re: [RFC PATCH RESEND 11/42] accel/split: Register MTTCG
Posted by Richard Henderson 7 months, 2 weeks ago
On 6/20/25 10:27, Philippe Mathieu-Daudé wrote:
> FIXME: Use sw-hooks?

I'm OK with hard-coding tcg for sw, especially for now.

> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/split/split-accel-ops.c | 5 +++++
>   1 file changed, 5 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~