qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v2 04/38] translate-all: use cpu_in_exclusive_work


From: Alex Bennée
Subject: Re: [Qemu-devel] [RFC v2 04/38] translate-all: use cpu_in_exclusive_work_context() in tb_flush
Date: Thu, 24 Jan 2019 14:44:42 +0000
User-agent: mu4e 1.1.0; emacs 26.1.91

Emilio G. Cota <address@hidden> writes:

> 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>

Reviewed-by: Alex Bennée <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));
> +        }
>      }
>  }


--
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]