accel/tcg: Move qemu_plugin_vcpu_init__async() to plugins/
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> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20240606124010.2460-4-philmd@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240705084047.857176-30-alex.bennee@linaro.org>
This commit is contained in:
		
							parent
							
								
									853c685e8c
								
							
						
					
					
						commit
						0f3974b64c
					
				@ -192,13 +192,6 @@ static void cpu_common_parse_features(const char *typename, char *features,
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CONFIG_PLUGIN
 | 
					 | 
				
			||||||
static void qemu_plugin_vcpu_init__async(CPUState *cpu, run_on_cpu_data unused)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    qemu_plugin_vcpu_init_hook(cpu);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void cpu_common_realizefn(DeviceState *dev, Error **errp)
 | 
					static void cpu_common_realizefn(DeviceState *dev, Error **errp)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    CPUState *cpu = CPU(dev);
 | 
					    CPUState *cpu = CPU(dev);
 | 
				
			||||||
@ -274,7 +267,7 @@ static void cpu_common_initfn(Object *obj)
 | 
				
			|||||||
#ifdef CONFIG_PLUGIN
 | 
					#ifdef CONFIG_PLUGIN
 | 
				
			||||||
    if (tcg_enabled()) {
 | 
					    if (tcg_enabled()) {
 | 
				
			||||||
        cpu->plugin_state = qemu_plugin_create_vcpu_state();
 | 
					        cpu->plugin_state = qemu_plugin_create_vcpu_state();
 | 
				
			||||||
        async_run_on_cpu(cpu, qemu_plugin_vcpu_init__async, RUN_ON_CPU_NULL);
 | 
					        qemu_plugin_vcpu_init_hook(cpu);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -241,7 +241,7 @@ static void plugin_grow_scoreboards__locked(CPUState *cpu)
 | 
				
			|||||||
    end_exclusive();
 | 
					    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;
 | 
					    bool success;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -258,6 +258,12 @@ void qemu_plugin_vcpu_init_hook(CPUState *cpu)
 | 
				
			|||||||
    plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_INIT);
 | 
					    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)
 | 
					void qemu_plugin_vcpu_exit_hook(CPUState *cpu)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    bool success;
 | 
					    bool success;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user