RE: [PATCH v7 19/22] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

Tian, Kevin
2023-03-17T02:23:00Z

> From: Yi Liu
> Sent: Thursday, March 16, 2023 8:56 PM
>
> +
> +static int vfio_device_cdev_enable_noiommu(struct vfio_device *device)
> +{
> + if (!vfio_device_is_noiommu(device))
> + return -EINVAL;
> +
> + if (!capable(CAP_SYS_RAWIO))
> + return -EPERM;
> +
> + return 0;
> +}

it makes more sense to check CAP first.