vhost: fix vq dirty bitmap syncing when vIOMMU is enabled
commit345cc1cbcbce2bab00abc2b88338d7d89c702d6b
authorJason Wang <jasowang@redhat.com>
Fri, 16 Dec 2022 03:35:52 +0000 (16 11:35 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 21 Dec 2022 12:32:24 +0000 (21 07:32 -0500)
tree705691098b0b4d62fdebe8f27c8aa1556a534684
parent5a37392411d0a2131852509385a70ec7bfa41595
vhost: fix vq dirty bitmap syncing when vIOMMU is enabled

When vIOMMU is enabled, the vq->used_phys is actually the IOVA not
GPA. So we need to translate it to GPA before the syncing otherwise we
may hit the following crash since IOVA could be out of the scope of
the GPA log size. This could be noted when using virtio-IOMMU with
vhost using 1G memory.

Fixes: c471ad0e9bd46 ("vhost_net: device IOTLB support")
Cc: qemu-stable@nongnu.org
Tested-by: Lei Yang <leiyang@redhat.com>
Reported-by: Yalan Zhang <yalzhang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20221216033552.77087-1-jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost.c