]> git.baikalelectronics.ru Git - kernel.git/commit
vfio: Require that devices support DMA cache coherence
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 11 Apr 2022 15:16:08 +0000 (12:16 -0300)
committerJoerg Roedel <jroedel@suse.de>
Thu, 28 Apr 2022 15:24:57 +0000 (17:24 +0200)
commit559c1ab0746f540efd2e63229efacad89fae58d4
treef89d392587f2fe0bcde53e962999d4423ac4e971
parent6f5a81fc3958365bab434aa4b5b25cb3ffce812f
vfio: Require that devices support DMA cache coherence

IOMMU_CACHE means that normal DMAs do not require any additional coherency
mechanism and is the basic uAPI that VFIO exposes to userspace. For
instance VFIO applications like DPDK will not work if additional coherency
operations are required.

Therefore check IOMMU_CAP_CACHE_COHERENCY like vdpa & usnic do before
allowing an IOMMU backed VFIO device to be created.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/4-v3-2cf356649677+a32-intel_no_snoop_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/vfio/vfio.c