RE: [PATCH 03/10] kvm/vfio: Store the struct file in the kvm_vfio_group

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

 



> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Sent: Friday, April 15, 2022 2:46 AM
> 
> Following patches will chage the APIs to use the struct file as the handle

s/chage/change

> @@ -304,10 +309,10 @@ static int kvm_vfio_group_set_spapr_tce(struct
> kvm_device *dev,
>  		return -EBADF;
> 
>  	vfio_group = kvm_vfio_group_get_external_user(f.file);
> -	fdput(f);
> -
> -	if (IS_ERR(vfio_group))
> -		return PTR_ERR(vfio_group);
> +	if (IS_ERR(vfio_group)) {
> +		ret = PTR_ERR(vfio_group);
> +		goto err_fdput;
> +	}
> 
>  	grp = kvm_vfio_group_get_iommu_group(vfio_group);
>  	if (WARN_ON_ONCE(!grp)) {

move above two external calls into below loop after file is
matched...

> @@ -320,7 +325,7 @@ static int kvm_vfio_group_set_spapr_tce(struct
> kvm_device *dev,
>  	mutex_lock(&kv->lock);
> 
>  	list_for_each_entry(kvg, &kv->group_list, node) {
> -		if (kvg->vfio_group != vfio_group)
> +		if (kvg->filp != f.file)
>  			continue;
> 

... here. Though they will be removed in later patch doing so at
this patch is slightly more reasonable.

otherwise,

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>




[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