|
@@ -1281,7 +1281,7 @@ static int arm_smmu_alloc_init_pte(struct arm_smmu_device *smmu, pmd_t *pmd,
|
|
unsigned long pfn, int prot, int stage)
|
|
unsigned long pfn, int prot, int stage)
|
|
{
|
|
{
|
|
pte_t *pte, *start;
|
|
pte_t *pte, *start;
|
|
- pteval_t pteval = ARM_SMMU_PTE_PAGE | ARM_SMMU_PTE_AF | ARM_SMMU_PTE_XN;
|
|
|
|
|
|
+ pteval_t pteval = ARM_SMMU_PTE_PAGE | ARM_SMMU_PTE_AF;
|
|
|
|
|
|
if (pmd_none(*pmd)) {
|
|
if (pmd_none(*pmd)) {
|
|
/* Allocate a new set of tables */
|
|
/* Allocate a new set of tables */
|
|
@@ -1315,10 +1315,11 @@ static int arm_smmu_alloc_init_pte(struct arm_smmu_device *smmu, pmd_t *pmd,
|
|
pteval |= ARM_SMMU_PTE_MEMATTR_NC;
|
|
pteval |= ARM_SMMU_PTE_MEMATTR_NC;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (prot & IOMMU_NOEXEC)
|
|
|
|
+ pteval |= ARM_SMMU_PTE_XN;
|
|
|
|
+
|
|
/* If no access, create a faulting entry to avoid TLB fills */
|
|
/* If no access, create a faulting entry to avoid TLB fills */
|
|
- if (prot & IOMMU_EXEC)
|
|
|
|
- pteval &= ~ARM_SMMU_PTE_XN;
|
|
|
|
- else if (!(prot & (IOMMU_READ | IOMMU_WRITE)))
|
|
|
|
|
|
+ if (!(prot & (IOMMU_READ | IOMMU_WRITE)))
|
|
pteval &= ~ARM_SMMU_PTE_PAGE;
|
|
pteval &= ~ARM_SMMU_PTE_PAGE;
|
|
|
|
|
|
pteval |= ARM_SMMU_PTE_SH_IS;
|
|
pteval |= ARM_SMMU_PTE_SH_IS;
|