[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 04/38] translate-all: use cpu_in_exclusive_work_con
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [RFC v2 04/38] translate-all: use cpu_in_exclusive_work_context() in tb_flush |
Date: |
Sun, 9 Dec 2018 14:37:15 -0500 |
tb_flush will be called by the plugin module from a safe
work environment. Prepare for that.
Suggested-by: Alex Bennée <address@hidden>
Signed-off-by: Emilio G. Cota <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 038d82fdb5..62d5e13185 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1269,8 +1269,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_work_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.17.1
- [Qemu-devel] [RFC v2 00/38] Plugin support, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 02/38] tcg/README: fix typo s/afterwise/afterwards/, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 03/38] cpu: introduce cpu_in_exclusive_work_context(), Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 01/38] trace: expand mem_info:size_shift to 3 bits, Emilio G. Cota, 2018/12/09
- [Qemu-devel] [RFC v2 04/38] translate-all: use cpu_in_exclusive_work_context() in tb_flush,
Emilio G. Cota <=
- [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Emilio G. Cota, 2018/12/09
- Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Aaron Lindsay, 2018/12/14
- Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Aaron Lindsay, 2018/12/14
- Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Emilio G. Cota, 2018/12/14
- Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Emilio G. Cota, 2018/12/14
- Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Aaron Lindsay, 2018/12/14
- Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Emilio G. Cota, 2018/12/14
- Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Aaron Lindsay, 2018/12/14
- Re: [Qemu-devel] [RFC v2 05/38] plugin: add user-facing API, Emilio G. Cota, 2018/12/14
[Qemu-devel] [RFC v2 11/38] tcg: add tcg_gen_st_ptr, Emilio G. Cota, 2018/12/09