Re: [Qemu-devel] [PATCH v2 3/8] dataplane: add host memory mapping code

2012-11-26 Thread Don Koch
On 11/21/2012 02:59 AM, Stefan Hajnoczi wrote: > On Tue, Nov 20, 2012 at 01:24:08PM -0500, Don Koch wrote: >> On 11/20/2012 07:31 AM, Stefan Hajnoczi wrote: >>> +void hostmem_init(Hostmem *hostmem) >>> +{ >>> +memset(hostmem, 0, sizeof(*hostmem)); >>> + >>> +hostmem->listener = (MemoryListe

Re: [Qemu-devel] [PATCH v2 3/8] dataplane: add host memory mapping code

2012-11-21 Thread Stefan Hajnoczi
On Tue, Nov 20, 2012 at 01:24:08PM -0500, Don Koch wrote: > On 11/20/2012 07:31 AM, Stefan Hajnoczi wrote: > > +void hostmem_init(Hostmem *hostmem) > > +{ > > +memset(hostmem, 0, sizeof(*hostmem)); > > + > > +hostmem->listener = (MemoryListener){ > > +.begin = hostmem_listener_nop,

Re: [Qemu-devel] [PATCH v2 3/8] dataplane: add host memory mapping code

2012-11-20 Thread Don Koch
On 11/20/2012 07:31 AM, Stefan Hajnoczi wrote: > The data plane thread needs to map guest physical addresses to host > pointers. Normally this is done with cpu_physical_memory_map() but the > function assumes the global mutex is held. The data plane thread does > not touch the global mutex and th

[Qemu-devel] [PATCH v2 3/8] dataplane: add host memory mapping code

2012-11-20 Thread Stefan Hajnoczi
The data plane thread needs to map guest physical addresses to host pointers. Normally this is done with cpu_physical_memory_map() but the function assumes the global mutex is held. The data plane thread does not touch the global mutex and therefore needs a thread-safe memory mapping mechanism.