linux/drivers/vdpa
Eli Cohen 08dbd56602 vdpa/mlx5: Avoid destroying MR on empty iotlb
The current code treats an empty iotlb provdied in set_map() as a
special case and destroy the memory region object. This must not be done
since the virtqueue objects reference this MR. Doing so will cause the
driver unload to emit errors and log timeouts caused by the firmware
complaining on busy resources.

This patch treats an empty iotlb as any other change of mapping. In this
case, mlx5_vdpa_create_mr() will fail and the entire set_map() call to
fail.

This issue has not been encountered before but was seen to occur in a
non-official version of qemu. Since qemu is a userspace program, the
driver must protect against such case.

Fixes: 94abbccdf2 ("vdpa/mlx5: Add shared memory registration code")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20210811053713.66658-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2021-08-11 06:44:41 -04:00
..
ifcvf vDPA/ifcvf: Fix return value check for vdpa_alloc_device() 2021-08-11 06:44:23 -04:00
mlx5 vdpa/mlx5: Avoid destroying MR on empty iotlb 2021-08-11 06:44:41 -04:00
vdpa_sim vdpa_sim: Fix return value check for vdpa_alloc_device() 2021-08-11 06:44:23 -04:00
virtio_pci vp_vdpa: Fix return value check for vdpa_alloc_device() 2021-08-11 06:44:23 -04:00
Kconfig vdpa: add vdpa simulator for block device 2021-05-03 04:55:53 -04:00
Makefile vdpa: introduce virtio pci driver 2021-05-03 04:55:51 -04:00
vdpa.c vdpa: Follow kdoc comment style 2021-05-03 04:55:51 -04:00