Jason Wang
2021-Oct-13 05:34 UTC
[RFC PATCH v4 20/20] vdpa: Add custom IOTLB translations to SVQ
? 2021/10/1 ??3:06, Eugenio P?rez ??:> Use translations added in VhostIOVATree in SVQ. > > Now every element needs to store the previous address also, so VirtQueue > can consume the elements properly. This adds a little overhead per VQ > element, having to allocate more memory to stash them. As a possible > optimization, this allocation could be avoided if the descriptor is not > a chain but a single one, but this is left undone. > > TODO: iova range should be queried before, and add logic to fail when > GPA is outside of its range and memory listener or svq add it. > > Signed-off-by: Eugenio P?rez<eperezma at redhat.com> > --- > hw/virtio/vhost-shadow-virtqueue.h | 4 +- > hw/virtio/vhost-shadow-virtqueue.c | 130 ++++++++++++++++++++++++----- > hw/virtio/vhost-vdpa.c | 40 ++++++++- > hw/virtio/trace-events | 1 + > 4 files changed, 152 insertions(+), 23 deletions(-)Think hard about the whole logic. This is safe since qemu memory map will fail if guest submits a invalidate IOVA. Then I wonder if we do something much more simpler: 1) Using qemu VA as IOVA but only maps the VA that belongs to guest 2) Then we don't need any IOVA tree here, what we need is to just map vring and use qemu VA without any translation Thanks