Re: [Qemu-devel] [RFC PATCH V7 16/19] translate-all: introduces tb_flush_safe.

2015-08-12 Thread Paolo Bonzini
On 12/08/2015 16:11, Frederic Konrad wrote: >> You could also allocate a new code buffer and free the old one with >> call_rcu. This should simplify things a lot. > > Depending the size of the code buffer this might be a good idea. :). 32 megabytes. Paolo

Re: [Qemu-devel] [RFC PATCH V7 16/19] translate-all: introduces tb_flush_safe.

2015-08-12 Thread Frederic Konrad
On 12/08/2015 16:09, Paolo Bonzini wrote: On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: From: KONRAD Frederic tb_flush is not thread safe we definitely need to exit VCPUs to do that. This introduces tb_flush_safe which just creates an async safe work which will do a tb_flush later. S

Re: [Qemu-devel] [RFC PATCH V7 16/19] translate-all: introduces tb_flush_safe.

2015-08-12 Thread Paolo Bonzini
On 10/08/2015 17:27, fred.kon...@greensocs.com wrote: > From: KONRAD Frederic > > tb_flush is not thread safe we definitely need to exit VCPUs to do that. > This introduces tb_flush_safe which just creates an async safe work which will > do a tb_flush later. > > Signed-off-by: KONRAD Frederic

Re: [Qemu-devel] [RFC PATCH V7 16/19] translate-all: introduces tb_flush_safe.

2015-08-10 Thread Paolo Bonzini
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_f

[Qemu-devel] [RFC PATCH V7 16/19] translate-all: introduces tb_flush_safe.

2015-08-10 Thread fred . konrad
From: KONRAD Frederic tb_flush is not thread safe we definitely need to exit VCPUs to do that. This introduces tb_flush_safe which just creates an async safe work which will do a tb_flush later. Signed-off-by: KONRAD Frederic --- include/exec/exec-all.h | 1 + translate-all.c | 15 +++