[RFC PATCH v2 07/10] iommu/riscv: support nested iommu for creating domains owned by userspace
Zong Li
zong.li at sifive.com
Fri Jun 21 00:34:06 PDT 2024
On Thu, Jun 20, 2024 at 12:34 AM Joao Martins <joao.m.martins at oracle.com> wrote:
>
> On 14/06/2024 15:21, Zong Li wrote:
> > +static struct iommu_domain *
> > +riscv_iommu_domain_alloc_user(struct device *dev, u32 flags,
> > + struct iommu_domain *parent,
> > + const struct iommu_user_data *user_data)
> > +{
> > + struct iommu_domain *domain;
> > + struct riscv_iommu_domain *riscv_domain;
> > +
> > + /* Allocate stage-1 domain if it has stage-2 parent domain */
> > + if (parent)
> > + return riscv_iommu_domain_alloc_nested(dev, parent, user_data);
> > +
> > + if (flags & ~((IOMMU_HWPT_ALLOC_NEST_PARENT | IOMMU_HWPT_ALLOC_DIRTY_TRACKING)))
> > + return ERR_PTR(-EOPNOTSUPP);
> > +
>
> IOMMU_HWPT_ALLOC_DIRTY_TRACKING flag check should be dropped if it's not
> supported in code (which looks to be the case in your series) e.g.
Thanks for your tips, I will remove it in the next version.
>
> if (flags & ~((IOMMU_HWPT_ALLOC_NEST_PARENT)))
> return ERR_PTR(-EOPNOTSUPP);
More information about the linux-riscv
mailing list