For the UNMAP_DMA ioctl, delete all mappings if VFIO_DMA_UNMAP_FLAG_ALL is set. Define the corresponding VFIO_UNMAP_ALL extension.
Showing the changes to include/uapi (1 of 1 file). Show all
Unified · Split
| @@ -46,6 +46,9 @@ · 45 unmodified lines | ||
| 46 | 46 | */ |
| 47 | 47 | #define VFIO_NOIOMMU_IOMMU 8 |
| 48 | 48 | |
| 49 | +/* Supports VFIO_DMA_UNMAP_FLAG_ALL */ | |
| 50 | +#define VFIO_UNMAP_ALL 9 | |
| 51 | + | |
| 49 | 52 | /* |
| 50 | 53 | * The IOCTL interface is designed for extensibility by embedding the |
| 51 | 54 | * structure length (argsz) and flags into structures passed between |
| @@ -1102,6 +1105,7 @@ struct vfio_bitmap { · 1050 unmodified lines | ||
| 1102 | 1105 | * field. No guarantee is made to the user that arbitrary unmaps of iova |
| 1103 | 1106 | * or size different from those used in the original mapping call will |
| 1104 | 1107 | * succeed. |
| 1108 | + * | |
| 1105 | 1109 | * VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP should be set to get the dirty bitmap |
| 1106 | 1110 | * before unmapping IO virtual addresses. When this flag is set, the user must |
| 1107 | 1111 | * provide a struct vfio_bitmap in data[]. User must provide zero-allocated |
| @@ -1111,11 +1115,15 @@ struct vfio_bitmap { · 3 unmodified lines | ||
| 1111 | 1115 | * indicates that the page at that offset from iova is dirty. A Bitmap of the |
| 1112 | 1116 | * pages in the range of unmapped size is returned in the user-provided |
| 1113 | 1117 | * vfio_bitmap.data. |
| 1118 | + * | |
| 1119 | + * If flags & VFIO_DMA_UNMAP_FLAG_ALL, unmap all addresses. iova and size | |
| 1120 | + * must be 0. This cannot be combined with the get-dirty-bitmap flag. | |
| 1114 | 1121 | */ |
| 1115 | 1122 | struct vfio_iommu_type1_dma_unmap { |
| 1116 | 1123 | __u32 argsz; |
| 1117 | 1124 | __u32 flags; |
| 1118 | 1125 | #define VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP (1 << 0) |
| 1126 | +#define VFIO_DMA_UNMAP_FLAG_ALL (1 << 1) | |
| 1119 | 1127 | __u64 iova; /* IO virtual address */ |
| 1120 | 1128 | __u64 size; /* Size of mapping (bytes) */ |
| 1121 | 1129 | __u8 data[]; |