vdpa/mlx5: Avoid overwriting CVQ iotlb
authorEli Cohen <elic@nvidia.com>
Mon, 14 Nov 2022 13:17:56 +0000 (15:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:24:31 +0000 (07:24 +0100)
commitaf3fca732e9ab84134547c0e36c5a453b2848ddb
tree2c4550e82dc238899ce98a80b1de14806a399641
parent909b96557b38ea4bf99f5ab7dc8d6d339a96ab60
vdpa/mlx5: Avoid overwriting CVQ iotlb

[ Upstream commit 38fc462f57ef4e5dc722bab6824854b105de8aa2 ]

When qemu uses different address spaces for data and control virtqueues,
the current code would overwrite the control virtqueue iotlb through the
dup_iotlb call. Fix this by referring to the address space identifier
and the group to asid mapping to determine which mapping needs to be
updated. We also move the address space logic from mlx5 net to core
directory.

Reported-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Eli Cohen <elic@nvidia.com>
Message-Id: <20221114131759.57883-6-elic@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/mlx5/core/mlx5_vdpa.h
drivers/vdpa/mlx5/core/mr.c
drivers/vdpa/mlx5/net/mlx5_vnet.c