On Wed, Jan 18, 2017 at 06:06:57PM +0800, Jason Wang wrote: [...]
> So I think we should implement DSI and GLOBAL for vfio in this case. We can > first try to implement it through current VFIO API which can accepts a range > of iova. If not possible, let's discuss for other possible solutions. Do you mean VFIO_IOMMU_UNMAP_DMA here? [...] > >If my understanding above is correct, there is nothing wrong with > >above IOMMU driver code - actually it makes sense on bare metal > >when CM is disabled. > > > >But yes, DSI/GLOBAL is far less efficient than PSI when CM is enabled. > >We rely on cache invalidations to indirectly capture remapping structure > >change. PSI provides accurate info, while DSI/GLOBAL doesn't. To > >emulate correct behavior of DSI/GLOBAL, we have to pretend that > >the whole address space (iova=0, size=agaw) needs to be unmapped > >(for GLOBAL it further means multiple address spaces) > > Maybe a trick to have accurate info is virtual Device IOTLB. Could you elaborate a bit on this? Thanks, -- peterx