* [Qemu-devel] [PATCH 0/2] vhost-user: document memory accesses
@ 2017-12-14 20:22 Stefan Hajnoczi
2017-12-14 20:22 ` [Qemu-devel] [PATCH 1/2] vhost-user: fix indentation in protocol specification Stefan Hajnoczi
2017-12-14 20:22 ` [Qemu-devel] [PATCH 2/2] vhost-user: document memory accesses Stefan Hajnoczi
0 siblings, 2 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2017-12-14 20:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
These patches document how memory accesses work and fix indentation in the
vhost-user protocol specification.
Stefan Hajnoczi (2):
vhost-user: fix indentation in protocol specification
vhost-user: document memory accesses
docs/interop/vhost-user.txt | 37 ++++++++++++++++++++++++++++++++-----
1 file changed, 32 insertions(+), 5 deletions(-)
--
2.14.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 1/2] vhost-user: fix indentation in protocol specification
2017-12-14 20:22 [Qemu-devel] [PATCH 0/2] vhost-user: document memory accesses Stefan Hajnoczi
@ 2017-12-14 20:22 ` Stefan Hajnoczi
2017-12-14 20:22 ` [Qemu-devel] [PATCH 2/2] vhost-user: document memory accesses Stefan Hajnoczi
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2017-12-14 20:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
docs/interop/vhost-user.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/interop/vhost-user.txt b/docs/interop/vhost-user.txt
index 954771d0d8..fd8ac56562 100644
--- a/docs/interop/vhost-user.txt
+++ b/docs/interop/vhost-user.txt
@@ -53,8 +53,8 @@ Depending on the request type, payload can be:
* A vring state description
---------------
- | index | num |
- ---------------
+ | index | num |
+ ---------------
Index: a 32-bit index
Num: a 32-bit number
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 2/2] vhost-user: document memory accesses
2017-12-14 20:22 [Qemu-devel] [PATCH 0/2] vhost-user: document memory accesses Stefan Hajnoczi
2017-12-14 20:22 ` [Qemu-devel] [PATCH 1/2] vhost-user: fix indentation in protocol specification Stefan Hajnoczi
@ 2017-12-14 20:22 ` Stefan Hajnoczi
2017-12-19 12:42 ` Maxime Coquelin
1 sibling, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2017-12-14 20:22 UTC (permalink / raw)
To: qemu-devel
Cc: Stefan Hajnoczi, Michael S . Tsirkin, Maxime Coquelin, Wei Wang
The vhost-user protocol specification does not define "guest address"
and "user address". It does not explain how to access memory given such
addresses.
This patch explains how memory access works, including the IOTLB.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: Wei Wang <wei.w.wang@intel.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
docs/interop/vhost-user.txt | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/docs/interop/vhost-user.txt b/docs/interop/vhost-user.txt
index fd8ac56562..d49444e037 100644
--- a/docs/interop/vhost-user.txt
+++ b/docs/interop/vhost-user.txt
@@ -66,11 +66,14 @@ Depending on the request type, payload can be:
Index: a 32-bit vring index
Flags: a 32-bit vring flags
- Descriptor: a 64-bit user address of the vring descriptor table
- Used: a 64-bit user address of the vring used ring
- Available: a 64-bit user address of the vring available ring
+ Descriptor: a 64-bit ring address of the vring descriptor table
+ Used: a 64-bit ring address of the vring used ring
+ Available: a 64-bit ring address of the vring available ring
Log: a 64-bit guest address for logging
+ Note that a ring address is an IOVA if VIRTIO_F_IOMMU_PLATFORM has been
+ negotiated. Otherwise it is a user address.
+
* Memory regions description
---------------------------------------------------
| num regions | padding | region0 | ... | region7 |
@@ -273,6 +276,30 @@ Once the source has finished migration, rings will be stopped by
the source. No further update must be done before rings are
restarted.
+Memory access
+-------------
+
+The master sends a list of vhost memory regions to the slave using the
+VHOST_USER_SET_MEM_TABLE message. Each region has two base addresses: a guest
+address and a user address.
+
+Messages contain guest addresses and/or user addresses to reference locations
+within the shared memory. The mapping of these addresses works as follows.
+
+User addresses map to the vhost memory region containing that user address.
+
+When the VIRTIO_F_IOMMU_PLATFORM feature has not been negotiated:
+
+ * Guest addresses map to the vhost memory region containing that guest
+ address.
+
+When the VIRTIO_F_IOMMU_PLATFORM feature has been negotiated:
+
+ * Guest addresses are also called I/O virtual addresses (IOVAs). They are
+ translated to user addresses via the IOTLB.
+
+ * The vhost memory region guest address is not used.
+
IOMMU support
-------------
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] vhost-user: document memory accesses
2017-12-14 20:22 ` [Qemu-devel] [PATCH 2/2] vhost-user: document memory accesses Stefan Hajnoczi
@ 2017-12-19 12:42 ` Maxime Coquelin
0 siblings, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2017-12-19 12:42 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel; +Cc: Michael S . Tsirkin, Wei Wang
On 12/14/2017 09:22 PM, Stefan Hajnoczi wrote:
> The vhost-user protocol specification does not define "guest address"
> and "user address". It does not explain how to access memory given such
> addresses.
>
> This patch explains how memory access works, including the IOTLB.
>
> Cc: Michael S. Tsirkin<mst@redhat.com>
> Cc: Maxime Coquelin<maxime.coquelin@redhat.com>
> Cc: Wei Wang<wei.w.wang@intel.com>
> Signed-off-by: Stefan Hajnoczi<stefanha@redhat.com>
> ---
> docs/interop/vhost-user.txt | 33 ++++++++++++++++++++++++++++++---
> 1 file changed, 30 insertions(+), 3 deletions(-)
Thanks for this spec clarification Stefan:
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-19 12:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-14 20:22 [Qemu-devel] [PATCH 0/2] vhost-user: document memory accesses Stefan Hajnoczi
2017-12-14 20:22 ` [Qemu-devel] [PATCH 1/2] vhost-user: fix indentation in protocol specification Stefan Hajnoczi
2017-12-14 20:22 ` [Qemu-devel] [PATCH 2/2] vhost-user: document memory accesses Stefan Hajnoczi
2017-12-19 12:42 ` Maxime Coquelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).