]> git.baikalelectronics.ru Git - kernel.git/commit
vfio iommu type1: Add task structure to vfio_dma
authorKirti Wankhede <kwankhede@nvidia.com>
Wed, 16 Nov 2016 20:46:21 +0000 (02:16 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 17 Nov 2016 15:25:09 +0000 (08:25 -0700)
commitad4590223de72e382bed8df3cbe8c9678b989e3d
treebec8ce0bfe39b99177adb540b0084bfd83c887fd
parentf0bc18d25da9deb9e82584213ebd5daffed3b040
vfio iommu type1: Add task structure to vfio_dma

Add task structure to vfio_dma structure. Task structure is used for:
- During DMA_UNMAP, same task who mapped it or other task who shares same
address space is allowed to unmap, otherwise unmap fails.
QEMU maps few iova ranges initially, then fork threads and from the child
thread calls DMA_UNMAP on previously mapped iova. Since child shares same
address space, DMA_UNMAP is successful.
- Avoid accessing struct mm while process is exiting by acquiring
reference of task's mm during page accounting.
- It is also used to get task mlock capability and rlimit for mlock.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Neo Jia <cjia@nvidia.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_type1.c