On Fri, May 01, 2020 at 05:15:52AM -0700, Christoph Hellwig wrote: > > @@ -432,6 +432,7 @@ config ARM_SMMU_V3 > > tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support" > > depends on ARM64 > > select IOMMU_API > > + select IOMMU_SVA > > select IOMMU_IO_PGTABLE_LPAE > > select GENERIC_MSI_IRQ_DOMAIN > > Doesn't this need to select MMU_NOTIFIER now? Yes, will fix > > + struct mmu_notifier_ops mn_ops; > > Note: not a pointer. > > > + /* If bind() was already called for this (dev, mm) pair, reuse it. */ > > + list_for_each_entry(bond, &master->bonds, list) { > > + if (bond->mm == mm) { > > + refcount_inc(&bond->refs); > > + return &bond->sva; > > + } > > + } > > + > > + mn = mmu_notifier_get(&smmu_domain->mn_ops, mm); > > + if (IS_ERR(mn)) > > + return ERR_CAST(mn); > > Which seems to be to avoid mmu_notifier_get reusing notifiers registered > by other arm_smmu_master instance right? Yes, although I'm registering a single mmu notifier per (domain, mm) pair, not (master, mm), because the SMMU driver keeps one set of PASID tables per IOMMU domain. > Either you could just use plain old mmu_notifier_register to avoid > the reuse. Or we could enhance the mmu_notifier_get to pass a private > oaque instance ID pointer, which is checked in addition to the ops, > and you could probably kill off the bonds list and lookup. Going back to mmu_notifier_register() seems better for now. I don't want to change the core APIs just for this driver, because it's likely to change again when more hardware starts appearing and we optimize it. Thanks, Jean