(I forgot to CC: the list) On Wed, Jan 23, 2013 at 2:16 PM, Emmanuel Blot <eblot...@gmail.com> wrote: >> Today you cannot use cpu_physical_memory_*() from a thread without >> holding the QEMU global mutex. > Ok. I have not looked at this part, which API handles this global mutex? > >> Have you tried taking the mutex temporarily just for map/unmap and then >> doing the copy or I/O outside the mutex? > Not yet. I've written a prototype (which works, with a single device > thread for the datastream pipe + the existing QEMU threads) when I > realized that the map/unmap may not be protected. For now I have not > observed memory corruption, but I got lucky :-) > >> qemu_bh_schedule() should be thread-safe (but please double-check). > Ok. > > Thanks for your answers, > Manu