Re: [Qemu-devel] [RFC v1 03/11] tcg: comment on which functions have to be called with tb_lock held

2016-03-21 Thread Paolo Bonzini
On 21/03/2016 22:50, Emilio G. Cota wrote: > The problem with this approach is that the "point TCG to second buffer" > is not just a question of pointing code_gen_buffer to a new address; > we'd have to create a new tcg_ctx struct, since tcg_ctx has quite a few > elements that are dependent on

Re: [Qemu-devel] [RFC v1 03/11] tcg: comment on which functions have to be called with tb_lock held

2016-03-21 Thread Emilio G. Cota
On Fri, Mar 18, 2016 at 17:59:46 +0100, Paolo Bonzini wrote: > On 18/03/2016 17:18, Alex Bennée wrote: > > + > > +/* Protected by tb_lock. */ > > Only writes are protected by tb_lock. Read happen outside the lock. > > Reads are not quite thread safe yet, because of tb_flush. In order to >

[Qemu-devel] [RFC v1 03/11] tcg: comment on which functions have to be called with tb_lock held

2016-03-19 Thread Alex Bennée
From: Paolo Bonzini softmmu requires more functions to be thread-safe, because translation blocks can be invalidated from e.g. notdirty callbacks. Probably the same holds for user-mode emulation, it's just that no one has ever tried to produce a coherent locking there.

Re: [Qemu-devel] [RFC v1 03/11] tcg: comment on which functions have to be called with tb_lock held

2016-03-18 Thread Paolo Bonzini
On 18/03/2016 17:18, Alex Bennée wrote: > + > +/* Protected by tb_lock. */ Only writes are protected by tb_lock. Read happen outside the lock. Reads are not quite thread safe yet, because of tb_flush. In order to fix that, there's either the async_safe_run() mechanism from Fred or