aboutsummaryrefslogtreecommitdiff
path: root/docs
AgeCommit message (Collapse)AuthorFilesLines
2023-09-18Add some notes on live migration version and SPDK usage. (#783)John Levon1-0/+5
Signed-off-by: John Levon <john.levon@nutanix.com>
2023-09-15adapt to VFIO live migration v2 (#782)William Henderson1-373/+463
This commit adapts the vfio-user protocol specification and the libvfio-user implementation to v2 of the VFIO live migration interface, as used in the kernel and QEMU. The differences between v1 and v2 are discussed in this email thread [1], and we slightly differ from upstream VFIO v2 in that instead of transferring data over a new FD, we use the existing UNIX socket with new commands VFIO_USER_MIG_DATA_READ/WRITE. We also don't yet use P2P states. The updated spec was submitted to qemu-devel [2]. [1] https://lore.kernel.org/all/20220130160826.32449-9-yishaih@nvidia.com/ [2] https://lore.kernel.org/all/20230718094150.110183-1-william.henderson@nutanix.com/ Signed-off-by: William Henderson <william.henderson@nutanix.com>
2023-09-15Describe the twin-socket feature in the spec (#775)Mattias Nissler1-8/+83
Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
2023-08-31update SDPK version spdk.md (#769)Thanos Makatos1-5/+5
The SPDK and QEMU versions were too old. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2023-08-02docs: document test debugging with GDB (#756)William Henderson1-0/+12
Signed-off-by: William Henderson <william.henderson@nutanix.com>
2023-07-31docs: document DMA message dirty handling (#755)John Levon1-2/+6
Document that on vfu_sgl_write(), it's the client's responsibility to track any dirty pages. Signed-off-by: John Levon <john.levon@nutanix.com>
2022-11-22shadow ioeventfd: add demo (#722)Thanos Makatos1-0/+31
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-10-03document how to run individual Python unit tests (#712)Thanos Makatos1-0/+7
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-07-04support for shadow ioeventfd (#698)Thanos Makatos1-0/+25
When an ioeventfd is written to, KVM discards the value since it has no memory to write it to, and simply kicks the eventfd. This a problem for devices such a NVMe controllers that need the value (e.g. doorbells on BAR0). This patch allows the vfio-user server to pass a file descriptor that can be mmap'ed and KVM can write the ioeventfd value to this _shadow_ memory instead of discarding it. This shadow memory is not exposed to the guest. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com> Change-Id: Iad849c94076ffa5988e034c8bf7ec312d01f095f
2022-05-27add some documentation on memory handling (#676)John Levon1-0/+139
Cover briefly how to access client memory. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-05-23libvfio-user.h: sync VFIO_DEVICE_STATE_XXXX definitions with upstream (#690)Jag Raman1-25/+25
Rename VFIO_DEVICE_STATE_XXXX defines as VFIO_DEVICE_STATE_V1_XXXX. Upstream renamed these variable to be of the XXXX_V1_XXXX format and switched an enum for VFIO_DEVICE_STATE_XXXX. Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Reviewed-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-05-16add a diagram to README.md (#686)John Levon2-0/+1
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-05-09docs: rewrite to refer to meson commands instead of cmakeDaniel P. Berrangé1-11/+64
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09build: introduce Meson build file rulesDaniel P. Berrangé1-0/+9
The Meson build system used by many other virt projects (QEMU, libvirt and others) is easier to understand & maintain rules for than cmake, guiding towards best practice. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09docs: drop mention of libssl-dev package for testingDaniel P. Berrangé1-1/+2
Use of libssl-dev was dropped in commit bc44bd1a246dc95b91faae30defafc3c259f5c4d Author: John Levon <john.levon@nutanix.com> Date: Mon May 9 09:58:02 2022 +0100 drop usage of MD5_*() (#667) Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-21support AFL++ fuzzing (#623)John Levon1-0/+35
To support fuzzing with AFL++, add a "pipe" transport that reads from stdin and outputs to stdout: this is the most convenient way of doing fuzzing. Add some docs on how to run a fuzzing session. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-04-06document live migration for SPDK (#659)Thanos Makatos1-0/+54
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-01-25fix a small typo in docs (#638)John Levon1-1/+1
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-12-01add SPDK instructions (#632)Thanos Makatos1-0/+61
And move them to separate file. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-11-30introduce device quiesce callback (#609)Thanos Makatos1-0/+7
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Leon <john.levon@nutanix.com>
2021-11-12add a doc on testingJohn Levon1-0/+17
Split out testing information to a separate document. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-09-08initial ioeventfd support (#601)JAKelly101-6/+6
Provide initial support for handling VFIO_USER_DEVICE_GET_REGION_IO_FDS, along with a new vfu_create_ioeventfd() API. Reviewed-by: John Levon <john.levon@nutanix.com>
2021-08-27Add support for VFIO_DMA_UNMAP_FLAG_ALL flag (#600)Swapnil Ingle1-0/+5
* Add support for VFIO_DMA_UNMAP_FLAG_ALL flag Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-08-19docs/vfio-user.rst: Fix typo (#592)Swapnil Ingle1-1/+1
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-06-09don't allow portion of DMA region to be removed (#560)Thanos Makatos1-2/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-06-09spec: require DMA unmap to match exactly previous mapping (#559)Thanos Makatos1-1/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-06-09drop mappable flag from DMA map (#553)Thanos Makatos1-12/+9
The flags field belongs to VFIO and it's not a good idea to reuse as new VFIO flags can break things. Instead, we derive whether or not a region is mappable if a file descriptor is passed. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-06-02replace max_msg_size with max_data_xfer_size (#541)John Levon1-82/+85
The previously specified max_msg_size had one major issue: it implied a (way too small) limit on the size of dirty bitmaps that could be requested by a client, and as a result a hard limit on memory region size. It seemed awkward to attempt to split up an unmap request instead. Instead, let most requests and replies be limited by their "natural" limits; for example, the number of booleans in VFIO_USER_SET_IRQS is limited by MSI-X count. For the requests that solicit or provide data - that is, VFIO_USER_DMA_READ/WRITE and VFIO_USER_REGION_READ/WRITE - we negotiate a new max_data_xfer_size value. These are much easier to split up into separate requests at the client side so should not present an implementation problem. For our server, chunking is implemented in vfu_dma_read/vfu_dma_write(). Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-06-01fixes for VFIO_USER_DIRTY_PAGES (#537)John Levon1-25/+50
- we should only accept one range, not multiple ones - clearly define and implement argsz behaviour - we need to check if migration is configured - add proper test coverage; move existing testing to python Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-05-28restore argsz for DMA map/unmap (#523)Thanos Makatos1-70/+75
use DMA map/unmap format similar to VFIO's Using a DMA map/unmap format similar to VFIO's (vfio_iommu_type1_dma_map / vfio_iommu_type1_dma_unmap) makes it easier to adapt to future changes. Consequently we also honor the passed argsz. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanitx.com>
2021-05-27spec: allow exactly one DMA region to be added/removed per command (#530)Thanos Makatos1-45/+31
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-05-26spec: allow transitioning from stopped/stop-and-copy to running state (#516)Thanos Makatos1-2/+2
In cfe9901 we changed the code to allow transitioning from stopped/stop-and-copy to running state but forgot to udpate the spec. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-05-25more spec updates (#491)John Levon1-923/+850
update spec to v0.9.1 Changes include: - reply message includes the command number - split out message definitions into request/reply sections, and skip the repeated standard header definitions - lots of markup fixes - re-organization for clarity - further documentation of argsz - remove VFIO_USER_VM_INTERRUPT until we have a working implementation - dirty page tracking is optional - fix implementations to match the spec Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-05-24fix region offset handling (#485)John Levon1-3/+3
The specification states that the region offset given in the region info should be used as the "offset" when mmap()ing the region from the client side. However, the library instead implemented a fixed offset scheme similar to that of vfio - and no clients actually set up the file like that. Instead, let servers define their own offsets, and pass them through to clients as is. It's up to the server to decide how its backing file or files is organized. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-05-17fix DMA unmap dirty page bitmap section (#492)Thanos Makatos1-29/+38
fix DMA unmap dirty page bitmap section Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-05-14Fix dma read write count (#497)Swapnil Ingle1-2/+2
* spec: Fixed DMA_READ/WRITE data count DMA region size is maxed to uint64_t. Updated DMA_READ/WRITE data count to be defined as uint64_t. * Fix vfu_dma_read/write() as per spec changes Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-05-11some specification updates (#465)John Levon1-65/+69
Make a few specification updates after review by Stefan Hajnoczi. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-05-04stop using struct vfio_device_info (#456)John Levon1-7/+7
This struct from vfio.h has grown larger in newer Linux versions; this breaks older clients, as now the server would require the larger size. Replace with our own definition. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-04-13add ioeventfd/ioregionfd support to vfio-user spec (#437)John Levon1-40/+217
Update the spec to allow the library to request ioeventfd or ioregionfd to be set up by the client. This part of the specification remains strictly experimental, as we have no implementation, and ioregionfd is not merged into KVM at the time of writing. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-03-10fix IRQ disable path (#386)John Levon1-2/+4
Properly fix IRQ disabling: Allow count == 0 to mean "disable all IRQS of the given type". On our side, disabling an IRQ means forgetting about the eventfd that was previously passed over the socket. Allow individual IRQs to be disabled, by means of a VFIO_IRQ_SET_DATA_EVENTFD message with no file descriptors passed. In vfio, this is done via setting "-1" in the fd slots; which isn't possible via auxiliary data. Thus, only one IRQ can be disabled a a time in vfio-user. Clean up "->type": this is never set, so wasn't having any effect. Follow up changes will likely re-introduce this in some form. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-02-16fix DEVICE_GET_INFO specification and handling (#344)John Levon1-5/+6
The specification for DEVICE_GET_INFO differed from the implementation. After some discussion, fix the spec such that the struct should be passed in with ->argsz set. As it happened, the implementation was also wrong: we weren't actually checking the incoming ->argsz for validation, but we should. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-01-20reword explanation of how dirty bitmaps are returned for clarity (#234)Thanos Makatos1-16/+20
reword explanation of how dirty bitmaps are returned for clarity Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-17add copy of vfio-user protocol specification (v8)Thanos Makatos1-0/+1670
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>