summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/book3s32/mmu.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2022-09-16 14:07:49 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2022-09-26 20:58:16 +1000
commit7082f8e7d2276575a8806370007cbb4a7b9abdce (patch)
tree8b534ee44f283a58de7353121e364a7f9e524747 /arch/powerpc/mm/book3s32/mmu.c
parentb150a4d12b919baf956b807aa305cf78df03d0fe (diff)
powerpc: move __end_rodata to cover arch read-only sections
powerpc has a number of read-only sections and tables that are put after RO_DATA(). Move the __end_rodata symbol to cover these as well. Setting memory to read-only at boot is done using __init_begin, change that to use __end_rodata. This makes is_kernel_rodata() exactly cover the read-only region, as well as other things using __end_rodata (e.g., kernel/dma/debug.c). Boot dmesg also prints the rodata size more accurately. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220916040755.2398112-2-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/mm/book3s32/mmu.c')
-rw-r--r--arch/powerpc/mm/book3s32/mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/mm/book3s32/mmu.c b/arch/powerpc/mm/book3s32/mmu.c
index 250d174459d4..e5ee05c234c7 100644
--- a/arch/powerpc/mm/book3s32/mmu.c
+++ b/arch/powerpc/mm/book3s32/mmu.c
@@ -240,7 +240,7 @@ void mmu_mark_rodata_ro(void)
for (i = 0; i < nb; i++) {
struct ppc_bat *bat = BATS[i];
- if (bat_addrs[i].start < (unsigned long)__init_begin)
+ if (bat_addrs[i].start < (unsigned long)__end_rodata)
bat[1].batl = (bat[1].batl & ~BPP_RW) | BPP_RX;
}