Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f839664 authored by Rohit Vaswani's avatar Rohit Vaswani Committed by Sathish Ambley
Browse files

iommu: msm: Provide the IOMMU_NOEXEC flag explicitly during mapping



The logic for the iommu executable flag is inverted now and
all the iommu mappings are executable by default.
Provide the IOMMU_NOEXEC flag where the mapping needs to be non-executable.

Change-Id: Ifa0aa3d17ae79c16abdf66d2177a09b868a9f45f
Signed-off-by: default avatarRohit Vaswani <rvaswani@codeaurora.org>
parent 56c4ebea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -801,7 +801,7 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size)

		len = (j - i) << PAGE_SHIFT;
		ret = iommu_map(mapping->domain, iova, phys, len,
				IOMMU_READ|IOMMU_WRITE);
				IOMMU_READ|IOMMU_WRITE|IOMMU_NOEXEC);
		if (ret < 0)
			goto fail;
		iova += len;
+1 −1
Original line number Diff line number Diff line
@@ -1291,7 +1291,7 @@ kgsl_iommu_map(struct kgsl_pagetable *pt,

	BUG_ON(NULL == iommu_pt);

	flags = IOMMU_READ | IOMMU_WRITE;
	flags = IOMMU_READ | IOMMU_WRITE | IOMMU_NOEXEC;

	/* Set up the protection for the page(s) */
	if (memdesc->flags & KGSL_MEMFLAGS_GPUREADONLY)
+2 −1
Original line number Diff line number Diff line
@@ -169,7 +169,8 @@ static int mdss_mdp_splash_iommu_attach(struct msm_fb_data_type *mfd)
	rc = mdss_smmu_map(MDSS_IOMMU_DOMAIN_UNSECURE,
				mdp5_data->splash_mem_addr,
				mdp5_data->splash_mem_addr,
				mdp5_data->splash_mem_size, IOMMU_READ);
				mdp5_data->splash_mem_size,
				IOMMU_READ | IOMMU_NOEXEC);
	if (rc) {
		pr_debug("iommu memory mapping failed rc=%d\n", rc);
	} else {