qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 0/6] VIRTIO-IOMMU/VFIO: Revert IOMMUDevice clear and fix hotu


From: Eric Auger
Subject: Re: [PATCH 0/6] VIRTIO-IOMMU/VFIO: Revert IOMMUDevice clear and fix hotunplug
Date: Tue, 16 Jul 2024 16:59:15 +0200
User-agent: Mozilla Thunderbird

Hi Cédric,

On 7/16/24 16:02, Cédric Le Goater wrote:
> On 7/16/24 11:45, Eric Auger wrote:
>> 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(-)
>>
>
>
> Tested-by: Cédric Le Goater <clg@redhat.com>
>
> with a vfio-pci device (mlx5 VF) and a virtio-net-pci device.

Many Thanks!

Eric
>
> Thanks,
>
> C.
>




reply via email to

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