aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/mmu.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-11-16 03:40:36 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-12-22 06:05:35 -0500
commit36bb94ba36f332de767cfaa3af6a5136435a3a9c (patch)
tree45d1bd890b58658f4db58a033e619e511e3368f4 /arch/arm/mm/mmu.c
parent9522d7e4cb5e0858122fc55d33a2c07728f0b10d (diff)
ARM: pgtable: provide RDONLY page table bit rather than WRITE bit
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r--arch/arm/mm/mmu.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index bd5a94b2d610..546e44734db0 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -190,7 +190,7 @@ void adjust_cr(unsigned long mask, unsigned long set)
190} 190}
191#endif 191#endif
192 192
193#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_WRITE|L_PTE_XN 193#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN
194#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE 194#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE
195 195
196static struct mem_type mem_types[] = { 196static struct mem_type mem_types[] = {
@@ -234,19 +234,19 @@ static struct mem_type mem_types[] = {
234 .domain = DOMAIN_KERNEL, 234 .domain = DOMAIN_KERNEL,
235 }, 235 },
236 [MT_LOW_VECTORS] = { 236 [MT_LOW_VECTORS] = {
237 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, 237 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
238 L_PTE_RDONLY,
238 .prot_l1 = PMD_TYPE_TABLE, 239 .prot_l1 = PMD_TYPE_TABLE,
239 .domain = DOMAIN_USER, 240 .domain = DOMAIN_USER,
240 }, 241 },
241 [MT_HIGH_VECTORS] = { 242 [MT_HIGH_VECTORS] = {
242 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 243 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
243 L_PTE_USER, 244 L_PTE_USER | L_PTE_RDONLY,
244 .prot_l1 = PMD_TYPE_TABLE, 245 .prot_l1 = PMD_TYPE_TABLE,
245 .domain = DOMAIN_USER, 246 .domain = DOMAIN_USER,
246 }, 247 },
247 [MT_MEMORY] = { 248 [MT_MEMORY] = {
248 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 249 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY,
249 L_PTE_WRITE,
250 .prot_l1 = PMD_TYPE_TABLE, 250 .prot_l1 = PMD_TYPE_TABLE,
251 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, 251 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
252 .domain = DOMAIN_KERNEL, 252 .domain = DOMAIN_KERNEL,
@@ -257,21 +257,20 @@ static struct mem_type mem_types[] = {
257 }, 257 },
258 [MT_MEMORY_NONCACHED] = { 258 [MT_MEMORY_NONCACHED] = {
259 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 259 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
260 L_PTE_WRITE| L_PTE_MT_BUFFERABLE, 260 L_PTE_MT_BUFFERABLE,
261 .prot_l1 = PMD_TYPE_TABLE, 261 .prot_l1 = PMD_TYPE_TABLE,
262 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE, 262 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
263 .domain = DOMAIN_KERNEL, 263 .domain = DOMAIN_KERNEL,
264 }, 264 },
265 [MT_MEMORY_DTCM] = { 265 [MT_MEMORY_DTCM] = {
266 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 266 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
267 L_PTE_WRITE | L_PTE_XN, 267 L_PTE_XN,
268 .prot_l1 = PMD_TYPE_TABLE, 268 .prot_l1 = PMD_TYPE_TABLE,
269 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, 269 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
270 .domain = DOMAIN_KERNEL, 270 .domain = DOMAIN_KERNEL,
271 }, 271 },
272 [MT_MEMORY_ITCM] = { 272 [MT_MEMORY_ITCM] = {
273 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 273 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY,
274 L_PTE_WRITE,
275 .prot_l1 = PMD_TYPE_TABLE, 274 .prot_l1 = PMD_TYPE_TABLE,
276 .domain = DOMAIN_KERNEL, 275 .domain = DOMAIN_KERNEL,
277 }, 276 },
@@ -478,7 +477,7 @@ static void __init build_mem_type_table(void)
478 477
479 pgprot_user = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot); 478 pgprot_user = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot);
480 pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | 479 pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
481 L_PTE_DIRTY | L_PTE_WRITE | kern_pgprot); 480 L_PTE_DIRTY | kern_pgprot);
482 481
483 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask; 482 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
484 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask; 483 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;