From: Jason Gunthorpe <jgg@nvidia.com>
To: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Lu Baolu <baolu.lu@linux.intel.com>,
Kevin Tian <kevin.tian@intel.com>, Joerg Roedel <joro@8bytes.org>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Nicolin Chen <nicolinc@nvidia.com>, Yi Liu <yi.l.liu@intel.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
Joel Granados <j.granados@samsung.com>,
iommu@lists.linux.dev, virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org,
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Subject: Re: [PATCH v8 07/10] iommufd: Fault-capable hwpt attach/detach/replace
Date: Tue, 22 Oct 2024 11:52:57 -0300 [thread overview]
Message-ID: <20241022145257.GB864191@nvidia.com> (raw)
In-Reply-To: <CABQgh9Hd0QCfEtVcMyXG+=KHuZdGGUA=kk5iL_ysOzfOpLh=-w@mail.gmail.com>
On Tue, Oct 22, 2024 at 10:30:10PM +0800, Zhangfei Gao wrote:
> On Fri, 18 Oct 2024 at 21:53, Jason Gunthorpe <jgg@nvidia.com> wrote:
> >
> > On Wed, Oct 16, 2024 at 12:25:03PM -0300, Jason Gunthorpe wrote:
> > > > > smmu-v3 needs some more fixing to move that
> > > > > arm_smmu_master_enable_sva() logic into domain attachment.
> > > >
> > > > Will think about this, Thanks Jason
> > >
> > > Can you test it if a patch is made?
> >
> > Here it is:
> >
> > https://github.com/jgunthorpe/linux/commits/smmuv3_nesting/
> >
> > fa1528253d2210 iommu: Remove IOMMU_DEV_FEAT_SVA
> > 5675560a272cf5 iommu/vt-d: Check if SVA is supported when attaching the SVA domain
> > 94bc2b9525b508 iommu/arm-smmu-v3: Put iopf enablement in the domain attach path
> >
> > Let me know..
>
> With these patches, do we still need ops->user_pasid_table?
It makes no change - you need user_pasid_table to make
IOMMU_DOMAIN_NESTED work.
If you aren't using IOMMU_DOMAIN_NESTED you shouldn't need it.
> if (fault->prm.flags & IOMMU_FAULT_PAGE_REQUEST_PASID_VALID) {
> attach_handle = iommu_attach_handle_get(dev->iommu_group,
> fault->prm.pasid, 0);
>
> // is attach_handle expected effect value here?
> if (IS_ERR(attach_handle)) {
> const struct iommu_ops *ops = dev_iommu_ops(dev);
>
> if (!ops->user_pasid_table)
> return NULL;
> /*
> * The iommu driver for this device supports user-
> * managed PASID table. Therefore page faults for
> * any PASID should go through the NESTING domain
> * attached to the device RID.
> */
> attach_handle = iommu_attach_handle_get(
> dev->iommu_group, IOMMU_NO_PASID,
> IOMMU_DOMAIN_NESTED);
>
> Now I still need set ops->user_pasid_table, since attach_handle can not
> return from the first iommu_attach_handle_get with fault->prm.pasid = 1,
> but the second iommu_attach_handle_get with IOMMU_NO_PASID,
> suppose it is not expected?
The second handle_get will always fail unless you are using
IOMMU_DOMAIN_NESTED in userspace with iommufd.
What testing are you doing exactly?
Jason
next prev parent reply other threads:[~2024-10-22 14:53 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 6:34 [PATCH v8 00/10] IOMMUFD: Deliver IO page faults to user space Lu Baolu
2024-07-02 6:34 ` [PATCH v8 01/10] iommu: Introduce domain attachment handle Lu Baolu
2024-07-02 6:34 ` [PATCH v8 02/10] iommu: Remove sva handle list Lu Baolu
2024-07-02 6:34 ` [PATCH v8 03/10] iommu: Add attach handle to struct iopf_group Lu Baolu
2024-07-02 6:34 ` [PATCH v8 04/10] iommu: Extend domain attach group with handle support Lu Baolu
2024-07-02 6:34 ` [PATCH v8 05/10] iommufd: Add fault and response message definitions Lu Baolu
2024-07-02 6:34 ` [PATCH v8 06/10] iommufd: Add iommufd fault object Lu Baolu
2024-07-03 23:06 ` Nicolin Chen
2024-07-04 2:59 ` Baolu Lu
2024-07-04 5:36 ` Nicolin Chen
2024-07-04 6:37 ` Tian, Kevin
2024-07-04 7:32 ` Baolu Lu
2024-07-04 23:18 ` Nicolin Chen
2024-07-05 0:49 ` Tian, Kevin
2024-07-08 16:22 ` Jason Gunthorpe
2024-07-08 16:29 ` Jason Gunthorpe
2024-07-08 18:36 ` Nicolin Chen
2024-07-09 17:00 ` Jason Gunthorpe
2024-07-09 17:33 ` Nicolin Chen
2024-07-12 13:00 ` Jason Gunthorpe
2024-07-02 6:34 ` [PATCH v8 07/10] iommufd: Fault-capable hwpt attach/detach/replace Lu Baolu
2024-10-15 3:19 ` Zhangfei Gao
2024-10-15 12:54 ` Jason Gunthorpe
2024-10-16 1:58 ` Zhangfei Gao
2024-10-16 15:25 ` Jason Gunthorpe
2024-10-17 1:44 ` Zhangfei Gao
2024-10-17 12:05 ` Jason Gunthorpe
2024-10-17 12:35 ` Zhangfei Gao
2024-10-17 12:58 ` Shameerali Kolothum Thodi
2024-10-17 13:08 ` Jason Gunthorpe
2024-10-18 1:58 ` Baolu Lu
2024-10-18 2:45 ` Zhangfei Gao
2024-10-27 14:12 ` Zhangfei Gao
2024-10-27 14:26 ` Baolu Lu
2024-10-28 9:56 ` Zhangfei Gao
2024-10-28 11:17 ` Baolu Lu
2024-10-18 14:33 ` Jason Gunthorpe
2024-10-18 13:53 ` Jason Gunthorpe
2024-10-22 14:30 ` Zhangfei Gao
2024-10-22 14:52 ` Jason Gunthorpe [this message]
2024-10-23 10:22 ` Zhangfei Gao
2024-07-02 6:34 ` [PATCH v8 08/10] iommufd: Associate fault object with iommufd_hw_pgtable Lu Baolu
2024-07-02 6:34 ` [PATCH v8 09/10] iommufd/selftest: Add IOPF support for mock device Lu Baolu
2024-07-02 6:34 ` [PATCH v8 10/10] iommufd/selftest: Add coverage for IOPF test Lu Baolu
2024-07-04 14:18 ` [PATCH v8 00/10] IOMMUFD: Deliver IO page faults to user space Will Deacon
2024-07-09 17:23 ` 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=20241022145257.GB864191@nvidia.com \
--to=jgg@nvidia.com \
--cc=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=j.granados@samsung.com \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jean-philippe@linaro.org \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=will@kernel.org \
--cc=yi.l.liu@intel.com \
--cc=zhangfei.gao@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).