Re: [PATCH 04/12] iommufd: Pass parent hwpt and user_data to iommufd_hw_pagetable_alloc()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux