@@ -57,19 +57,12 @@ void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc)
cpu_loop_exit_restore(cpu, pc);
}
-#ifdef CONFIG_PLUGIN
-static void qemu_plugin_vcpu_init__async(CPUState *cpu, run_on_cpu_data unused)
-{
- qemu_plugin_vcpu_init_hook(cpu);
-}
-#endif
-
bool tcg_exec_realize_assigned(CPUState *cpu, Error **errp)
{
#ifdef CONFIG_PLUGIN
cpu->plugin_state = qemu_plugin_create_vcpu_state();
- /* Plugin initialization must wait until the cpu start executing code */
- async_run_on_cpu(cpu, qemu_plugin_vcpu_init__async, RUN_ON_CPU_NULL);
+
+ qemu_plugin_vcpu_init_hook(cpu);
#endif
return true;
@@ -245,7 +245,7 @@ static void plugin_grow_scoreboards__locked(CPUState *cpu)
end_exclusive();
}
-void qemu_plugin_vcpu_init_hook(CPUState *cpu)
+static void qemu_plugin_vcpu_init__async(CPUState *cpu, run_on_cpu_data unused)
{
bool success;
@@ -261,6 +261,12 @@ void qemu_plugin_vcpu_init_hook(CPUState *cpu)
plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_INIT);
}
+void qemu_plugin_vcpu_init_hook(CPUState *cpu)
+{
+ /* Plugin initialization must wait until the cpu start executing code */
+ async_run_on_cpu(cpu, qemu_plugin_vcpu_init__async, RUN_ON_CPU_NULL);
+}
+
void qemu_plugin_vcpu_exit_hook(CPUState *cpu)
{
bool success;
Calling qemu_plugin_vcpu_init__async() on the vCPU thread is a detail of plugins, not relevant to TCG vCPU management. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- accel/tcg/cpu-exec-common.c | 11 ++--------- plugins/core.c | 8 +++++++- 2 files changed, 9 insertions(+), 10 deletions(-)