Commit 71b55663 authored by Russell King's avatar Russell King

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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent dca9aa92
...@@ -361,7 +361,7 @@ void __init init_dma_coherent_pool_size(unsigned long size) ...@@ -361,7 +361,7 @@ void __init init_dma_coherent_pool_size(unsigned long size)
static int __init atomic_pool_init(void) static int __init atomic_pool_init(void)
{ {
struct dma_pool *pool = &atomic_pool; struct dma_pool *pool = &atomic_pool;
pgprot_t prot = pgprot_dmacoherent(pgprot_kernel); pgprot_t prot = pgprot_dmacoherent(PAGE_KERNEL);
gfp_t gfp = GFP_KERNEL | GFP_DMA; gfp_t gfp = GFP_KERNEL | GFP_DMA;
unsigned long nr_pages = pool->size >> PAGE_SHIFT; unsigned long nr_pages = pool->size >> PAGE_SHIFT;
unsigned long *bitmap; unsigned long *bitmap;
...@@ -609,7 +609,7 @@ static void __free_from_contiguous(struct device *dev, struct page *page, ...@@ -609,7 +609,7 @@ static void __free_from_contiguous(struct device *dev, struct page *page,
if (PageHighMem(page)) if (PageHighMem(page))
__dma_free_remap(cpu_addr, size); __dma_free_remap(cpu_addr, size);
else else
__dma_remap(page, size, pgprot_kernel); __dma_remap(page, size, PAGE_KERNEL);
dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT); dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT);
} }
...@@ -1357,7 +1357,7 @@ static void __iommu_free_atomic(struct device *dev, void *cpu_addr, ...@@ -1357,7 +1357,7 @@ static void __iommu_free_atomic(struct device *dev, void *cpu_addr,
static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,
dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs) dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs)
{ {
pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel); pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
struct page **pages; struct page **pages;
void *addr = NULL; void *addr = NULL;
......
...@@ -333,7 +333,8 @@ static struct mem_type mem_types[] = { ...@@ -333,7 +333,8 @@ static struct mem_type mem_types[] = {
.domain = DOMAIN_KERNEL, .domain = DOMAIN_KERNEL,
}, },
[MT_MEMORY_DMA_READY] = { [MT_MEMORY_DMA_READY] = {
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
L_PTE_XN,
.prot_l1 = PMD_TYPE_TABLE, .prot_l1 = PMD_TYPE_TABLE,
.domain = DOMAIN_KERNEL, .domain = DOMAIN_KERNEL,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment