aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2014-06-26 23:01:32 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-06-29 19:39:40 +0300
commit3fd74b84076488ae44ba5f3cfed22ff056c5199c (patch)
tree5780453adca5f1b8f6ad52b572d06330c323f873 /docs
parent12d6e4640ce28d002e96d58c31cd5e7256258626 (diff)
vhost-user: fix regions provied with VHOST_USER_SET_MEM_TABLE message
Old code was affected by memory gaps which resulted in buffer pointers pointing to address outside of the mapped regions. Here we are introducing following changes: - new function qemu_get_ram_block_host_ptr() returns host pointer to the ram block, it is needed to calculate offset of specific region in the host memory - new field mmap_offset is added to the VhostUserMemoryRegion. It contains offset where specific region starts in the mapped memory. As there is stil no wider adoption of vhost-user agreement was made that we will not bump version number due to this change - other fileds in VhostUserMemoryRegion struct are not changed, as they are all needed for usermode app implementation - region data is not taken from ram_list.blocks anymore, instead we use region data which is alredy calculated for use in vhost-net - Now multiple regions can have same FD and user applicaton can call mmap() multiple times with the same FD but with different offset (user needs to take care for offset page alignment) Signed-off-by: Damjan Marion <damarion@cisco.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/specs/vhost-user.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt
index 2641390244..6abb6977ff 100644
--- a/docs/specs/vhost-user.txt
+++ b/docs/specs/vhost-user.txt
@@ -78,13 +78,14 @@ Depending on the request type, payload can be:
Padding: 32-bit
A region is:
- ---------------------------------------
- | guest address | size | user address |
- ---------------------------------------
+ -----------------------------------------------------
+ | guest address | size | user address | mmap offset |
+ -----------------------------------------------------
Guest address: a 64-bit guest address of the region
Size: a 64-bit size
User address: a 64-bit user address
+ mmmap offset: 64-bit offset where region starts in the mapped memory
In QEMU the vhost-user message is implemented with the following struct: