Message ID | 20230928071528.26258-1-yi.l.liu@intel.com |
---|---|
Headers | show |
Series | iommufd support allocating nested parent domain | expand |
On 9/28/23 3:15 PM, Yi Liu wrote: > This extends iommufd_hw_pagetable_alloc() to accepts user flags. > > Reviewed-by: Kevin Tian<kevin.tian@intel.com> > Signed-off-by: Yi Liu<yi.l.liu@intel.com> > --- > drivers/iommu/iommufd/device.c | 2 +- > drivers/iommu/iommufd/hw_pagetable.c | 9 ++++++--- > drivers/iommu/iommufd/iommufd_private.h | 3 ++- > 3 files changed, 9 insertions(+), 5 deletions(-) Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Best regards, baolu
> From: Liu, Yi L <yi.l.liu@intel.com> > Sent: Thursday, September 28, 2023 3:15 PM > > This extends IOMMU_HWPT_ALLOC to allocate domains used as parent > (stage-2) > in nested translation. > > Signed-off-by: Yi Liu <yi.l.liu@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
On Thu, Sep 28, 2023 at 12:15:22AM -0700, Yi Liu wrote: > Yi Liu (6): > iommu: Add new iommu op to create domains owned by userspace > iommufd/hw_pagetable: Use domain_alloc_user op for domain allocation > iommufd/hw_pagetable: Accepts user flags for domain allocation > iommufd/hw_pagetable: Support allocating nested parent domain > iommufd/selftest: Add domain_alloc_user() support in iommu mock > iommu/vt-d: Add domain_alloc_user op I copy edited the commit messages, and moved the hunk adding IOMMU_HWPT_ALLOC_NEST_PARENT from 'iommu: Add new iommu op to create domains owned by userspace' into 'iommufd: Support allocating nested parent domain' Otherwise applied to iommufd for-next Thanks, Jason
On Mon, Oct 16, 2023 at 04:16:05PM +0800, Liu, Jingqi wrote: > @@ -88,10 +90,19 @@ iommufd_hw_pagetable_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas, > refcount_inc(&ioas->obj.users); > hwpt->ioas = ioas; > > - hwpt->domain = iommu_domain_alloc(idev->dev->bus); > - if (!hwpt->domain) { > - rc = -ENOMEM; > - goto out_abort; > + if (ops->domain_alloc_user) { > + hwpt->domain = ops->domain_alloc_user(idev->dev, 0); > > Seems a "flags" parameter needs to be passed to 'domain_alloc_user()'. > Like this: > hwpt->domain = ops->domain_alloc_user(idev->dev, flags); There's no "flags" parameter until the following PATCH-3: https://lore.kernel.org/linux-iommu/20230928071528.26258-4-yi.l.liu@intel.com/ Thanks Nicolin