diff mbox series

[v1,8/8] vfio-iommufd: Support IO page table replacement

Message ID a85ebe54c2fff9ca134a33cdf8744a7c1d66feef.1675320212.git.nicolinc@nvidia.com (mailing list archive)
State New, archived
Headers show
Series Add IO page table replacement support | expand

Commit Message

Nicolin Chen Feb. 2, 2023, 7:05 a.m. UTC
Remove the vdev->iommufd_attached check, since the kernel can internally
handle a replacement of the IO page table now.

Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
---
 drivers/vfio/iommufd.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Tian, Kevin Feb. 6, 2023, 8:49 a.m. UTC | #1
> From: Nicolin Chen <nicolinc@nvidia.com>
> Sent: Thursday, February 2, 2023 3:05 PM
> 
> Remove the vdev->iommufd_attached check, since the kernel can internally
> handle a replacement of the IO page table now.
> 
> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
> ---
>  drivers/vfio/iommufd.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/vfio/iommufd.c b/drivers/vfio/iommufd.c
> index 7e09defbcffe..f9e89b3eef69 100644
> --- a/drivers/vfio/iommufd.c
> +++ b/drivers/vfio/iommufd.c
> @@ -111,9 +111,6 @@ int vfio_iommufd_physical_attach_ioas(struct
> vfio_device *vdev, u32 *pt_id)
>  		return 0;
>  	}
> 
> -	if (vdev->iommufd_attached)
> -		return -EBUSY;
> -
>  	rc = iommufd_device_attach(vdev->iommufd_device, pt_id);
>  	if (rc)
>  		return rc;

also update vfio uapi description to explain the replace semantics.
Nicolin Chen Feb. 6, 2023, 6:54 p.m. UTC | #2
On Mon, Feb 06, 2023 at 08:49:16AM +0000, Tian, Kevin wrote:
> External email: Use caution opening links or attachments
> 
> 
> > From: Nicolin Chen <nicolinc@nvidia.com>
> > Sent: Thursday, February 2, 2023 3:05 PM
> >
> > Remove the vdev->iommufd_attached check, since the kernel can internally
> > handle a replacement of the IO page table now.
> >
> > Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
> > ---
> >  drivers/vfio/iommufd.c | 3 ---
> >  1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/vfio/iommufd.c b/drivers/vfio/iommufd.c
> > index 7e09defbcffe..f9e89b3eef69 100644
> > --- a/drivers/vfio/iommufd.c
> > +++ b/drivers/vfio/iommufd.c
> > @@ -111,9 +111,6 @@ int vfio_iommufd_physical_attach_ioas(struct
> > vfio_device *vdev, u32 *pt_id)
> >               return 0;
> >       }
> >
> > -     if (vdev->iommufd_attached)
> > -             return -EBUSY;
> > -
> >       rc = iommufd_device_attach(vdev->iommufd_device, pt_id);
> >       if (rc)
> >               return rc;
> 
> also update vfio uapi description to explain the replace semantics.

Will add that. Thanks!
diff mbox series

Patch

diff --git a/drivers/vfio/iommufd.c b/drivers/vfio/iommufd.c
index 7e09defbcffe..f9e89b3eef69 100644
--- a/drivers/vfio/iommufd.c
+++ b/drivers/vfio/iommufd.c
@@ -111,9 +111,6 @@  int vfio_iommufd_physical_attach_ioas(struct vfio_device *vdev, u32 *pt_id)
 		return 0;
 	}
 
-	if (vdev->iommufd_attached)
-		return -EBUSY;
-
 	rc = iommufd_device_attach(vdev->iommufd_device, pt_id);
 	if (rc)
 		return rc;