@@ -1562,7 +1562,8 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu,
prot |= IOMMU_WRITE;
if (map->flags & VFIO_DMA_MAP_FLAG_READ)
prot |= IOMMU_READ;
-
+ if (map->flags & VFIO_DMA_MAP_FLAG_SYS_CACHE)
+ prot |= IOMMU_SYS_CACHE;
if ((prot && set_vaddr) || (!prot && !set_vaddr))
return -EINVAL;
@@ -2815,7 +2816,7 @@ static int vfio_iommu_type1_map_dma(struct vfio_iommu *iommu,
struct vfio_iommu_type1_dma_map map;
unsigned long minsz;
uint32_t mask = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE |
- VFIO_DMA_MAP_FLAG_VADDR;
+ VFIO_DMA_MAP_FLAG_SYS_CACHE | VFIO_DMA_MAP_FLAG_VADDR;
minsz = offsetofend(struct vfio_iommu_type1_dma_map, size);
Introducing the VFIO_DMA_MAP_FLAG_SYS_CACHE flag to control whether mapped DMA regions are cached in the system cache. Signed-off-by: Manoj Vishwanathan <manojvishy@google.com> --- drivers/vfio/vfio_iommu_type1.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)