Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-26 Thread Paolo Bonzini
;, qemu-devel@nongnu.org >>> Cc: "serge fdrv" <serge.f...@gmail.com>, c...@braap.org, "alex >>> bennee" <alex.ben...@linaro.org>, "sergey fedorov" >>> <sergey.fedo...@linaro.org> >>> Sent: Friday, Sep

Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-24 Thread Richard Henderson
"alex bennee" <alex.ben...@linaro.org>, "sergey fedorov" <sergey.fedo...@linaro.org> Sent: Friday, September 23, 2016 8:06:09 PM Subject: Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe On 09/23/2016 12:31 AM, Paolo Bonzin

Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-24 Thread Paolo Bonzini
lt;alex.ben...@linaro.org>, "sergey fedorov" > <sergey.fedo...@linaro.org> > Sent: Friday, September 23, 2016 8:06:09 PM > Subject: Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe > > On 09/23/2016 12:31 AM, Paolo Bonzini wrote: > > +

Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-23 Thread Richard Henderson
On 09/23/2016 12:31 AM, Paolo Bonzini wrote: +unsigned tb_flush_req = (unsigned) (uintptr_t) data; Extra cast? -tcg_ctx.tb_ctx.tb_flush_count++; +atomic_inc(_ctx.tb_ctx.tb_flush_count); Since this is the only place this value is incremented, and we're under a lock, it should

[Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-23 Thread Paolo Bonzini
From: Sergey Fedorov Use async_safe_run_on_cpu() to make tb_flush() thread safe. This is possible now that code generation does not happen in the middle of execution. It can happen that multiple threads schedule a safe work to flush the translation buffer. To keep

Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-21 Thread Paolo Bonzini
On 21/09/2016 19:37, Emilio G. Cota wrote: > On Wed, Sep 21, 2016 at 18:19:26 +0200, Paolo Bonzini wrote: >> >> >> On 21/09/2016 18:05, Emilio G. Cota wrote: > +tb_lock(); > + > +/* If it's already been done on request of another CPU, > + * just retry. > + */

Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-21 Thread Emilio G. Cota
On Wed, Sep 21, 2016 at 18:19:26 +0200, Paolo Bonzini wrote: > > > On 21/09/2016 18:05, Emilio G. Cota wrote: > >> > +tb_lock(); > >> > + > >> > +/* If it's already been done on request of another CPU, > >> > + * just retry. > >> > + */ > >> > +if

Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-21 Thread Paolo Bonzini
On 21/09/2016 18:05, Emilio G. Cota wrote: >> > +tb_lock(); >> > + >> > +/* If it's already been done on request of another CPU, >> > + * just retry. >> > + */ >> > +if (atomic_read(_ctx.tb_ctx.tb_flush_count) != tb_flush_req) { >> > +goto done; > tb_flush_count is

Re: [Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-21 Thread Emilio G. Cota
On Mon, Sep 19, 2016 at 14:50:58 +0200, Paolo Bonzini wrote: > From: Sergey Fedorov > > Use async_safe_run_on_cpu() to make tb_flush() thread safe. This is > possible now that code generation does not happen in the middle of > execution. > > It can happen that multiple

[Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-19 Thread Paolo Bonzini
From: Sergey Fedorov Use async_safe_run_on_cpu() to make tb_flush() thread safe. This is possible now that code generation does not happen in the middle of execution. It can happen that multiple threads schedule a safe work to flush the translation buffer. To keep

[Qemu-devel] [PATCH 15/16] tcg: Make tb_flush() thread safe

2016-09-12 Thread Paolo Bonzini
From: Sergey Fedorov Use async_safe_run_on_cpu() to make tb_flush() thread safe. This is possible now that code generation does not happen in the middle of execution. It can happen that multiple threads schedule a safe work to flush the translation buffer. To keep