vfio iommu: Cache pgsize_bitmap in struct vfio_iommu
authorKirti Wankhede <kwankhede@nvidia.com>
Thu, 28 May 2020 20:30:49 +0000 (02:00 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 28 May 2020 21:53:22 +0000 (15:53 -0600)
commitcade075f265b25c3d6c13486e1bf0fbed9935a4a
tree1507e65767a1842c4d835a9f71315de5800c646b
parent6581708586c812460ea4798216d9dd2897ad105c
vfio iommu: Cache pgsize_bitmap in struct vfio_iommu

Calculate and cache pgsize_bitmap when iommu->domain_list is updated
and iommu->external_domain is set for mdev device.
Add iommu->lock protection when cached pgsize_bitmap is accessed.

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