]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
vfio: unmap and free BAR data in instance_finalize
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Feb 2015 17:25:44 +0000 (10:25 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 10 Feb 2015 17:25:44 +0000 (10:25 -0700)
commitba5e6bfa1aee29a8f72c5538c565dfb9889cf273
tree95446193dc2f8c25271e2dfd11e513f9201766c7
parent77a10d04d033484a913a5ee76eed31a9acc57bae
vfio: unmap and free BAR data in instance_finalize

In the case of VFIO, the unrealize callback is too early to munmap the
BARs.  The munmap must be delayed until memory accesses are complete.
To do this, split vfio_unmap_bars in two.  The removal step, now called
vfio_unregister_bars, remains in vfio_exitfn.  The reclamation step
is vfio_unmap_bars and is moved to the instance_finalize callback.

Similarly, quirk MemoryRegions have to be removed during
vfio_unregister_bars, but freeing the data structure must be delayed
to vfio_unmap_bars.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/pci.c