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

Commit 983eb110 authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Matt Wagantall
Browse files

Revert "iommu/arm-smmu: change IOMMU_EXEC to IOMMU_NOEXEC"



This reverts commit 433a4b6a37c8f96295a7e80cb603c2318872c1f2.  An
equivalent patch is being brought in with the upcoming page table
refactoring, so rip this guy out in preparation.

This also reverts commit af3e3c36d08077856640b28d68c9f99d2188a000, which
introduced users of the IOMMU_NOEXEC flag.

Change-Id: Ibb36f60f2148170d8a01632043bf36b5f8c60777
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent 76247c57
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -790,7 +790,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_NOEXEC);
				IOMMU_READ|IOMMU_WRITE);
		if (ret < 0)
			goto fail;
		iova += len;
+1 −1
Original line number Diff line number Diff line
@@ -1182,7 +1182,7 @@ kgsl_iommu_map(struct kgsl_pagetable *pt,

	addr = (unsigned int) memdesc->gpuaddr;

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

	/* Set up the protection for the page(s) */
	if (memdesc->flags & KGSL_MEMFLAGS_GPUREADONLY)
+4 −5
Original line number Diff line number Diff line
@@ -1648,7 +1648,7 @@ static int arm_smmu_alloc_init_pte(struct arm_smmu_domain *smmu_domain,
				   unsigned long pfn, int prot, int stage)
{
	pte_t *pte, *start;
	pteval_t pteval = ARM_SMMU_PTE_PAGE | ARM_SMMU_PTE_AF;
	pteval_t pteval = ARM_SMMU_PTE_PAGE | ARM_SMMU_PTE_AF | ARM_SMMU_PTE_XN;
	int ret;

	if (pmd_none(*pmd)) {
@@ -1698,11 +1698,10 @@ static int arm_smmu_alloc_init_pte(struct arm_smmu_domain *smmu_domain,
			pteval |= ARM_SMMU_PTE_MEMATTR_DEV;
	}

	if (prot & IOMMU_NOEXEC)
		pteval |= ARM_SMMU_PTE_XN;

	/* If no access, create a faulting entry to avoid TLB fills */
	if (!(prot & (IOMMU_READ | IOMMU_WRITE)))
	if (prot & IOMMU_EXEC)
		pteval &= ~ARM_SMMU_PTE_XN;
	else if (!(prot & (IOMMU_READ | IOMMU_WRITE)))
		pteval &= ~ARM_SMMU_PTE_PAGE;

	pteval |= ARM_SMMU_PTE_SH_IS;
+1 −2
Original line number Diff line number Diff line
@@ -168,8 +168,7 @@ 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 | IOMMU_NOEXEC);
				mdp5_data->splash_mem_size, IOMMU_READ);
	if (rc) {
		pr_debug("iommu memory mapping failed rc=%d\n", rc);
	} else {
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#define IOMMU_READ	(1 << 0)
#define IOMMU_WRITE	(1 << 1)
#define IOMMU_CACHE	(1 << 2) /* DMA cache coherency */
#define IOMMU_NOEXEC	(1 << 3)
#define IOMMU_EXEC	(1 << 3)
#define IOMMU_PRIV	(1 << 4)
#define IOMMU_DEVICE	(1 << 5) /* Indicates access to device memory */