Skip to content

Commit 14ca1a4

Browse files
Wang KefengRussell King (Oracle)
authored andcommitted
ARM: 9247/1: mm: set readonly for MT_MEMORY_RO with ARM_LPAE
MT_MEMORY_RO is introduced by commit 598f0a9 ("ARM: 9210/1: Mark the FDT_FIXED sections as shareable"), which is a readonly memory type for FDT area, but there are some different between ARM_LPAE and non-ARM_LPAE, we need to setup PMD_SECT_AP2 and L_PMD_SECT_RDONLY for MT_MEMORY_RO when ARM_LAPE enabled. non-ARM_LPAE 0xff800000-0xffa00000 2M PGD KERNEL ro NX SHD ARM_LPAE 0xff800000-0xffc00000 4M PMD RW NX SHD ARM_LPAE+fix 0xff800000-0xffc00000 4M PMD ro NX SHD Fixes: 598f0a9 ("ARM: 9210/1: Mark the FDT_FIXED sections as shareable") Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 2ccd19b commit 14ca1a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/arm/mm/mmu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,11 @@ static struct mem_type mem_types[] __ro_after_init = {
300300
.prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
301301
L_PTE_XN | L_PTE_RDONLY,
302302
.prot_l1 = PMD_TYPE_TABLE,
303+
#ifdef CONFIG_ARM_LPAE
304+
.prot_sect = PMD_TYPE_SECT | L_PMD_SECT_RDONLY | PMD_SECT_AP2,
305+
#else
303306
.prot_sect = PMD_TYPE_SECT,
307+
#endif
304308
.domain = DOMAIN_KERNEL,
305309
},
306310
[MT_ROM] = {

0 commit comments

Comments
 (0)