On 4/29/24 14:30, Philippe Mathieu-Daudé wrote:
@plugin_state is specific to TCG accelerator, move it to
its AccelCPUState.
Suggested-by: Richard Henderson <richard.hender...@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
TODO: check dubious include of "accel/tcg/vcpu-state.h" in
hw/core/cpu-common.c.
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index f2826d0409..0e5ebbe050 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -31,6 +31,7 @@
#include "hw/qdev-properties.h"
#include "trace.h"
#ifdef CONFIG_PLUGIN
+#include "accel/tcg/vcpu-state.h" // ???
#include "qemu/plugin.h"
#endif
@@ -215,7 +216,7 @@ 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();
+ cpu->accel->plugin_state = qemu_plugin_create_vcpu_state();
How about
qemu_plugin_create_vcpu_state(cpu);
and move the store inside.
r~