From c006147122dede4440c027142ce3025f64e199c0 Mon Sep 17 00:00:00 2001 From: Alex Bennée Date: Tue, 27 Feb 2024 14:43:28 +0000 Subject: plugins: create CPUPluginState and migrate plugin_mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As we expand the per-vCPU data for plugins we don't want to pollute CPUState. For now this just moves the plugin_mask (renamed to event_mask) as the memory callbacks are accessed directly by TCG generated code. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20240227144335.1196131-23-alex.bennee@linaro.org> --- hw/core/cpu-common.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/core/cpu-common.c') diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 68786360ea..0108fb11db 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -194,10 +194,12 @@ 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) { @@ -223,9 +225,12 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp) } /* Plugin initialization must wait until the cpu start executing code */ +#ifdef CONFIG_PLUGIN if (tcg_enabled()) { + cpu->plugin_state = qemu_plugin_create_vcpu_state(); async_run_on_cpu(cpu, qemu_plugin_vcpu_init__async, RUN_ON_CPU_NULL); } +#endif /* NOTE: latest generic point where the cpu is fully realized */ } -- cgit 1.4.1