aboutsummaryrefslogtreecommitdiff
path: root/test/py/test_dma_unmap.py
AgeCommit message (Collapse)AuthorFilesLines
2023-09-15adapt to VFIO live migration v2 (#782)William Henderson1-20/+0
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-08-31Introduce client object in python tests (#772)Mattias Nissler1-22/+22
Thus far, the client end of the socket is the only piece of client state tracked in tests, for which a global `socket` variable has been used. In preparation to add more state, replace the `socket` global with a `client` global object that groups all client state. Signed-off-by: Mattias Nissler <mnissler@rivosinc.com> Reviewed-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-10-04fix compilation for i386 and ppc64 (#709)Thanos Makatos1-18/+23
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com> Reported-by: Eduardo Lima <eblima@gmail.com>
2022-02-18test/py: simplify errno handling (#645)John Levon1-11/+11
We explicitly identify the quiesce EBUSY case for msg(), letting us simplify the handling of expected errno. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-11-30introduce device quiesce callback (#609)Thanos Makatos1-42/+72
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Leon <john.levon@nutanix.com>
2021-11-24verify region is mapped before acquiring dirty bitmap (#627)John Levon1-2/+42
DMA regions not mapped by the server are not dirty tracked (the client must track changes via handling VFIO_USER_DMA_WRITE), but we weren't correctly enforcing this, which could segfault when ->dirty_bitmap was NULL. Found via AFL++. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-11-24fix dma unmap validation (#626)John Levon1-2/+21
There were two issues with unmap request validation when the dirty bitmap flag was set: - we weren't checking ->argsz against the maximum transfer size, allowing a client to trigger unbounded allocations - we needed to check for overflow when calculating the requested message out size Found via AFL++. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-10-22run python code through flake8 (#613)John Levon1-4/+11
Aside from general style goodness, this found a couple of accidental re-definitions, so it's worth taking the pain now. Also, only run rstlint as part of pre-push. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-08-27Add support for VFIO_DMA_UNMAP_FLAG_ALL flag (#600)Swapnil Ingle1-1/+33
* 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-26Fix err path of handle_dma_unmap() (#597)Swapnil Ingle1-0/+79
* initial dma_unmap test Signed-off-by: John Levon <john.levon@nutanix.com> Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> * Fix err path of handle_dma_unmap() Set msg->out_size before successful return. Otherwise in case of error reply path we may endup setting iovecs[1].iov_len with invalid iovecs[1].iov_base in tran_sock_reply() Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>