[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 33/73] translate-all: notify plugin code of tb_flush
From: |
Alex Bennée |
Subject: |
[PULL v2 33/73] translate-all: notify plugin code of tb_flush |
Date: |
Fri, 25 Oct 2019 07:36:33 +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>
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 0a08fcda3e8..6d1b0ecd69f 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
- [PULL v2 37/73] plugin-gen: add plugin_insn_append, (continued)
- [PULL v2 37/73] plugin-gen: add plugin_insn_append, Alex Bennée, 2019/10/25
- [PULL v2 27/73] cputlb: introduce get_page_addr_code_hostp, Alex Bennée, 2019/10/25
- [PULL v2 70/73] .travis.yml: add --enable-plugins tests, Alex Bennée, 2019/10/25
- [PULL v2 63/73] tests/tcg: drop test-i386-fprem from TESTS when not SLOW, Alex Bennée, 2019/10/25
- [PULL v2 31/73] tcg: let plugins instrument virtual memory accesses, Alex Bennée, 2019/10/25
- [PULL v2 43/73] target/i386: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 42/73] target/sh4: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 44/73] target/hppa: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 64/73] tests/tcg: enable plugin testing, Alex Bennée, 2019/10/25
- [PULL v2 14/73] travis.yml: --enable-debug-tcg to check-tcg, Alex Bennée, 2019/10/25
- [PULL v2 33/73] translate-all: notify plugin code of tb_flush,
Alex Bennée <=
- [PULL v2 66/73] tests/plugin: add instruction execution breakdown, Alex Bennée, 2019/10/25
- [PULL v2 51/73] translator: inject instrumentation from plugins, Alex Bennée, 2019/10/25
- [PULL v2 61/73] tests/tcg: set QEMU_OPTS for all cris runs, Alex Bennée, 2019/10/25
- [PULL v2 39/73] translator: add translator_ld{ub,sw,uw,l,q}, Alex Bennée, 2019/10/25
- [PULL v2 68/73] accel/stubs: reduce headers from tcg-stub, Alex Bennée, 2019/10/25
- [PULL v2 47/73] target/riscv: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 16/73] tests/docker: update Travis image to a more current version, Alex Bennée, 2019/10/25
- [PULL v2 26/73] cputlb: document get_page_addr_code, Alex Bennée, 2019/10/25
- [PULL v2 23/73] plugin: add core code, Alex Bennée, 2019/10/25
- [PULL v2 73/73] travis.yml: enable linux-gcc-debug-tcg cache, Alex Bennée, 2019/10/25