Re: [PATCH v6 21/24] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

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

 



On Wed, Mar 15, 2023 at 04:40:19AM +0000, Liu, Yi L wrote:

> # if IS_ENABLED(CONFIG_VFIO_GROUP)
> static inline bool vfio_device_is_noiommu(struct vfio_device *vdev)
> {
>         return IS_ENABLED(CONFIG_VFIO_NOIOMMU) &&
>                vdev->group->type == VFIO_NO_IOMMU;
> }
> #else
> static inline bool vfio_device_is_noiommu(struct vfio_device *vdev)
> {
>         struct iommu_group *iommu_group;
> 
>         if (!IS_ENABLED(CONFIG_VFIO_NOIOMMU) || !vfio_noiommu)
>                 return -EINVAL;
> 
>         iommu_group = iommu_group_get(vdev->dev);
>         if (iommu_group)
>                 iommu_group_put(iommu_group);
>
>         return !iommu_group;

If we don't have VFIO_GROUP then no-iommu is signaled by a NULL
iommu_ctx pointer in the vdev, don't mess with groups

Jason



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux