qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] memory_listener_unregister does not call region_del() -


From: Alexey Kardashevskiy
Subject: Re: [Qemu-devel] memory_listener_unregister does not call region_del() - why?
Date: Wed, 4 May 2016 16:54:37 +1000
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]