diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-04-29 23:12:39 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-05-06 11:24:14 +0200 |
commit | 57d828429e5f1d849bf808387d947d7a62f0322e (patch) | |
tree | f1b0ea59c24cc7f579476d23fff4a14d3b9f9ada | |
parent | b3e7bdeb78825b2aa050e2db7f122534a49d85e4 (diff) |
accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG plugins
qemu_plugin_vcpu_exit_hook() is specific to TCG plugins,
so must be restricted to it in cpu_common_unrealizefn(),
similarly to how qemu_plugin_create_vcpu_state() is
restricted in the cpu_common_realizefn() counterpart.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240429213050.55177-2-philmd@linaro.org>
-rw-r--r-- | hw/core/cpu-common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index a72d48d9e1..0f0a247f56 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -30,7 +30,9 @@ #include "hw/boards.h" #include "hw/qdev-properties.h" #include "trace.h" +#ifdef CONFIG_PLUGIN #include "qemu/plugin.h" +#endif CPUState *cpu_by_arch_id(int64_t id) { @@ -236,9 +238,11 @@ static void cpu_common_unrealizefn(DeviceState *dev) CPUState *cpu = CPU(dev); /* Call the plugin hook before clearing the cpu is fully unrealized */ +#ifdef CONFIG_PLUGIN if (tcg_enabled()) { qemu_plugin_vcpu_exit_hook(cpu); } +#endif /* NOTE: latest generic point before the cpu is fully unrealized */ cpu_exec_unrealizefn(cpu); |