On 11/08/2016 17:24, Alex Bennée wrote:
> + if (cpu->created && !qemu_cpu_is_self(cpu)) {
Is the cpu->created necessary? It may introduce some potential races
and doesn't really add much.
> + if (atomic_bool_cmpxchg(&cpu->pending_tlb_flush, false, true)) {
This is slightly cheaper:
if (!atomic_xchg(&cpu->pending_tlb_flush, true)) {
Paolo
> + async_run_on_cpu(cpu, tlb_flush_global_async_work,
> + GINT_TO_POINTER(flush_global));
> + }
> + } else {
> + tlb_flush_nocheck(cpu, flush_global);
> + }
