From: Jason Gunthorpe <jgg@nvidia.com>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: iommu@lists.linux.dev,
Alex Williamson <alex.williamson@redhat.com>,
Lu Baolu <baolu.lu@linux.intel.com>,
Eric Auger <eric.auger@redhat.com>,
Kevin Tian <kevin.tian@intel.com>,
Lixiao Yang <lixiao.yang@intel.com>,
Matthew Rosato <mjrosato@linux.ibm.com>,
syzbot+7574ebfe589049630608@syzkaller.appspotmail.com,
Terrence Xu <terrence.xu@intel.com>, Yi Liu <yi.l.liu@intel.com>
Subject: Re: [PATCH rc 1/3] iommufd/selftest: Do not try to destroy an access once it is attached
Date: Wed, 26 Jul 2023 13:40:58 -0300 [thread overview]
Message-ID: <ZMFMmjJQ+yhzxTmj@nvidia.com> (raw)
In-Reply-To: <ZMBCdNIneapDbjUS@Asurada-Nvidia>
On Tue, Jul 25, 2023 at 02:45:24PM -0700, Nicolin Chen wrote:
> On Tue, Jul 25, 2023 at 04:05:48PM -0300, Jason Gunthorpe wrote:
> > The access must be detached first.
> >
> > To make the cleanup simpler copy the fdno to userspace before creating the
> > access in the first place. Then there is no need to unwind after
> > iommufd_access_attach.
> >
> > Fixes: 54b47585db66 ("iommufd: Create access in vfio_iommufd_emulated_bind()")
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
>
> Hmm, I was expecting that the iopt_remove_access() call in the
> iommufd_access_destroy_object() could "detach" the access.
Hmm, it does yes
> If calling iopt_remove_access() isn't enough, it means that we'd
> need the full routine from the iommufd_access_detach() in cdev
> series, i.e. we are missing the unmap part?
At least that part is not missing the unmap because the close_device()
immediately before is supposed to be an implicit unmap for the driver.
> In that case, though this patch can fix the issue in selftest,
> yet does the emulated pathway potentially have the same issue?
It seems not, and this patch is more a cosmetic change than any
functional issue, but given that the vfio flows rely on this working
we should keep it here to test it.
So, lets drop this patch.
Jason
next prev parent reply other threads:[~2023-07-26 16:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 19:05 [PATCH rc 0/3] Several iommufd bug fixes Jason Gunthorpe
2023-07-25 19:05 ` [PATCH rc 1/3] iommufd/selftest: Do not try to destroy an access once it is attached Jason Gunthorpe
2023-07-25 21:45 ` Nicolin Chen
2023-07-26 16:40 ` Jason Gunthorpe [this message]
2023-07-26 3:53 ` Greg KH
2023-07-25 19:05 ` [PATCH rc 2/3] iommufd: IOMMUFD_DESTROY should not increase the refcount Jason Gunthorpe
2023-07-27 5:25 ` Tian, Kevin
2023-07-27 14:10 ` Jason Gunthorpe
2023-07-25 19:05 ` [PATCH rc 3/3] iommufd: Set end correctly when doing batch carry Jason Gunthorpe
2023-07-25 19:55 ` Nicolin Chen
2023-07-27 5:26 ` Tian, Kevin
2023-07-27 14:31 ` [PATCH rc 0/3] Several iommufd bug fixes Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZMFMmjJQ+yhzxTmj@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=baolu.lu@linux.intel.com \
--cc=eric.auger@redhat.com \
--cc=iommu@lists.linux.dev \
--cc=kevin.tian@intel.com \
--cc=lixiao.yang@intel.com \
--cc=mjrosato@linux.ibm.com \
--cc=nicolinc@nvidia.com \
--cc=syzbot+7574ebfe589049630608@syzkaller.appspotmail.com \
--cc=terrence.xu@intel.com \
--cc=yi.l.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox