lkml.org 
[lkml]   [2023]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/12] iommufd: Pass parent hwpt and user_data to iommufd_hw_pagetable_alloc()
On Fri, Mar 10, 2023 at 10:10:56AM +0800, Baolu Lu wrote:
> > @@ -54,14 +58,20 @@ int iommufd_hw_pagetable_enforce_cc(struct iommufd_hw_pagetable *hwpt)
> > */
> > struct iommufd_hw_pagetable *
> > iommufd_hw_pagetable_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas,
> > - struct iommufd_device *idev, bool immediate_attach)
> > + struct iommufd_device *idev,
> > + struct iommufd_hw_pagetable *parent,
> > + void *user_data, bool immediate_attach)
> > {
> > const struct iommu_ops *ops = dev_iommu_ops(idev->dev);
> > + struct iommu_domain *parent_domain = NULL;
> > struct iommufd_hw_pagetable *hwpt;
> > int rc;
> > lockdep_assert_held(&ioas->mutex);
> > + if (parent && !ops->domain_alloc_user)
> > + return ERR_PTR(-EOPNOTSUPP);
>
> My understanding here is that we are checking whether domain_alloc_user
> is required. It seems that as long as the caller inputs a valid
> user_data or parent, domain_alloc_user is required. If so,
>
> if ((user_data || parent) && !ops->domain_alloc_user)
> return ERR_PTR(-EOPNOTSUPP);

Yes

Jason

\
 
 \ /
  Last update: 2023-03-27 00:53    [W:0.272 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site