aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-11-25 07:01:03 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-12-11 04:53:22 -0500
commit71b55663c5d0a6f8473045db1c8b376803780191 (patch)
treef100d5b7fbe51b4c78ba306334f1e37763cd5048
parentdca9aa92fc7caa3620b31ced1535968f4aeeb967 (diff)
ARM: fix executability of CMA mappings
The CMA region was being marked executable: 0xdc04e000-0xdc050000 8K RW x MEM/CACHED/WBRA 0xdc060000-0xdc100000 640K RW x MEM/CACHED/WBRA 0xdc4f5000-0xdc500000 44K RW x MEM/CACHED/WBRA 0xdcce9000-0xe0000000 52316K RW x MEM/CACHED/WBRA This is mainly due to the badly worded MT_MEMORY_DMA_READY symbol, but there are also a few other places in dma-mapping which should be corrected to use the right constant. Fix all these places: 0xdc04e000-0xdc050000 8K RW NX MEM/CACHED/WBRA 0xdc060000-0xdc100000 640K RW NX MEM/CACHED/WBRA 0xdc280000-0xdc300000 512K RW NX MEM/CACHED/WBRA 0xdc6fc000-0xe0000000 58384K RW NX MEM/CACHED/WBRA Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mm/dma-mapping.c6
-rw-r--r--arch/arm/mm/mmu.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 79f8b39801a8..f0ea0134e5a3 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -361,7 +361,7 @@ void __init init_dma_coherent_pool_size(unsigned long size)
361static int __init atomic_pool_init(void) 361static int __init atomic_pool_init(void)
362{ 362{
363 struct dma_pool *pool = &atomic_pool; 363 struct dma_pool *pool = &atomic_pool;
364 pgprot_t prot = pgprot_dmacoherent(pgprot_kernel); 364 pgprot_t prot = pgprot_dmacoherent(PAGE_KERNEL);
365 gfp_t gfp = GFP_KERNEL | GFP_DMA; 365 gfp_t gfp = GFP_KERNEL | GFP_DMA;
366 unsigned long nr_pages = pool->size >> PAGE_SHIFT; 366 unsigned long nr_pages = pool->size >> PAGE_SHIFT;
367 unsigned long *bitmap; 367 unsigned long *bitmap;
@@ -609,7 +609,7 @@ static void __free_from_contiguous(struct device *dev, struct page *page,
609 if (PageHighMem(page)) 609 if (PageHighMem(page))
610 __dma_free_remap(cpu_addr, size); 610 __dma_free_remap(cpu_addr, size);
611 else 611 else
612 __dma_remap(page, size, pgprot_kernel); 612 __dma_remap(page, size, PAGE_KERNEL);
613 dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT); 613 dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT);
614} 614}
615 615
@@ -1357,7 +1357,7 @@ static void __iommu_free_atomic(struct device *dev, void *cpu_addr,
1357static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, 1357static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,
1358 dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs) 1358 dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs)
1359{ 1359{
1360 pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel); 1360 pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
1361 struct page **pages; 1361 struct page **pages;
1362 void *addr = NULL; 1362 void *addr = NULL;
1363 1363
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 09033890c8b0..4f08c133cc25 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -333,7 +333,8 @@ static struct mem_type mem_types[] = {
333 .domain = DOMAIN_KERNEL, 333 .domain = DOMAIN_KERNEL,
334 }, 334 },
335 [MT_MEMORY_DMA_READY] = { 335 [MT_MEMORY_DMA_READY] = {
336 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, 336 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
337 L_PTE_XN,
337 .prot_l1 = PMD_TYPE_TABLE, 338 .prot_l1 = PMD_TYPE_TABLE,
338 .domain = DOMAIN_KERNEL, 339 .domain = DOMAIN_KERNEL,
339 }, 340 },