linux-stable/drivers/vdpa
Steve Sistare 8ea2b4ba9b vdpa/mlx5: preserve CVQ vringh index
[ Upstream commit 480b3e7372 ]

mlx5_vdpa does not preserve userland's view of vring base for the control
queue in the following sequence:

ioctl VHOST_SET_VRING_BASE
ioctl VHOST_VDPA_SET_STATUS VIRTIO_CONFIG_S_DRIVER_OK
  mlx5_vdpa_set_status()
    setup_cvq_vring()
      vringh_init_iotlb()
        vringh_init_kern()
          vrh->last_avail_idx = 0;
ioctl VHOST_GET_VRING_BASE

To fix, restore the value of cvq->vring.last_avail_idx after calling
vringh_init_iotlb.

Fixes: 5262912ef3 ("vdpa/mlx5: Add support for control VQ and MAC setting")

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <1699014387-194368-1-git-send-email-steven.sistare@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:39:03 +01:00
..
alibaba
ifcvf vDPA/ifcvf: allocate the adapter in dev_add() 2023-03-11 13:55:42 +01:00
mlx5 vdpa/mlx5: preserve CVQ vringh index 2023-12-13 18:39:03 +01:00
vdpa_sim vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready 2023-03-22 13:33:44 +01:00
vdpa_user vduse: Use proper spinlock for IRQ injection 2023-08-23 17:52:29 +02:00
virtio_pci vp_vdpa: fix the crash in hot unplug with vp_vdpa 2023-03-22 13:34:03 +01:00
Kconfig
Makefile
vdpa.c vdpa: Enable strict validation for netlinks ops 2023-08-23 17:52:31 +02:00