[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 17/54] translate-all: notify plugin code of tb_flush
From: |
Alex Bennée |
Subject: |
[PATCH v6 17/54] translate-all: notify plugin code of tb_flush |
Date: |
Thu, 17 Oct 2019 14:15:38 +0100 |
From: "Emilio G. Cota" <address@hidden>
Plugins might allocate per-TB data that then they get passed each
time a TB is executed (via the *userdata pointer).
Notify plugin code every time a code cache flush occurs, so
that plugins can then reclaim the memory of the per-TB data.
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
---
accel/tcg/translate-all.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 0a08fcda3e..6d1b0ecd69 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1231,6 +1231,8 @@ static gboolean tb_host_size_iter(gpointer key, gpointer
value, gpointer data)
/* flush all the translation blocks */
static void do_tb_flush(CPUState *cpu, run_on_cpu_data tb_flush_count)
{
+ bool did_flush = false;
+
mmap_lock();
/* If it is already been done on request of another CPU,
* just retry.
@@ -1238,6 +1240,7 @@ static void do_tb_flush(CPUState *cpu, run_on_cpu_data
tb_flush_count)
if (tb_ctx.tb_flush_count != tb_flush_count.host_int) {
goto done;
}
+ did_flush = true;
if (DEBUG_TB_FLUSH_GATE) {
size_t nb_tbs = tcg_nb_tbs();
@@ -1262,6 +1265,9 @@ static void do_tb_flush(CPUState *cpu, run_on_cpu_data
tb_flush_count)
done:
mmap_unlock();
+ if (did_flush) {
+ qemu_plugin_flush_cb();
+ }
}
void tb_flush(CPUState *cpu)
--
2.20.1
- [PATCH v6 32/54] target/xtensa: fetch code with translator_ld, (continued)
- [PATCH v6 32/54] target/xtensa: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 30/54] target/riscv: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 40/54] vl: support -plugin option, Alex Bennée, 2019/10/17
- [PATCH v6 51/54] accel/stubs: reduce headers from tcg-stub, Alex Bennée, 2019/10/17
- [PATCH v6 52/54] include/exec: wrap cpu_ldst.h in CONFIG_TCG, Alex Bennée, 2019/10/17
- [PATCH v6 31/54] target/sparc: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 53/54] .travis.yml: add --enable-plugins tests, Alex Bennée, 2019/10/17
- [PATCH v6 41/54] linux-user: support -plugin option, Alex Bennée, 2019/10/17
- [PATCH v6 43/54] tests/tcg/Makefile.target: fix path to config-host.mak, Alex Bennée, 2019/10/17
- [PATCH v6 16/54] plugins: implement helpers for resolving hwaddr, Alex Bennée, 2019/10/17
- [PATCH v6 17/54] translate-all: notify plugin code of tb_flush,
Alex Bennée <=
- [PATCH v6 28/54] target/m68k: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 27/54] target/hppa: fetch code with translator_ld, Alex Bennée, 2019/10/17
- [PATCH v6 38/54] plugin: add qemu_plugin_insn_disas helper, Alex Bennée, 2019/10/17
- [PATCH v6 45/54] tests/tcg: move "virtual" tests to EXTRA_TESTS, Alex Bennée, 2019/10/17
- [PATCH v6 35/54] configure: add --enable-plugins, Alex Bennée, 2019/10/17
- [PATCH v6 49/54] tests/plugin: add instruction execution breakdown, Alex Bennée, 2019/10/17
- Re: [PATCH for 4.2 v6 00/54] Support for TCG plugins, no-reply, 2019/10/17
- Re: [PATCH for 4.2 v6 00/54] Support for TCG plugins, no-reply, 2019/10/18
- Re: [PATCH for 4.2 v6 00/54] Support for TCG plugins, no-reply, 2019/10/18
- Re: [PATCH for 4.2 v6 00/54] Support for TCG plugins, Alex Bennée, 2019/10/22