Re: [Qemu-devel] [RFC v4 25/28] cputlb: introduce tlb_flush_* async work.

2016-09-08 Thread Richard Henderson
On 08/11/2016 08:24 AM, Alex Bennée wrote: > + * Since QEMU doesn't currently implement a global/not-global flag > + * for tlb entries, at the moment tlb_flush() will also flush all > + * tlb entries in the flush_global == false case. This is OK because > + * CPU architectures generally permit an i

Re: [Qemu-devel] [RFC v4 25/28] cputlb: introduce tlb_flush_* async work.

2016-09-07 Thread Paolo Bonzini
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:

[Qemu-devel] [RFC v4 25/28] cputlb: introduce tlb_flush_* async work.

2016-08-11 Thread Alex Bennée
From: KONRAD Frederic Some architectures allow to flush the tlb of other VCPUs. This is not a problem when we have only one thread for all VCPUs but it definitely needs to be an asynchronous work when we are in true multithreaded work. This patch doesn't do anything to protect other cputlb funct