lkml.org 
[lkml]   [2023]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 03/11] iommufd/hw_pagetable: Use domain_alloc_user op for domain allocation
On Fri, May 19, 2023 at 08:56:25AM +0000, Tian, Kevin wrote:

> > From: Yi Liu <yi.l.liu@intel.com>
> > Sent: Thursday, May 11, 2023 10:39 PM
> >
> >
> > @@ -88,7 +90,10 @@ 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 (ops->domain_alloc_user)
> > + hwpt->domain = ops->domain_alloc_user(idev->dev, NULL,
> > NULL);
> > + else
> > + hwpt->domain = iommu_domain_alloc(idev->dev->bus);
>
> this reminds the comment for @domain_alloc_user() should clarify
> that UNMANGED domain type is assumed when no user data is
> provided, to be compatible with iommu_domain_alloc().

Yes. Perhaps:

* @domain_alloc_user: allocate user iommu domain. A valid user_data pointer and
* a parent pointer to a kernel-managed domain are required
* to allocate an IOMMU_DOMAIN_NESTED domain. Otherwise, the
* new domain will be set to an IOMMU_DOMAIN_UNMANAGED type.

Thanks
Nic
\
 
 \ /
  Last update: 2023-05-19 20:58    [W:2.050 / U:1.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site