[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 04/55] translate-all: use cpu_in_exclusive_work_context() in t
From: |
Alex Bennée |
Subject: |
[PATCH v5 04/55] translate-all: use cpu_in_exclusive_work_context() in tb_flush |
Date: |
Mon, 14 Oct 2019 11:48:57 +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>
---
accel/tcg/translate-all.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 66d4bc4341..0a08fcda3e 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
- [PATCH for 4.2 v5 00/55] Support for TCG plugins, Alex Bennée, 2019/10/14
- [PATCH v5 01/55] trace: expand mem_info:size_shift to 4 bits, Alex Bennée, 2019/10/14
- [PATCH v5 04/55] translate-all: use cpu_in_exclusive_work_context() in tb_flush,
Alex Bennée <=
- [PATCH v5 05/55] docs/devel: add plugins.rst design document, Alex Bennée, 2019/10/14
- [PATCH v5 03/55] cpu: introduce cpu_in_exclusive_context(), Alex Bennée, 2019/10/14
- [PATCH v5 06/55] configure: add --enable-plugins (MOVE TO END), Alex Bennée, 2019/10/14
- [PATCH v5 02/55] trace: add mmu_index to mem_info, Alex Bennée, 2019/10/14
- [PATCH v5 09/55] plugin: add implementation of the api, Alex Bennée, 2019/10/14
- [PATCH v5 10/55] queue: add QTAILQ_REMOVE_SEVERAL, Alex Bennée, 2019/10/14
- [PATCH v5 07/55] plugin: add user-facing API, Alex Bennée, 2019/10/14
- [PATCH v5 11/55] cputlb: document get_page_addr_code, Alex Bennée, 2019/10/14