On Tue, Sep 06, 2016 at 03:12:26PM +1000, David Gibson wrote: > > /** > > @@ -611,9 +613,11 @@ uint64_t > > memory_region_iommu_get_min_page_size(MemoryRegion *mr); > > * @entry: the new entry in the IOMMU translation table. The entry > > * replaces all old entries for the same virtual I/O address range. > > * Deleted entries have .@perm == 0. > > + * @flag: type of IOMMU notification (IOMMU_RW, IOMMU_NONE) > > This makes no sense. The overall type of the notifier is already > noted in register / notify_start. The permission on this specific > mapping is already included in the IOMMUTLBEntry.
This is not meant to be the same as the one in IOMMUTLBEntry. For example, we can have: memory_region_notify_iommu(..., entry, IOMMU_RW); This means that the caller of notification will notify all changed entries (will only be used for checking, see the assert() in memory_region_notify_iommu()). While within the entry, we can have: entry.perm == IOMMU_NONE Which means that this specific invalidation is an unmap() operation. The naming is bad. We can put this aside and see whether we can have better solution in general... Thanks, -- peterx