Re: [RFC 07/12] vfio: Block device access via device fd until device is opened

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

 



On Mon, Dec 19, 2022 at 12:47:13AM -0800, Yi Liu wrote:

> @@ -452,6 +457,11 @@ void vfio_device_close(struct vfio_device_file *df)
>  	struct vfio_device *device = df->device;
>  
>  	mutex_lock(&device->dev_set->lock);
> +	/*
> +	 * Paired with smp_load_acquire() in vfio_device_fops::ioctl/
> +	 * read/write/mmap
> +	 */
> +	smp_store_release(&df->access_granted, false);

Storing false makes no sense, it can't do anything, this function
should only be called if we are in a release function so we know that
there can't be concurrent access to access_granted.

Jason



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux