linux-stable/drivers/vdpa/vdpa_sim
Si-Wei Liu 86f6c224c9 vdpa_sim: implement .reset_map support
In order to reduce excessive memory mapping cost in live migration and
VM reboot, it is desirable to decouple the vhost-vdpa IOTLB abstraction
from the virtio device life cycle, i.e. mappings can be kept intact
across virtio device reset. Leverage the .reset_map callback, which is
meant to destroy the iotlb on the given ASID and recreate the 1:1
passthrough/identity mapping. To be consistent, the mapping on device
creation is initiailized to passthrough/identity with PA 1:1 mapped as
IOVA. With this the device .reset op doesn't have to maintain and clean
up memory mappings by itself.

Additionally, implement .compat_reset to cater for older userspace,
which may wish to see mapping to be cleared during reset.

Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Tested-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <1697880319-4937-8-git-send-email-si-wei.liu@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
2023-11-01 09:20:00 -04:00
..
Makefile vdpa: add vdpa simulator for block device 2021-05-03 04:55:53 -04:00
vdpa_sim.c vdpa_sim: implement .reset_map support 2023-11-01 09:20:00 -04:00
vdpa_sim.h vdpa_sim: move buffer allocation in the devices 2023-04-21 03:02:35 -04:00
vdpa_sim_blk.c vdpa_sim_blk: Fix the potential leak of mgmt_dev 2023-10-18 11:28:47 -04:00
vdpa_sim_net.c vdpa_sim: move buffer allocation in the devices 2023-04-21 03:02:35 -04:00