[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250616200558.GR1174925@nvidia.com>
Date: Mon, 16 Jun 2025 17:05:58 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: Jacob Pan <jacob.pan@...ux.microsoft.com>, linux-kernel@...r.kernel.org,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"Liu, Yi L" <yi.l.liu@...el.com>, Zhang Yu <zhangyu1@...rosoft.com>,
Easwar Hariharan <eahariha@...ux.microsoft.com>,
Saurabh Sengar <ssengar@...ux.microsoft.com>
Subject: Re: [PATCH v2 2/2] vfio: Fix unbalanced vfio_df_close call in
no-iommu mode
On Mon, Jun 16, 2025 at 01:40:04PM -0600, Alex Williamson wrote:
> --- a/drivers/vfio/group.c
> +++ b/drivers/vfio/group.c
> @@ -192,18 +192,18 @@ static int vfio_df_group_open(struct vfio_device_file *df)
> * implies they expected translation to exist
> */
> if (!capable(CAP_SYS_RAWIO) ||
> - vfio_iommufd_device_has_compat_ioas(device, df->iommufd))
> + vfio_iommufd_device_has_compat_ioas(device, df->iommufd)) {
> ret = -EPERM;
> - else
> - ret = 0;
> - goto out_put_kvm;
> + goto out_put_kvm;
> + }
> }
>
>
> And add a noiommu exit branch to _iommufd_bind, symmetric to unbind.
> Right? Thanks,
Just comparing to the original
+ if (iommufd) {
+ if (!vfio_device_is_noiommu(device))
+ ret = vfio_df_iommufd_bind(df);
Isn't being captured, so it needs another hunk in
vfio_df_iommufd_bind()
Jason
Powered by blists - more mailing lists