vfio/iommu_type1: Populate full dirty when detach non-pinned group
authorKeqian Zhu <zhukeqian1@huawei.com>
Fri, 22 Jan 2021 09:26:34 +0000 (17:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:13 +0000 (11:38 +0100)
commita8fe0b750a9456b6318625d6d27d26c89a62efe1
tree6f79ed42a4dc48e5246b0271aa6904506adef8cd
parentc1fe9383139a4708e137ef53e08780cc17994cd1
vfio/iommu_type1: Populate full dirty when detach non-pinned group

[ Upstream commit d0a78f91761fcd837da1e7a4b0f8368873adc646 ]

If a group with non-pinned-page dirty scope is detached with dirty
logging enabled, we should fully populate the dirty bitmaps at the
time it's removed since we don't know the extent of its previous DMA,
nor will the group be present to trigger the full bitmap when the user
retrieves the dirty bitmap.

Fixes: d6a4c185660c ("vfio iommu: Implementation of ioctl for dirty pages tracking")
Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vfio/vfio_iommu_type1.c