]> Gentwo Git Trees - linux/.git/commit
iommu/pages: Add support for incoherent IOMMU page table walkers
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 23 Oct 2025 18:22:29 +0000 (15:22 -0300)
committerJoerg Roedel <joerg.roedel@amd.com>
Wed, 5 Nov 2025 08:47:43 +0000 (09:47 +0100)
commit36ae67b13976f8fe1fed2bbbc45ed09d0d113d45
tree6280924571e05cbf051095de03c453422c05bde0
parentbc5233c0904eb116a4bd94e10cd3666733216063
iommu/pages: Add support for incoherent IOMMU page table walkers

Some IOMMU HW cannot snoop the CPU cache when it walks the IO page tables.
The CPU is required to flush the cache to make changes visible to the HW.

Provide some helpers from iommu-pages to manage this. The helpers combine
both the ARM and x86 (used in Intel VT-d) versions of the cache flushing
under a single API.

The ARM version uses the DMA API to access the cache flush on the
assumption that the iommu is using a direct mapping and is already marked
incoherent. The helpers will do the DMA API calls to set things up and
keep track of DMA mapped folios using a bit in the ioptdesc so that
unmapping on error paths is cleaner.

The Intel version just calls the arch cache flush call directly and has no
need to cleanup prior to destruction.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/iommu-pages.c
drivers/iommu/iommu-pages.h