]> xenbits.xensource.com Git - qemu-xen.git/commit
vhost: fix vq dirty bitmap syncing when vIOMMU is enabled
authorJason Wang <jasowang@redhat.com>
Fri, 16 Dec 2022 03:35:52 +0000 (11:35 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 29 Mar 2023 07:20:04 +0000 (10:20 +0300)
commitf16011abc161e0fa6ac2bea78aa7ebacfb173e59
treecc3790bee99ce3218f6b76885d866ea7e6e50c34
parente34f86a2f91c39d610d58baa6f4c9ed9a5a5d791
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>
(cherry picked from commit 345cc1cbcbce2bab00abc2b88338d7d89c702d6b)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/virtio/vhost.c