]> git.ipfire.org Git - thirdparty/qemu.git/commit
vhost: Add VhostIOVATree
authorEugenio Pérez <eperezma@redhat.com>
Mon, 14 Mar 2022 17:34:50 +0000 (18:34 +0100)
committerJason Wang <jasowang@redhat.com>
Tue, 15 Mar 2022 05:57:44 +0000 (13:57 +0800)
commitec6122d8828e0e1268ec520542f8a7622d84f571
tree5e4d9ae114742353a3e972da46026729dd99663f
parent193d17be0b84cce87db4426622cd4e6b827cae2a
vhost: Add VhostIOVATree

This tree is able to look for a translated address from an IOVA address.

At first glance it is similar to util/iova-tree. However, SVQ working on
devices with limited IOVA space need more capabilities, like allocating
IOVA chunks or performing reverse translations (qemu addresses to iova).

The allocation capability, as "assign a free IOVA address to this chunk
of memory in qemu's address space" allows shadow virtqueue to create a
new address space that is not restricted by guest's addressable one, so
we can allocate shadow vqs vrings outside of it.

It duplicates the tree so it can search efficiently in both directions,
and it will signal overlap if iova or the translated address is present
in any tree.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/virtio/meson.build
hw/virtio/vhost-iova-tree.c [new file with mode: 0644]
hw/virtio/vhost-iova-tree.h [new file with mode: 0644]