vfio fixes
[Qemu-devel] [PULL 1/2] vfio: fix wrong initialize vfio_group_list
In reply to Alex WilliamsonFrom: Chen Fan <[email protected]>
--- hw/vfio/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/common.c +1 -1
@@ -32,7 +32,7 @@#include "trace.h" struct vfio_group_head vfio_group_list = -QLIST_HEAD_INITIALIZER (vfio_address_spaces); +QLIST_HEAD_INITIALIZER (vfio_group_list);struct vfio_as_head vfio_address_spaces =QLIST_HEAD_INITIALIZER (vfio_address_spaces);
The following changes since commit ec6f25e788ef57ce1e9f734984ef8885172fd9e2:
Merge remote-tracking branch 'remotes/rth/tags/pull-tg-s390-20150203' into staging (2015-02-03 21:37:16 +0000)
are available in the git repository at:
git://github.com/awilliam/qemu-vfio.git tags/vfio-update-20150204.0
for you to fetch changes up to 3a4dbe6aa934370a92372528c1255ee1504965ee:
vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion (2015-02-04 11:45:32 -0700)
----------------------------------------------------------------
VFIO fixes:
- Fix wrong initializer (Chen Fan)
- Add missing object_unparent (Alex Williamson)
----------------------------------------------------------------
Alex Williamson (1):
vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion
Chen Fan (1):
vfio: fix wrong initialize vfio_group_list
hw/vfio/common.c | 2 +- hw/vfio/pci.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
[Qemu-devel] [PULL 2/2] vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion
Commit d8d95814609e added explicit object_unparent() calls for dynamically allocated MemoryRegions. The VFIOMSIXInfo structure also contains such a MemoryRegion, covering the mmap'd region of a PCI BAR above the MSI-X table. This structure is freed as part of the class exit function and therefore also needs an explicit object_unparent(). Failing to do this results in random segfaults due to fields within the structure, often the class pointer, being reclaimed and corrupted by the time object_finalize_child_property() is called for the object.
--- hw/vfio/pci.c | 1 + 1 file changed, 1 insertion(+)
hw/vfio/pci.c +1 -0
@@ -3065,6 +3065,7 @@ static void vfio_put_device(VFIOPCIDevice *vdev) {g_free (vdev->vbasedev.name);if (vdev->msix) { +object_unparent (OBJECT (&vdev->msix->mmap_mem));g_free (vdev->msix); vdev->msix =NULL ; }
Peter Maydell
AppliedQuoted 10 lines · Alex Williamson
The following changes since commit
ec6f25e788ef57ce1e9f734984ef8885172fd9e2:Merge remote-tracking branch 'remotes/rth/tags/pull-tg-s390-20150203' into staging (2015-02-03 21:37:16 +0000)
are available in the git repository at:
git://github.com/awilliam/qemu-vfio.gittags/vfio-update-20150204.0for you to fetch changes up to
3a4dbe6aa934370a92372528c1255ee1504965ee:
Quoted 8 lines
vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion (2015-02-04 11:45:32 -0700)
----------------------------------------------------------------
VFIO fixes:
- Fix wrong initializer (Chen Fan)
- Add missingobject_unparent(Alex Williamson)----------------------------------------------------------------
Applied, thanks.
-- PMM