On 10/08/2015 17:27, fred.kon...@greensocs.com wrote:
> +
> +void tb_flush_safe(CPUState *cpu)
> +{
> +#if 0 /* !MTTCG */
> +    tb_flush(cpu);
> +#else
> +    async_run_safe_work_on_cpu(cpu, tb_flush_work, cpu);
> +#endif /* MTTCG */
> +}
> +

I think this can use first_cpu unconditionally; tb_flush only uses its
argument for an error message.

In fact, I think that by definition async_run_safe_work_on_cpu can use
any CPU for its work; it locks out everyone else, so it does not matter
which thread you're on.  So async_run_safe_work_on_cpu could drop the
@cpu argument (becoming async_run_safe_cpu_work) and use first_cpu
unconditionally.

Paolo

Reply via email to