qemu-devel
[Top][All Lists]
Advanced

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

RE: [PATCH v7 08/27] vfio/pci: Introduce a vfio pci hot reset interface


From: Duan, Zhenzhong
Subject: RE: [PATCH v7 08/27] vfio/pci: Introduce a vfio pci hot reset interface
Date: Wed, 22 Nov 2023 03:32:04 +0000

Hi Philippe,

>-----Original Message-----
>From: Philippe Mathieu-Daudé <philmd@linaro.org>
>Sent: Wednesday, November 22, 2023 2:39 AM
>Subject: Re: [PATCH v7 08/27] vfio/pci: Introduce a vfio pci hot reset 
>interface
>
>Hi Zhenzhong,
>
>On 21/11/23 09:44, Zhenzhong Duan wrote:
>> Legacy vfio pci and iommufd cdev have different process to hot reset
>> vfio device, expand current code to abstract out pci_hot_reset callback
>> for legacy vfio, this same interface will also be used by iommufd
>> cdev vfio device.
>>
>> Rename vfio_pci_hot_reset to vfio_legacy_pci_hot_reset and move it
>> into container.c.
>>
>> vfio_pci_[pre/post]_reset and vfio_pci_host_match are exported so
>> they could be called in legacy and iommufd pci_hot_reset callback.
>>
>> Suggested-by: Cédric Le Goater <clg@redhat.com>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
>> Reviewed-by: Eric Auger <eric.auger@redhat.com>
>> Tested-by: Eric Auger <eric.auger@redhat.com>
>> ---
>>   hw/vfio/pci.h                         |   3 +
>>   include/hw/vfio/vfio-container-base.h |   3 +
>>   hw/vfio/container.c                   | 170 ++++++++++++++++++++++++++
>>   hw/vfio/pci.c                         | 168 +------------------------
>>   4 files changed, 182 insertions(+), 162 deletions(-)
>
>
>> @@ -2485,166 +2485,10 @@ int
>vfio_pci_get_pci_hot_reset_info(VFIOPCIDevice *vdev,
>>
>>   static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool single)
>>   {
>
>> +    return ops->pci_hot_reset(vbasedev, single);
>
>At this point vfio_iommufd_ops.pci_hot_reset is NULL.
>Worth checking for non-NULL before calling.

Yes, vfio_iommufd_ops.pci_hot_reset is NULL here. But we could only use
Iommufd backend after:
"[PATCH v7 10/27] vfio/pci: Allow the selection of a given iommu backend"

With "[PATCH v7 09/27] vfio/iommufd: Enable pci hot reset through iommufd cdev 
interface"
set vfio_iommufd_ops.pci_hot_reset.

Looks not an issue for me.

Thanks
Zhenzhong

reply via email to

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