[PATCH v2 1/5] [RFC]iommu: Add a IOMMU_DEVONLY protection flag
Boris Brezillon
boris.brezillon at collabora.com
Fri Oct 1 14:34:23 UTC 2021
The IOMMU_DEVONLY flag allows the caller to flag a mappings backed by
device-private buffers. That means other devices or CPUs are not
expected to access the physical memory region pointed by the mapping,
and the MMU driver can safely restrict the shareability domain to the
device itself.
Will be used by the ARM MMU driver to flag Mali mappings accessed only
by the GPU as Inner-shareable.
Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
---
include/linux/iommu.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index d2f3435e7d17..db14781b522f 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -31,6 +31,13 @@
* if the IOMMU page table format is equivalent.
*/
#define IOMMU_PRIV (1 << 5)
+/*
+ * Mapping is only accessed by the device behind the iommu. That means other
+ * devices or CPUs are not expected to access this physical memory region,
+ * and the MMU driver can safely restrict the shareability domain to the
+ * device itself.
+ */
+#define IOMMU_DEVONLY (1 << 6)
struct iommu_ops;
struct iommu_group;
--
2.31.1
More information about the dri-devel
mailing list