]> Pileus Git - ~andy/linux/commitdiff
iommu: add IOMMU_EXEC flag for safely allowing XN mappings
authorWill Deacon <will.deacon@arm.com>
Tue, 5 Nov 2013 15:59:53 +0000 (15:59 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 16 Dec 2013 19:30:31 +0000 (19:30 +0000)
Whilst most IOMMU mappings should probably be non-executable, there
may be cases (HSA?) where executable mappings are required.

This patch introduces a new mapping flag, IOMMU_EXEC, to indicate that
the mapping should be mapped as executable.

Signed-off-by: Will Deacon <will.deacon@arm.com>
include/linux/iommu.h

index a444c790fa7235e2bc7247313804a5062d0a4db8..709a697c4e02b5f83abd3ddad515308506fcd52f 100644 (file)
 #include <linux/types.h>
 #include <trace/events/iommu.h>
 
-#define IOMMU_READ     (1)
-#define IOMMU_WRITE    (2)
-#define IOMMU_CACHE    (4) /* DMA cache coherency */
+#define IOMMU_READ     (1 << 0)
+#define IOMMU_WRITE    (1 << 1)
+#define IOMMU_CACHE    (1 << 2) /* DMA cache coherency */
+#define IOMMU_EXEC     (1 << 3)
 
 struct iommu_ops;
 struct iommu_group;