On Fri, Oct 21, 2016 at 08:43:05AM -0600, Alex Williamson wrote: [...]
> > > Well, I think that would work. But I think it would be better to fix > > > it from the other side: > > > > > > We add the range to be notified into the IOMMUNotifier structure and > > > filter based on that range in memory_region_notify_iommu. > > > > > > It means a little more list searching and filtering on notify, but it > > > avoids having to have another list and search on the VFIO side. I > > > think it will also better deal with cases where part of an IOMMU > > > mapped region is inaccessible due to an intermediate bridge. > > > > IIUC, this will still need to keep several VFIOGuestIOMMUs which > > contains exactly the same content? > > The contain different offsets since this is based on the section rather > than the MemoryRegion. Thanks, Though vfio_listener_region_add() is per memory region section, VFIOGuestIOMMU looks like to be for memory region? See in vfio_listener_region_add(): giommu->iommu_offset = section->offset_within_address_space - section->offset_within_region; Here VFIOGuestIOMMU.iommu_offset should be the offset of memory region (rather than memory region section offset), right? Thanks, -- peterx