On 2017年01月19日 11:32, Peter Xu wrote:
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?

[...]

Yes.


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

I think the trick is if guest knows device has device IOTLB, it will explicit flush with accurate iova range.

Thanks


Reply via email to