[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250603082519.7b5b063e@DESKTOP-0403QTC.>
Date: Tue, 3 Jun 2025 08:25:19 -0700
From: Jacob Pan <jacob.pan@...ux.microsoft.com>
To: Jason Gunthorpe <jgg@...dia.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>, jacob.pan@...ux.microsoft.com
Subject: Re: [PATCH 1/2] vfio: Fix unbalanced vfio_df_close call in no-iommu
mode
Hi Jason,
On Mon, 2 Jun 2025 20:49:03 -0300
Jason Gunthorpe <jgg@...dia.com> wrote:
> On Mon, Jun 02, 2025 at 04:43:18PM -0700, Jacob Pan wrote:
> > For no-iommu enabled devices working under IOMMUFD VFIO compat
> > mode, the group open path does not call vfio_df_open() and the
> > open_count is 0. So calling vfio_df_close() in the group close path
> > will trigger warning in vfio_assert_device_open(device);
> >
> > E.g. The following warning can be seen by running VFIO test.
> > https://github.com/awilliam/tests/blob/master/vfio-noiommu-pci-device-open.c
> > CONFIG_VFIO_CONTAINER = n
> > [ 29.094781] vfio-pci 0000:02:01.0: vfio-noiommu device opened by
> > user (vfio-noiommu-pc:164) Failed to get device info
> > [ 29.096540] ------------[ cut here ]------------
> > [ 29.096616] WARNING: CPU: 1 PID: 164 at
> > drivers/vfio/vfio_main.c:487 vfio_df_close+0xac/0xb4
> >
> > This patch adds checks for no-iommu mode and open_count to skip
> > calling vfio_df_close.
> >
> > Signed-off-by: Jacob Pan <jacob.pan@...ux.microsoft.com>
> > ---
> > drivers/vfio/group.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
>
> Did you mean to resend the original version?
my mistake, just sent v2.
Thanks!
Jacob
Powered by blists - more mailing lists