Skip to content
Snippets Groups Projects
Commit 1a3abcf4 authored by Vitaly Andrianov's avatar Vitaly Andrianov Committed by Russell King
Browse files

ARM: 7418/1: LPAE: fix access flag setup in mem_type_table


A zero value for prot_sect in the memory types table implies that
section mappings should never be created for the memory type in question.
This is checked for in alloc_init_section().

With LPAE, we set a bit to mask access flag faults for kernel mappings.
This breaks the aforementioned (!prot_sect) check in alloc_init_section().

This patch fixes this bug by first checking for a non-zero
prot_sect before setting the PMD_SECT_AF flag.

Signed-off-by: default avatarVitaly Andrianov <vitalya@ti.com>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 9b61a4d1
No related branches found
No related tags found
No related merge requests found
...@@ -489,6 +489,7 @@ static void __init build_mem_type_table(void) ...@@ -489,6 +489,7 @@ static void __init build_mem_type_table(void)
*/ */
for (i = 0; i < ARRAY_SIZE(mem_types); i++) { for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
mem_types[i].prot_pte |= PTE_EXT_AF; mem_types[i].prot_pte |= PTE_EXT_AF;
if (mem_types[i].prot_sect)
mem_types[i].prot_sect |= PMD_SECT_AF; mem_types[i].prot_sect |= PMD_SECT_AF;
} }
kern_pgprot |= PTE_EXT_AF; kern_pgprot |= PTE_EXT_AF;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment