Re: [Qemu-devel] [RFC 0/6] memory: make dirty_memory[] accesses atomic

2015-03-24 Thread Stefan Hajnoczi
On Mon, Mar 23, 2015 at 12:09:55PM +0100, Paolo Bonzini wrote: > > > On 28/11/2014 13:44, Stefan Hajnoczi wrote: > > This is an example of what I mean. > > > > I'm not going to work on making TCG thread-safe in this series, and > > there is no dangerous race condition in this code if we leave it

Re: [Qemu-devel] [RFC 0/6] memory: make dirty_memory[] accesses atomic

2015-03-23 Thread Paolo Bonzini
On 28/11/2014 13:44, Stefan Hajnoczi wrote: > This is an example of what I mean. > > I'm not going to work on making TCG thread-safe in this series, and > there is no dangerous race condition in this code if we leave it as is. > > But I'm not 100% sure of all cases, so I'll audit them again. I

Re: [Qemu-devel] [RFC 0/6] memory: make dirty_memory[] accesses atomic

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 27, 2014 at 01:21:54PM +, Peter Maydell wrote: > On 27 November 2014 at 12:29, Stefan Hajnoczi wrote: > > 1. Convert all cpu_physical_memory_*_dirty() callers to use the API > > atomically. > >There are TCG callers who things along the lines of: > > > > if (!cpu_physical_

Re: [Qemu-devel] [RFC 0/6] memory: make dirty_memory[] accesses atomic

2014-11-27 Thread Peter Maydell
On 27 November 2014 at 12:29, Stefan Hajnoczi wrote: > 1. Convert all cpu_physical_memory_*_dirty() callers to use the API > atomically. >There are TCG callers who things along the lines of: > > if (!cpu_physical_memory_get_dirty(addr)) { > cpu_physical_memory_set_dirty(addr);

[Qemu-devel] [RFC 0/6] memory: make dirty_memory[] accesses atomic

2014-11-27 Thread Stefan Hajnoczi
The dirty_memory[] bitmap is used for live migration, TCG self-modifying code detection, and VGA emulation. Up until now the bitmap was always accessed under the QEMU global mutex. This series makes all dirty_memory[] accesses atomic to prepare the way for threads writing to guest memory without