[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 20/73] translate-all: use cpu_in_exclusive_work_context() in tb
From: |
Alex Bennée |
Subject: |
[PULL v2 20/73] translate-all: use cpu_in_exclusive_work_context() in tb_flush |
Date: |
Fri, 25 Oct 2019 07:36:20 +0100 |
From: "Emilio G. Cota" <address@hidden>
tb_flush will be called by the plugin module from a safe
work environment. Prepare for that.
Suggested-by: Alex Bennée <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Emilio G. Cota <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 66d4bc4341a..0a08fcda3e8 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1268,8 +1268,13 @@ void tb_flush(CPUState *cpu)
{
if (tcg_enabled()) {
unsigned tb_flush_count = atomic_mb_read(&tb_ctx.tb_flush_count);
- async_safe_run_on_cpu(cpu, do_tb_flush,
- RUN_ON_CPU_HOST_INT(tb_flush_count));
+
+ if (cpu_in_exclusive_context(cpu)) {
+ do_tb_flush(cpu, RUN_ON_CPU_HOST_INT(tb_flush_count));
+ } else {
+ async_safe_run_on_cpu(cpu, do_tb_flush,
+ RUN_ON_CPU_HOST_INT(tb_flush_count));
+ }
}
}
--
2.20.1
- [PULL v2 24/73] plugin: add implementation of the api, (continued)
- [PULL v2 24/73] plugin: add implementation of the api, Alex Bennée, 2019/10/25
- [PULL v2 55/73] plugin: add qemu_plugin_insn_disas helper, Alex Bennée, 2019/10/25
- [PULL v2 40/73] target/arm: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 52/73] configure: add --enable-plugins, Alex Bennée, 2019/10/25
- [PULL v2 28/73] tcg: add tcg_gen_st_ptr, Alex Bennée, 2019/10/25
- [PULL v2 71/73] scripts/checkpatch.pl: don't complain about (foo, /* empty */), Alex Bennée, 2019/10/25
- [PULL v2 36/73] cpu: hook plugin vcpu events, Alex Bennée, 2019/10/25
- [PULL v2 58/73] linux-user: support -plugin option, Alex Bennée, 2019/10/25
- [PULL v2 38/73] cputlb: ensure _cmmu helper functions follow the naming standard, Alex Bennée, 2019/10/25
- [PULL v2 18/73] trace: add mmu_index to mem_info, Alex Bennée, 2019/10/25
- [PULL v2 20/73] translate-all: use cpu_in_exclusive_work_context() in tb_flush,
Alex Bennée <=
- [PULL v2 30/73] atomic_template: add inline trace/plugin helpers, Alex Bennée, 2019/10/25
- [PULL v2 62/73] tests/tcg: move "virtual" tests to EXTRA_TESTS, Alex Bennée, 2019/10/25
- [PULL v2 49/73] target/xtensa: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 60/73] tests/tcg/Makefile.target: fix path to config-host.mak, Alex Bennée, 2019/10/25
- [PULL v2 50/73] target/openrisc: fetch code with translator_ld, Alex Bennée, 2019/10/25
- [PULL v2 57/73] vl: support -plugin option, Alex Bennée, 2019/10/25
- [PULL v2 69/73] include/exec: wrap cpu_ldst.h in CONFIG_TCG, Alex Bennée, 2019/10/25
- [PULL v2 17/73] trace: expand mem_info:size_shift to 4 bits, Alex Bennée, 2019/10/25
- [PULL v2 25/73] queue: add QTAILQ_REMOVE_SEVERAL, Alex Bennée, 2019/10/25
- [PULL v2 15/73] tests/docker: set HOST_ARCH if we don't have ARCH, Alex Bennée, 2019/10/25