vhost-vdpa: support ASID based IOTLB API
authorGautam Dawar <gautam.dawar@xilinx.com>
Wed, 30 Mar 2022 18:03:55 +0000 (23:33 +0530)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 31 May 2022 16:44:32 +0000 (12:44 -0400)
commitaaca8373c4b1e010b8d748fc99d929de1bf860b8
treeaf14a2e0e3321c4308f322813ca28dfc4b6b685d
parent84d7c8fd3aade2fe79313003ed06ede431ec2a6d
vhost-vdpa: support ASID based IOTLB API

This patch extends the vhost-vdpa to support ASID based IOTLB API. The
vhost-vdpa device will allocated multiple IOTLBs for vDPA device that
supports multiple address spaces. The IOTLBs and vDPA device memory
mappings is determined and maintained through ASID.

Note that we still don't support vDPA device with more than one
address spaces that depends on platform IOMMU. This work will be done
by moving the IOMMU logic from vhost-vDPA to vDPA device driver.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Gautam Dawar <gdawar@xilinx.com>
Message-Id: <20220330180436.24644-16-gdawar@xilinx.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Includes fixup:

vhost-vdpa: Fix some error handling path in vhost_vdpa_process_iotlb_msg()

In the error paths introduced by the original patch, a mutex may be left locked.
Add the correct goto instead of a direct return.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <89ef0ae4c26ac3cfa440c71e97e392dcb328ac1b.1653227924.git.christophe.jaillet@wanadoo.fr>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vdpa.c
drivers/vhost/vhost.c