diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2021-05-28 15:43:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-28 15:43:33 +0100 |
commit | ad88ffd9acdf4deec83cb3f5fdae4fd62ec30efe (patch) | |
tree | 6063b57cd78f168832413c740ac9948e939811b3 /include | |
parent | 226e04e322d1c2c5dc88561b5c8e0017cf793733 (diff) | |
download | libvfio-user-ad88ffd9acdf4deec83cb3f5fdae4fd62ec30efe.zip libvfio-user-ad88ffd9acdf4deec83cb3f5fdae4fd62ec30efe.tar.gz libvfio-user-ad88ffd9acdf4deec83cb3f5fdae4fd62ec30efe.tar.bz2 |
restore argsz for DMA map/unmap (#523)
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/vfio-user.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/include/vfio-user.h b/include/vfio-user.h index fa3aba8..ef3159a 100644 --- a/include/vfio-user.h +++ b/include/vfio-user.h @@ -114,18 +114,29 @@ struct vfio_user_bitmap { char data[]; } __attribute__((packed)); -struct vfio_user_dma_region { - uint64_t addr; - uint64_t size; - uint64_t offset; - uint32_t prot; +/* based on struct vfio_iommu_type1_dma_map */ +struct vfio_user_dma_map { + uint32_t argsz; +#define VFIO_USER_F_DMA_REGION_READ (1 << 0) +#define VFIO_USER_F_DMA_REGION_WRITE (1 << 1) +#define VFIO_USER_F_DMA_REGION_MAPPABLE (1 << 2) + uint32_t flags; + uint64_t offset; + uint64_t addr; + uint64_t size; +} __attribute__((packed)); + +/* based on struct vfio_iommu_type1_dma_unmap */ +struct vfio_user_dma_unmap { + uint32_t argsz; #ifndef VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP #define VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP (1 << 0) #endif -#define VFIO_USER_F_DMA_REGION_MAPPABLE (1 << 0) - uint32_t flags; + uint32_t flags; + uint64_t addr; + uint64_t size; struct vfio_user_bitmap bitmap[]; -} __attribute__((packed)); +}; struct vfio_user_region_access { uint64_t offset; |