diff options
author | Balbir Singh <bsingharora@gmail.com> | 2017-06-28 20:04:09 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-07-04 04:37:39 +0300 |
commit | 7614ff3272a115a047139173cc04466e8132a1f2 (patch) | |
tree | 6215fd8d6460f772c73639a0c1459398067db360 /arch/powerpc/mm/pgtable_64.c | |
parent | cd65d69713349fc7b33fa9de2b32989b99c9fb39 (diff) | |
download | linux-7614ff3272a115a047139173cc04466e8132a1f2.tar.xz |
powerpc/mm/radix: Implement STRICT_RWX/mark_rodata_ro() for Radix
The Radix linear mapping code (create_physical_mapping()) tries to use
the largest page size it can at each step. Currently the only reason
it steps down to a smaller page size is if the start addr is
unaligned (never happens in practice), or the end of memory is not
aligned to a huge page boundary.
To support STRICT_RWX we need to break the mapping at __init_begin,
so that the text and rodata prior to that can be marked R_X and the
regular pages after can be marked RW.
Having done that we can now implement mark_rodata_ro() for Radix,
knowing that we won't need to split any mappings.
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
[mpe: Split down to PAGE_SIZE, not 2MB, rewrite change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r-- | arch/powerpc/mm/pgtable_64.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index fc2e6def2eb7..5c0b795d656c 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c @@ -500,7 +500,9 @@ void mark_rodata_ro(void) return; } - if (!radix_enabled()) + if (radix_enabled()) + radix__mark_rodata_ro(); + else hash__mark_rodata_ro(); } #endif |