diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2024-02-27 14:43:28 +0000 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2024-02-28 09:11:42 +0000 |
commit | c006147122dede4440c027142ce3025f64e199c0 (patch) | |
tree | e250bdbb06eca51818dd140bf3a99505b0a90fbd /hw | |
parent | c3d0b46645d4b95b1fa24f4911738cb59d26173e (diff) |
plugins: create CPUPluginState and migrate plugin_mask
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 <pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240227144335.1196131-23-alex.bennee@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/core/cpu-common.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 */ } |