qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] memory_listener_unregister does not call region_del() - why?
@ 2016-05-03  9:07 Alexey Kardashevskiy
  2016-05-04  6:54 ` Alexey Kardashevskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kardashevskiy @ 2016-05-03  9:07 UTC (permalink / raw)
  To: qemu-devel@nongnu.org; +Cc: David Gibson, Paolo Bonzini, Alex Williamson

Hi!

Noticed a thing - when we do vfio-pci hotplug, we register a memory 
listener on PCI address space:

memory_listener_register(&container->listener, container->space->as);

Then on the "pseries" machine, I add IOMMU subregions and this ends up in 
vfio_listener_region_add() where I can create hardware window and hook it 
to KVM, etc, some stuff. So far so good.

Now I am trying hot unplug. So vfio_instance_finalize() is called, and from 
it - vfio_put_group -> vfio_disconnect_container -> vfio_listener_release 
-> memory_listener_unregister(&container->listener), as expected.

Hoewever, unlike memory_listener_register() (which calls region_add() 
callbacks), memory_listener_unregister() is as simple as this:

void memory_listener_unregister(MemoryListener *listener)
{
     QTAILQ_REMOVE(&memory_listeners, listener, link);
}

No region_del() calls => no proper cleanup. Hm.

Is there any particular reason for it to be that simple and there is 
another way to be notified about some memory listener being unregistered? 
Thanks.


-- 
Alexey

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] memory_listener_unregister does not call region_del() - why?
  2016-05-03  9:07 [Qemu-devel] memory_listener_unregister does not call region_del() - why? Alexey Kardashevskiy
@ 2016-05-04  6:54 ` Alexey Kardashevskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Kardashevskiy @ 2016-05-04  6:54 UTC (permalink / raw)
  To: qemu-devel@nongnu.org; +Cc: David Gibson, Paolo Bonzini, Alex Williamson

Never mind, I posted "[PATCH qemu v16 00/19] spapr: vfio: Enable Dynamic 
DMA windows (DDW)" which has an attempt to answer the question below. Cheers.


On 05/03/2016 07:07 PM, Alexey Kardashevskiy wrote:
> Hi!
>
> Noticed a thing - when we do vfio-pci hotplug, we register a memory
> listener on PCI address space:
>
> memory_listener_register(&container->listener, container->space->as);
>
> Then on the "pseries" machine, I add IOMMU subregions and this ends up in
> vfio_listener_region_add() where I can create hardware window and hook it
> to KVM, etc, some stuff. So far so good.
>
> Now I am trying hot unplug. So vfio_instance_finalize() is called, and from
> it - vfio_put_group -> vfio_disconnect_container -> vfio_listener_release
> -> memory_listener_unregister(&container->listener), as expected.
>
> Hoewever, unlike memory_listener_register() (which calls region_add()
> callbacks), memory_listener_unregister() is as simple as this:
>
> void memory_listener_unregister(MemoryListener *listener)
> {
>     QTAILQ_REMOVE(&memory_listeners, listener, link);
> }
>
> No region_del() calls => no proper cleanup. Hm.
>
> Is there any particular reason for it to be that simple and there is
> another way to be notified about some memory listener being unregistered?
> Thanks.
>
>


-- 
Alexey

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-04  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03  9:07 [Qemu-devel] memory_listener_unregister does not call region_del() - why? Alexey Kardashevskiy
2016-05-04  6:54 ` Alexey Kardashevskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).