[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/25] vhost-user: document memory accesses
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 20/25] vhost-user: document memory accesses |
Date: |
Thu, 21 Dec 2017 16:29:45 +0200 |
From: Stefan Hajnoczi <address@hidden>
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 <address@hidden>
Cc: Maxime Coquelin <address@hidden>
Cc: Wei Wang <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Acked-by: Maxime Coquelin <address@hidden>
---
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 fd8ac56..d49444e 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
-------------
--
MST
- [Qemu-devel] [PULL 08/25] pci: Eliminate redundant PCIDevice::bus pointer, (continued)
- [Qemu-devel] [PULL 08/25] pci: Eliminate redundant PCIDevice::bus pointer, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 12/25] tests/pxe-test: Use table of testcases rather than open-coding, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 13/25] tests/pxe-test: Test net booting over IPv6 in some cases, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 15/25] hw/block/nvme: QOM'ify PCI NVME, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 16/25] hw/pci-host/piix: QOM'ify the IGD Passthrough host bridge, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 17/25] hw/pci-host/xilinx: QOM'ify the AXI-PCIe host bridge, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 18/25] hw/pci: remove obsolete PCIDevice->init(), Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 19/25] vhost-user: fix indentation in protocol specification, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 20/25] vhost-user: document memory accesses,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 23/25] virtio-pci: Don't force Subsystem Vendor ID = Vendor ID, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 25/25] smbus: do not immediately complete commands, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 24/25] dump-guest-memory.py: fix "You can't do that without a process to debug", Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 21/25] intel_iommu: remove X86_IOMMU_PCI_DEVFN_MAX, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 22/25] intel_iommu: fix error param in string, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Peter Maydell, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Peter Maydell, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Philippe Mathieu-Daudé, 2017/12/21