Currently, VFIO IOMMU type1 unmaps IOVA pages synchronously, which requires
IOTLB flush for every IOVA unmap. This results in a large number of IOTLB
flushes during initialization of pass-through devices.
This can be avoided using the asynchronous (fast) IOTLB flush interface.
Cc: Alex Williamson<alex.williamson@xxxxxxxxxx>
Cc: Joerg Roedel<joro@xxxxxxxxxx>
Signed-off-by: Suravee Suthikulpanit<suravee.suthikulpanit@xxxxxxx>
---
Changes from v3 (https://lkml.org/lkml/2018/1/21/244)
* Refactor the code to unmap_unpin_fast() and unmap_unpin_slow()
to improve code readability.
* Fix logic in vfio_unmap_unpin() to fallback to unmap_unpin_slow()
only for the failing iova unmapping, and continue the next unmapping
with the unmap_unpin_fast(). (per Alex)
* Fix error handling in case of failing to do fast unmapping to warn
only once.
* Remove reference to GPU in the commit message.