Skip to content

Commit b61c38b

Browse files
chleroympe
authored andcommitted
powerpc/8xx: Fix STRICT_KERNEL_RWX startup test failure
WRITE_RO lkdtm test works. But when selecting CONFIG_DEBUG_RODATA_TEST, the kernel reports rodata_test: test data was not read only This is because when rodata test runs, there are still old entries in TLB. Flush TLB after setting kernel pages RO or NX. Fixes: d5f17ee ("powerpc/8xx: don't disable large TLBs with CONFIG_STRICT_KERNEL_RWX") Cc: [email protected] # v5.1+ Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/485caac75f195f18c11eb077b0031fdd2bb7fb9e.1587361039.git.christophe.leroy@c-s.fr
1 parent 94c0b01 commit b61c38b

File tree

1 file changed

+3
-0
lines changed
  • arch/powerpc/mm/nohash

1 file changed

+3
-0
lines changed

arch/powerpc/mm/nohash/8xx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ void mmu_mark_initmem_nx(void)
185185
mmu_mapin_ram_chunk(etext8, einittext8, PAGE_KERNEL);
186186
}
187187
}
188+
_tlbil_all();
188189
}
189190

190191
#ifdef CONFIG_STRICT_KERNEL_RWX
@@ -199,6 +200,8 @@ void mmu_mark_rodata_ro(void)
199200
~(LARGE_PAGE_SIZE_8M - 1)));
200201
mmu_patch_addis(&patch__dtlbmiss_romem_top, -__pa(_sinittext));
201202

203+
_tlbil_all();
204+
202205
/* Update page tables for PTDUMP and BDI */
203206
mmu_mapin_ram_chunk(0, sinittext, __pgprot(0));
204207
mmu_mapin_ram_chunk(0, etext, PAGE_KERNEL_ROX);

0 commit comments

Comments
 (0)