From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>, Shuah Khan <shuah@kernel.org>,
Nicolin Chen <nicolinc@nvidia.com>,
"Liu, Yi L" <yi.l.liu@intel.com>
Subject: Re: [PATCH v2 5/7] iommufd: Make iommufd_hw_pagetable_alloc() do iopt_table_add_domain()
Date: Thu, 23 Feb 2023 09:07:52 -0400 [thread overview]
Message-ID: <Y/dlKBZkbtClMcQC@nvidia.com> (raw)
In-Reply-To: <BL1PR11MB52714B54BB1BE16E99AEE11D8CAB9@BL1PR11MB5271.namprd11.prod.outlook.com>
On Thu, Feb 23, 2023 at 09:03:14AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Thursday, February 23, 2023 5:03 AM
> >
> > The HWPT is always linked to an IOAS and once a HWPT exists its domain
> > should be fully mapped. This ended up being split up into device.c during
> > a two phase creation that was a bit confusing.
> >
> > Move the iopt_table_add_domain() into iommufd_hw_pagetable_alloc() by
> > having it call back to device.c to complete the domain attach in the
> > required order.
> >
> > Calling iommufd_hw_pagetable_alloc() with immediate_attach = false will
> > work on most drivers, but notably the SMMU drivers will fail because they
> > can't decide what kind of domain to create until they are attached. This
> > will be fixed when the domain_alloc function can take in a struct device.
> >
>
> Is below understanding correct on how to retire immediate_attach?
>
> 1) immediate_attach=true in auto domain path for back compat (what
> this patch does);
yes
> 2) immediate_attach=false when adding hwpt_alloc() uAPI and VT-d
> support;
yes
> 3) fix domain_alloc() to take struct device so the SMMU drivers can
> decide the domain info w/o relying on attach;
Yes, this is where Robin's patches are going.
> 4) remove immediate_attach and enable hwpt_alloc() on SMMU.
Sort of, the domain_alloc_user already takes in the device so SMMU can
be fixed for that API immediately, in theory, but it looks like some
amount of work to get there.
Jason
next prev parent reply other threads:[~2023-02-23 13:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-22 21:02 [PATCH v2 0/7] Revise the hwpt lifetime model Jason Gunthorpe
2023-02-22 21:02 ` [PATCH v2 1/7] iommufd: Assert devices_lock for iommufd_hw_pagetable_has_group() Jason Gunthorpe
2023-02-22 21:02 ` [PATCH v2 2/7] iommufd: Add iommufd_lock_obj() around the auto-domains hwpts Jason Gunthorpe
2023-02-24 6:12 ` Tian, Kevin
2023-02-22 21:02 ` [PATCH v2 3/7] iommufd: Move ioas related HWPT destruction into iommufd_hw_pagetable_destroy() Jason Gunthorpe
2023-02-24 6:25 ` Tian, Kevin
2023-02-22 21:02 ` [PATCH v2 4/7] iommufd: Move iommufd_device to iommufd_private.h Jason Gunthorpe
2023-02-24 6:27 ` Tian, Kevin
2023-02-22 21:02 ` [PATCH v2 5/7] iommufd: Make iommufd_hw_pagetable_alloc() do iopt_table_add_domain() Jason Gunthorpe
2023-02-23 9:03 ` Tian, Kevin
2023-02-23 13:07 ` Jason Gunthorpe [this message]
2023-02-24 6:35 ` Tian, Kevin
2023-02-24 17:02 ` Jason Gunthorpe
2023-02-22 21:02 ` [PATCH v2 6/7] iommufd/selftest: Make selftest create a more complete mock device Jason Gunthorpe
2023-02-24 6:50 ` Tian, Kevin
2023-02-24 14:26 ` Jason Gunthorpe
2023-02-22 21:02 ` [PATCH v2 7/7] iommufd/selftest: Add a selftest for iommufd_device_attach() with a hwpt argument Jason Gunthorpe
2023-02-24 7:02 ` Tian, Kevin
2023-02-24 18:19 ` 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=Y/dlKBZkbtClMcQC@nvidia.com \
--to=jgg@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=kevin.tian@intel.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--cc=shuah@kernel.org \
--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