Re: [PATCH v5 2/2] vfio/type1: Set IOMMU_MMIO in dma->prot for MMIO-backed addresses

From: Wei Wang

Date: Wed Feb 25 2026 - 03:46:16 EST


On 1/26/26 3:19 AM, Wei Wang wrote:
Before requesting the IOMMU driver to map an IOVA to a physical address,
set the IOMMU_MMIO flag in dma->prot when the physical address corresponds
to MMIO. This allows the IOMMU driver to handle MMIO mappings specially.
For example, on AMD CPUs with SME enabled, the IOMMU driver avoids setting
the C-bit if iommu_map() is called with IOMMU_MMIO set in prot. This
prevents issues with PCIe P2P communication when IOVA is used.

Signed-off-by: Wei Wang <wei.w.wang@xxxxxxxxxxx>
Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
drivers/vfio/vfio_iommu_type1.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
Hi Alex W,

The first patch in this series (the IOMMU part) has been merged and queued for stable. I haven’t seen further comments on the VFIO patch,
so I wanted to check whether you have any feedback or concerns about
it. Thanks.