[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250619185920.GC17127@nvidia.com>
Date: Thu, 19 Jun 2025 15:59:20 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Jacob Pan <jacob.pan@...ux.microsoft.com>
Cc: linux-kernel@...r.kernel.org,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
Alex Williamson <alex.williamson@...hat.com>,
"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 v3 1/2] vfio: Fix unbalanced vfio_df_close call in
no-iommu mode
On Wed, Jun 18, 2025 at 04:46:17PM -0700, Jacob Pan wrote:
> For devices with no-iommu enabled in IOMMUFD VFIO compat mode, the group open
> path skips vfio_df_open(), leaving open_count at 0. This causes a warning in
> vfio_assert_device_open(device) when vfio_df_close() is called during group
> close.
>
> The correct behavior is to skip only the IOMMUFD bind in the device open path
> for no-iommu devices. Commit 6086efe73498 omitted vfio_df_open(), which was
> too broad. This patch restores the previous behavior, ensuring
> the vfio_df_open is called in the group open path.
>
> Fixes: 6086efe73498 ("vfio-iommufd: Move noiommu compat validation out of vfio_iommufd_bind()")
> Suggested-by: Alex Williamson <alex.williamson@...hat.com>
> Suggested-by: Jason Gunthorpe <jgg@...dia.com>
> Signed-off-by: Jacob Pan <jacob.pan@...ux.microsoft.com>
> ---
> v3: Apply a concise fix from Alex
> v2: Use a fix from Jason
> ---
> drivers/vfio/group.c | 7 +++----
> drivers/vfio/iommufd.c | 4 ++++
> 2 files changed, 7 insertions(+), 4 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Jason
Powered by blists - more mailing lists