On Wed, 19 Apr 2023 at 03:38, Duan, Zhenzhong <zhenzhong.d...@intel.com> wrote:
> >> The documentation for the replay method of IOMMUMemoryRegionClass > >> says: > >> * The default implementation of memory_region_iommu_replay() is to > >> * call the IOMMU translate method for every page in the address space > >> * with flag == IOMMU_NONE and then call the notifier if translate > >> * returns a valid mapping. If this method is implemented then it > >> * overrides the default behaviour, and must provide the full semantics > >> * of memory_region_iommu_replay(), by calling @notifier for every > >> * translation present in the IOMMU. > >> > >> This commit changes the default implementation so it's no longer doing > >> this for every page in the address space. If the change is correct, we > >> should update the doc comment too. > >> > >> Oddly, the doc comment for memory_region_iommu_replay() itself doesn't > >> very clearly state what its semantics are; it could probably be > >> improved. > >> > >> Anyway, this change is OK for the TCG use of iommu notifiers, because > >> that doesn't care about replay. > > > >Since the notifier contains the range information I'd say the change > >shouldn't > >affect any caller but only a pure performance difference. Indeed it'll be > >nicer > >the documentation can be updated too. Thanks, > Thanks Peter Maydell and Peter Xu's comments, will add doc update. > May I ask if it's preferred to add doc update to this patch or a separate > patch? I suggest doing it in this same patch. thanks -- PMM