]> git.baikalelectronics.ru Git - kernel.git/commit
vfio: remove useless judgement
authorLi Zhe <lizhe.67@bytedance.com>
Mon, 27 Jun 2022 03:51:09 +0000 (11:51 +0800)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 30 Jun 2022 17:02:40 +0000 (11:02 -0600)
commitd1b951c7902e5bbd5166b869e4a61d80ecd512b2
tree5c701aa645b723ceedf716665fd954b82494776e
parente6660b17db02fcf06fc6ff3e0d2d300b22824f0e
vfio: remove useless judgement

In function vfio_dma_do_unmap(), we currently prevent process to unmap
vfio dma region whose mm_struct is different from the vfio_dma->task.
In our virtual machine scenario which is using kvm and qemu, this
judgement stops us from liveupgrading our qemu, which uses fork() &&
exec() to load the new binary but the new process cannot do the
VFIO_IOMMU_UNMAP_DMA action during vm exit because of this judgement.

This judgement is added in commit 81597c834158 ("vfio iommu type1: Add
task structure to vfio_dma") for the security reason. But it seems that
no other task who has no family relationship with old and new process
can get the same vfio_dma struct here for the reason of resource
isolation. So this patch delete it.

Signed-off-by: Li Zhe <lizhe.67@bytedance.com>
Reviewed-by: Jason Gunthorpe <jgg@ziepe.ca>
Link: https://lore.kernel.org/r/20220627035109.73745-1-lizhe.67@bytedance.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_type1.c