RE: [PATCH v6 07/24] vfio: Block device access via device fd until device is opened

Tian, Kevin
2023-03-10T04:50:50Z

> From: Liu, Yi L <yi.l.liu@intel.com>
> Sent: Wednesday, March 8, 2023 9:29 PM
>
> @@ -1114,6 +1114,10 @@ static long vfio_device_fops_unl_ioctl(struct file
> *filep,
> struct vfio_device *device = df->device;
> int ret;
>
> + /* Paired with smp_store_release() in vfio_device_group_open() */
> + if (!smp_load_acquire(&df->access_granted))
> + return -EINVAL;
> +

/* Paired with smp_store_release() right after vfio_device_open() is called */