On 17/07/2024 07:21, David Gibson wrote:
On Fri, Jul 12, 2024 at 05:32:42PM +0200, Laurent
Vivier wrote:
> Add virtio.c and virtio.h that define the functions needed
> to manage virtqueues.
>
> Signed-off-by: Laurent Vivier <lvivier(a)redhat.com>
> ---
> Makefile | 4 +-
> util.h | 11 +
> virtio.c | 611 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> virtio.h | 190 +++++++++++++++++
> 4 files changed, 814 insertions(+), 2 deletions(-)
> create mode 100644 virtio.c
> create mode 100644 virtio.h
>
...
+
+/**
+ * struct vu_dev_region - guest shared memory region
+ * @gpa: Guest physical address of the region
+ * @size: Memory size in bytes
+ * @qva: QEMU virtual address
Is this actually the qemu virtual address? Or is it our virtual
address?
It is actually QEMU virtual address, it's a virtual address provided by the
front-end (in our case QEMU).
Ok.
https://qemu-project.gitlab.io/qemu/interop/vhost-user.html#memory-region-d…
It's used in qva_to_va() to convert vring addresses that are in QEMU
userspace (vhost-user) to our process userspace mapped address, while
vu_gpa_to_va() is used to convert guest physical address (virtio) of buffers
address stored vring descritors that are in guest physical address space to
our process address space.
vhost-user addresses are in QEMU virtual adress space, virtio addresses are
in guest physical address space.
Thansk,
Laurent
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.