vfio: Selective dirty page tracking if IOMMU backed device pins pages
authorKirti Wankhede <kwankhede@nvidia.com>
Thu, 28 May 2020 20:30:54 +0000 (02:00 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 28 May 2020 21:53:29 +0000 (15:53 -0600)
commit95fc87b44104d9a524ff3e975bbfbd7c1f1a2dd5
tree1420b947b3110167824c06347cabc2ef2dfa19de
parentad721705d09c62f0d108a6b4f59867ebfd592c90
vfio: Selective dirty page tracking if IOMMU backed device pins pages

Added a check such that only singleton IOMMU groups can pin pages.
>From the point when vendor driver pins any pages, consider IOMMU group
dirty page scope to be limited to pinned pages.

To optimize to avoid walking list often, added flag
pinned_page_dirty_scope to indicate if all of the vfio_groups for each
vfio_domain in the domain_list dirty page scope is limited to pinned
pages. This flag is updated on first pinned pages request for that IOMMU
group and on attaching/detaching group.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio.c
drivers/vfio/vfio_iommu_type1.c
include/linux/vfio.h