qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] VIRTIO-IOMMU/VFIO: Revert IOMMUDevice clear and fix hotunplug
@ 2024-07-16  9:45 Eric Auger
  2024-07-16  9:45 ` [PATCH 1/6] Revert "virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged" Eric Auger
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Eric Auger @ 2024-07-16  9:45 UTC (permalink / raw)
  To: eric.auger.pro, eric.auger, qemu-devel, qemu-arm, mst,
	jean-philippe, peter.maydell, clg, zhenzhong.duan,
	alex.williamson, jasowang
  Cc: yanghliu

1b889d6e39c3 ("virtio-iommu: Clear IOMMUDevice when VFIO
device is unplugged" fixes the VFIO hotplug/hotunplug/hotplug
sequence by clearing the IOMMUDevice which backs the VFIO device.
However this brings other troubles such as a memory corruption.

Even when fixing some cleanups that were missed on the first
attempt the memory corruption still exists if the IOMMUDevice is
freed. Until we understand the exact cause let's make things simpler:
let the backing IOMMUDevice survive the unplug as what is done
on intel iommu for instance. Clean up/reset resources that would
prevent the device from being hotplugged again (probe_done is removed,
[host_]resv_regions are reset). By doing this we also rule out the
use case of aliased BDFs which is known to be not functional with
virtio-iommu (missing guest kernel support) and the virtio-iommu device
implementation is not ready either.

This series can be found at:
https://github.com/eauger/qemu/tree/virtio_iommu_device_clear_fixes_v1


Eric Auger (6):
  Revert "virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged"
  virtio-iommu: Remove probe_done
  virtio-iommu: Free [host_]resv_ranges on unset_iommu_devices
  virtio-iommu: Remove the end point on detach
  hw/vfio/common: Add vfio_listener_region_del_iommu trace event
  virtio-iommu: Add trace point on
    virtio_iommu_detach_endpoint_from_domain

 include/hw/virtio/virtio-iommu.h |  1 -
 hw/vfio/common.c                 |  3 +-
 hw/virtio/virtio-iommu.c         | 88 +++++++++++---------------------
 hw/vfio/trace-events             |  3 +-
 hw/virtio/trace-events           |  1 +
 5 files changed, 35 insertions(+), 61 deletions(-)

-- 
2.41.0



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

end of thread, other threads:[~2024-07-17  7:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-16  9:45 [PATCH 0/6] VIRTIO-IOMMU/VFIO: Revert IOMMUDevice clear and fix hotunplug Eric Auger
2024-07-16  9:45 ` [PATCH 1/6] Revert "virtio-iommu: Clear IOMMUDevice when VFIO device is unplugged" Eric Auger
2024-07-16 13:05   ` Cédric Le Goater
2024-07-16  9:45 ` [PATCH 2/6] virtio-iommu: Remove probe_done Eric Auger
2024-07-16 13:06   ` Cédric Le Goater
2024-07-16  9:45 ` [PATCH 3/6] virtio-iommu: Free [host_]resv_ranges on unset_iommu_devices Eric Auger
2024-07-16 13:36   ` Cédric Le Goater
2024-07-17  3:06   ` Duan, Zhenzhong
2024-07-17  7:40     ` Eric Auger
2024-07-17  7:56       ` Duan, Zhenzhong
2024-07-16  9:45 ` [PATCH 4/6] virtio-iommu: Remove the end point on detach Eric Auger
2024-07-16 13:36   ` Cédric Le Goater
2024-07-16  9:45 ` [PATCH 5/6] hw/vfio/common: Add vfio_listener_region_del_iommu trace event Eric Auger
2024-07-16 13:36   ` Cédric Le Goater
2024-07-16  9:45 ` [PATCH 6/6] virtio-iommu: Add trace point on virtio_iommu_detach_endpoint_from_domain Eric Auger
2024-07-16 13:36   ` Cédric Le Goater
2024-07-16 14:02 ` [PATCH 0/6] VIRTIO-IOMMU/VFIO: Revert IOMMUDevice clear and fix hotunplug Cédric Le Goater
2024-07-16 14:59   ` Eric Auger

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).