[PATCH v7 06/14] iommu/arm-smmu-v3: Do not use master->sva_enable to restrict attaches
Jason Gunthorpe
jgg at nvidia.com
Tue May 14 15:51:25 PDT 2024
On Sun, May 12, 2024 at 11:01:19PM -0700, Nicolin Chen wrote:
> > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
> > index d31caceb584984..7627cb53da55b9 100644
> > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
> > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
> > @@ -628,7 +628,7 @@ static int arm_smmu_sva_set_dev_pasid(struct iommu_domain *domain,
> > struct arm_smmu_cd target;
> > int ret;
> >
> > - if (mm_get_enqcmd_pasid(mm) != id)
> > + if (mm_get_enqcmd_pasid(mm) != id || !master->cd_table.in_ste)
> > return -EINVAL;
>
> The in_ste is added in PATCH-2 and the new arm_smmu_set_pasid()
> in the same patch is also guarded by the in_ste. So, it feels a
> little more related by moving this check here into PATCH-2 too?
Hmm, actually I think we can just remove this hunk now. The
arm_smmu_set_pasid() a few lines below will check this already. It was
here because before I didn't have the error unwind for
arm_smmu_set_pasid() failure. Now that we have it we can just delete
this.
Thanks,
Jason
More information about the linux-arm-kernel
mailing list