[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 34/35] cpu-exec: assert that plugin_mem_cbs is NULL after executio
From: |
Alex Bennée |
Subject: |
[PULL 34/35] cpu-exec: assert that plugin_mem_cbs is NULL after execution |
Date: |
Thu, 26 Jan 2023 11:22:49 +0000 |
From: Emilio Cota <cota@braap.org>
Fixes: #1381
Signed-off-by: Emilio Cota <cota@braap.org>
Message-Id: <20230108165107.62488-1-cota@braap.org>
[AJB: manually applied follow-up fix]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230124180127.1881110-35-alex.bennee@linaro.org>
diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h
index e0ebedef84..fb338ba576 100644
--- a/include/qemu/plugin.h
+++ b/include/qemu/plugin.h
@@ -59,6 +59,8 @@ get_plugin_meminfo_rw(qemu_plugin_meminfo_t i)
#ifdef CONFIG_PLUGIN
extern QemuOptsList qemu_plugin_opts;
+#define QEMU_PLUGIN_ASSERT(cond) g_assert(cond)
+
static inline void qemu_plugin_add_opts(void)
{
qemu_add_opts(&qemu_plugin_opts);
@@ -250,6 +252,8 @@ void qemu_plugin_user_postfork(bool is_child);
#else /* !CONFIG_PLUGIN */
+#define QEMU_PLUGIN_ASSERT(cond)
+
static inline void qemu_plugin_add_opts(void)
{ }
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 25ec73ef9a..9c857eeb07 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -504,6 +504,7 @@ static void cpu_exec_exit(CPUState *cpu)
if (cc->tcg_ops->cpu_exec_exit) {
cc->tcg_ops->cpu_exec_exit(cpu);
}
+ QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs == NULL);
}
void cpu_exec_step_atomic(CPUState *cpu)
@@ -980,6 +981,7 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc)
cpu_loop_exec_tb(cpu, tb, pc, &last_tb, &tb_exit);
+ QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs == NULL);
/* Try to align the host and virtual clocks
if the guest is in advance */
align_clocks(sc, cpu);
--
2.34.1
- [PULL 14/35] tests/docker: drop debian-tricore-cross's partial status, (continued)
- [PULL 14/35] tests/docker: drop debian-tricore-cross's partial status, Alex Bennée, 2023/01/26
- [PULL 28/35] thread: de-const qemu_spin_destroy, Alex Bennée, 2023/01/26
- [PULL 13/35] tests/docker: Install flex in debian-tricore-cross, Alex Bennée, 2023/01/26
- [PULL 15/35] tests/tcg: skip the vma-pthread test on CI, Alex Bennée, 2023/01/26
- [PULL 20/35] docs: add a new section to outline emulation support, Alex Bennée, 2023/01/26
- [PULL 29/35] util/qht: use striped locks under TSAN, Alex Bennée, 2023/01/26
- [PULL 09/35] gitlab: add lsan suppression file to workaround tcmalloc issues, Alex Bennée, 2023/01/26
- [PULL 16/35] tests/tcg: Use SIGKILL for timeout, Alex Bennée, 2023/01/26
- [PULL 30/35] plugins: make qemu_plugin_user_exit's locking order consistent with fork_start's, Alex Bennée, 2023/01/26
- [PULL 26/35] cpu: free cpu->tb_jmp_cache with RCU, Alex Bennée, 2023/01/26
- [PULL 34/35] cpu-exec: assert that plugin_mem_cbs is NULL after execution,
Alex Bennée <=
- [PULL 32/35] translator: always pair plugin_gen_insn_{start, end} calls, Alex Bennée, 2023/01/26
- [PULL 31/35] plugins: fix optimization in plugin_gen_disable_mem_helpers, Alex Bennée, 2023/01/26
- [PULL 24/35] semihosting: add O_BINARY flag in host_open for NT compatibility, Alex Bennée, 2023/01/26
- [PULL 23/35] semihosting: Write back semihosting data before completion callback, Alex Bennée, 2023/01/26
- [PULL 19/35] docs: add hotlinks to about preface text, Alex Bennée, 2023/01/26
- [PULL 35/35] plugins: Iterate on cb_lists in qemu_plugin_user_exit, Alex Bennée, 2023/01/26
- [PULL 27/35] util/qht: add missing atomic_set(hashes[i]), Alex Bennée, 2023/01/26
- [PULL 21/35] semihosting: add semihosting section to the docs, Alex Bennée, 2023/01/26
- [PULL 33/35] tcg: exclude non-memory effecting helpers from instrumentation, Alex Bennée, 2023/01/26
- [PULL 22/35] docs: add an introduction to the system docs, Alex Bennée, 2023/01/26