lkml.org 
[lkml]   [2023]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v1 12/14] iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED type of allocations
    On Fri, Mar 24, 2023 at 10:50:34AM -0700, Nicolin Chen wrote:
    > On Fri, Mar 24, 2023 at 04:44:58PM +0100, Eric Auger wrote:
    > > > @@ -2923,8 +2949,16 @@ arm_smmu_domain_alloc_user(struct device *dev, struct iommu_domain *parent,
    > > > const struct iommu_hwpt_arm_smmuv3 *user_cfg = user_data;
    > > > struct arm_smmu_master *master = dev_iommu_priv_get(dev);
    > > > unsigned type = IOMMU_DOMAIN_UNMANAGED;
    > > > + struct arm_smmu_domain *s2 = NULL;
    > > > +
    > > > + if (parent) {
    > > > + if (parent->ops != arm_smmu_ops.default_domain_ops)
    > > > + return NULL;
    > > > + type = IOMMU_DOMAIN_NESTED;
    > > > + s2 = to_smmu_domain(parent);
    > > > + }
    > > Please can you explain the (use) case where !parent. This creates an
    > > unmanaged S1?
    >
    > It creates an unmanaged type of a domain. The decision to mark
    > it as an unmanaged S1 or an unmanaged S2 domain, is done in the
    > finalise() function that it checks the S2 flag and set a stage
    > accordingly.

    This also needs to be fixed up, the alloc_user should not return
    incompletely initialized domains.

    Jason

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