vhost-vdpa: reset vendor specific mapping to initial state in .release
authorSi-Wei Liu <si-wei.liu@oracle.com>
Sat, 21 Oct 2023 09:25:14 +0000 (02:25 -0700)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 1 Nov 2023 13:19:59 +0000 (09:19 -0400)
commit1d0f874bfe7871837fb215999979284d579fc373
tree1878a1c26cca83ef1ac64f2c611d76e9cc080bb0
parentd2cf1b6e3b85dcb2bb3e8cd7924beede34fbbf0e
vhost-vdpa: reset vendor specific mapping to initial state in .release

Devices with on-chip IOMMU or vendor specific IOTLB implementation may
need to restore iotlb mapping to the initial or default state using the
.reset_map op, as it's desirable for some parent devices to not work
with DMA ops and maintain a simple IOMMU model with .reset_map. In
particular, device reset should not cause mapping to go away on such
IOTLB model, so persistent mapping is implied across reset. Before the
userspace process using vhost-vdpa is gone, give it a chance to reset
iotlb back to the initial state in vhost_vdpa_cleanup().

Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Acked-by: Eugenio PĂ©rez <eperezma@redhat.com>
Message-Id: <1697880319-4937-3-git-send-email-si-wei.liu@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
drivers/vhost/vdpa.c