lkml.org 
[lkml]   [2023]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 11/14] iommu/arm-smmu-v3: Add arm_smmu_domain_alloc_user
Hi Eirc,

Thanks for the review.

On Fri, Mar 24, 2023 at 04:28:26PM +0100, Eric Auger wrote:

> > +static struct iommu_domain *
> > +__arm_smmu_domain_alloc(unsigned type,
> > + struct arm_smmu_domain *s2,
> > + struct arm_smmu_master *master,
> > + const struct iommu_hwpt_arm_smmuv3 *user_cfg)
> > +{
> > + struct arm_smmu_domain *smmu_domain;
> > + struct iommu_domain *domain;
> > + int ret = 0;
> > +
> > + if (type == IOMMU_DOMAIN_SVA)
> > + return arm_smmu_sva_domain_alloc();
> > +
> > + if (type != IOMMU_DOMAIN_UNMANAGED &&
> > + type != IOMMU_DOMAIN_DMA &&
> > + type != IOMMU_DOMAIN_DMA_FQ &&
> > + type != IOMMU_DOMAIN_IDENTITY)
> > + return NULL;
> > +
> > + /*
> > + * Allocate the domain and initialise some of its data structures.
> > + * We can't really finalise the domain unless a master is given.
> > + */
> > + smmu_domain = kzalloc(sizeof(*smmu_domain), GFP_KERNEL);
> > + if (!smmu_domain)
> > + return NULL;
> > + domain = &smmu_domain->domain;
> > +
> > + domain->type = type;
> > + domain->ops = arm_smmu_ops.default_domain_ops;
> Compared to the original code, that's something new. Please can you
> explain why this is added in this patch?

Yea, I probably should have mentioned in the commit message that
this function via ops->domain_alloc_user() is called by IOMMUFD
directly without a wrapper, v.s. the other callers all go with
the __iommu_domain_alloc() helper in the iommu core where an ops
pointer gets setup.

So, this is something new, in order to work with IOMMUFD.

Thanks
Nicolin

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