Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-15 Thread Paolo Bonzini
Il 15/04/2013 03:42, liu ping fan ha scritto: It will work because readers will grab either the hostmem_lock or the BQL, while writers will grab both. A kind of local/global lock, but I'm No only hostmem_lock is used to protect readers from writers. While the writers are protected agaist

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-14 Thread liu ping fan
On Fri, Apr 12, 2013 at 6:03 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 12/04/2013 10:38, Stefan Hajnoczi ha scritto: Yes, protect. Supposed we have HostMem A, and it will become B. Then hostmem_lookup will either see A or B. If it see A, it should use A refcnt agaist

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-12 Thread liu ping fan
On Thu, Apr 11, 2013 at 6:09 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 01/04/2013 10:20, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com The hostmem listener will translate gpa to hva quickly. Make it global, so other component can use it. Also this patch adopt

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-12 Thread Stefan Hajnoczi
On Fri, Apr 12, 2013 at 02:46:41PM +0800, liu ping fan wrote: On Thu, Apr 11, 2013 at 6:09 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 01/04/2013 10:20, Liu Ping Fan ha scritto: Finally, please split this patch and patch 3 differently: 1) add HostMemRegions 2) add ref/unref of

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-12 Thread Stefan Hajnoczi
On Fri, Apr 12, 2013 at 11:55:39AM +0800, liu ping fan wrote: On Thu, Apr 11, 2013 at 6:11 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Mon, Apr 01, 2013 at 04:20:31PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com The hostmem listener will translate gpa to

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-12 Thread Paolo Bonzini
Il 12/04/2013 10:38, Stefan Hajnoczi ha scritto: Yes, protect. Supposed we have HostMem A, and it will become B. Then hostmem_lookup will either see A or B. If it see A, it should use A refcnt agaist hostmem_listener_commit to drop A. This refcnt has no relation with mr's object's

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-11 Thread Paolo Bonzini
Il 01/04/2013 10:20, Liu Ping Fan ha scritto: From: Liu Ping Fan pingf...@linux.vnet.ibm.com The hostmem listener will translate gpa to hva quickly. Make it global, so other component can use it. Also this patch adopt MemoryRegionOps's ref/unref interface to make it survive the RAM

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-11 Thread Stefan Hajnoczi
On Mon, Apr 01, 2013 at 04:20:31PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com The hostmem listener will translate gpa to hva quickly. Make it global, so other component can use it. Also this patch adopt MemoryRegionOps's ref/unref interface to make it survive

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-11 Thread Paolo Bonzini
Il 11/04/2013 12:11, Stefan Hajnoczi ha scritto: Also, these sync gcc builtins are not available on all platforms or gcc versions. We need to be a little careful to avoid breaking builds here. Maybe __sync_add_and_fetch() is fine but I wanted to mention it because I've had trouble with these

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-11 Thread liu ping fan
On Thu, Apr 11, 2013 at 6:11 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Mon, Apr 01, 2013 at 04:20:31PM +0800, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com The hostmem listener will translate gpa to hva quickly. Make it global, so other component can use it. Also

Re: [Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-02 Thread li guang
在 2013-04-01一的 16:20 +0800,Liu Ping Fan写道: From: Liu Ping Fan pingf...@linux.vnet.ibm.com The hostmem listener will translate gpa to hva quickly. Make it global, so other component can use it. Also this patch adopt MemoryRegionOps's ref/unref interface to make it survive the RAM hotunplug.

[Qemu-devel] [PATCH 2/5] hostmem: make hostmem global and RAM hotunplg safe

2013-04-01 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com The hostmem listener will translate gpa to hva quickly. Make it global, so other component can use it. Also this patch adopt MemoryRegionOps's ref/unref interface to make it survive the RAM hotunplug. Signed-off-by: Liu Ping Fan