[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/40] accel/tcg: Move qemu_plugin_vcpu_init__async() to plugins/
From: |
Alex Bennée |
Subject: |
[PULL 29/40] accel/tcg: Move qemu_plugin_vcpu_init__async() to plugins/ |
Date: |
Fri, 5 Jul 2024 16:30:41 +0100 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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>
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index 8f6cb64da3..b19e1fdacf 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -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)
{
CPUState *cpu = CPU(dev);
@@ -274,7 +267,7 @@ static void cpu_common_initfn(Object *obj)
#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);
+ qemu_plugin_vcpu_init_hook(cpu);
}
#endif
}
diff --git a/plugins/core.c b/plugins/core.c
index a864275ae7..12c67b4b4e 100644
--- a/plugins/core.c
+++ b/plugins/core.c
@@ -241,7 +241,7 @@ static void plugin_grow_scoreboards__locked(CPUState *cpu)
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;
@@ -258,6 +258,12 @@ void qemu_plugin_vcpu_init_hook(CPUState *cpu)
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)
{
bool success;
--
2.39.2
- [PULL 17/40] tests/tcg/arm: Use -march and -mfpu for fcvt, (continued)
- [PULL 17/40] tests/tcg/arm: Use -march and -mfpu for fcvt, Alex Bennée, 2024/07/05
- [PULL 37/40] gdbstub: Pass CPU context to command handler, Alex Bennée, 2024/07/05
- [PULL 35/40] target/arm: Factor out code for setting MTE TCF0 field, Alex Bennée, 2024/07/05
- [PULL 40/40] tests/tcg/aarch64: Add MTE gdbstub tests, Alex Bennée, 2024/07/05
- [PULL 11/40] tests/tcg/aarch64: Do not use x constraint, Alex Bennée, 2024/07/05
- [PULL 14/40] tests/tcg/arm: Drop -N from LDFLAGS, Alex Bennée, 2024/07/05
- [PULL 16/40] tests/tcg/arm: Manually register allocate half-precision numbers, Alex Bennée, 2024/07/05
- [PULL 27/40] plugins: Ensure vCPU index is assigned in init/exit hooks, Alex Bennée, 2024/07/05
- [PULL 32/40] gdbstub: Add support for target-specific stubs, Alex Bennée, 2024/07/05
- [PULL 21/40] test/plugin: make insn plugin less noisy by default, Alex Bennée, 2024/07/05
- [PULL 29/40] accel/tcg: Move qemu_plugin_vcpu_init__async() to plugins/,
Alex Bennée <=
- [PULL 34/40] target/arm: Make some MTE helpers widely available, Alex Bennée, 2024/07/05
- [PULL 25/40] plugins/lockstep: mention the one-insn-per-tb option, Alex Bennée, 2024/07/05
- [PULL 24/40] plugins/lockstep: make mixed-mode safe, Alex Bennée, 2024/07/05
- [PULL 23/40] plugins/lockstep: preserve sock_path, Alex Bennée, 2024/07/05
- [PULL 36/40] gdbstub: Make hex conversion function non-internal, Alex Bennée, 2024/07/05
- [PULL 39/40] gdbstub: Add support for MTE in user mode, Alex Bennée, 2024/07/05
- [PULL 18/40] tests/tcg/arm: Use vmrs/vmsr instead of mcr/mrc, Alex Bennée, 2024/07/05
- [PULL 19/40] linux-user/main: Suppress out-of-range comparison warning for clang, Alex Bennée, 2024/07/05
- [PULL 28/40] plugins: Free CPUPluginState before destroying vCPU state, Alex Bennée, 2024/07/05