linux/arch/powerpc/mm
Russell Currey 1f9ad21c3b powerpc/mm: Implement set_memory() routines
The set_memory_{ro/rw/nx/x}() functions are required for
STRICT_MODULE_RWX, and are generally useful primitives to have.  This
implementation is designed to be generic across powerpc's many MMUs.
It's possible that this could be optimised to be faster for specific
MMUs.

This implementation does not handle cases where the caller is attempting
to change the mapping of the page it is executing from, or if another
CPU is concurrently using the page being altered.  These cases likely
shouldn't happen, but a more complex implementation with MMU-specific code
could safely handle them.

On hash, the linear mapping is not kept in the linux pagetable, so this
will not change the protection if used on that range. Currently these
functions are not used on the linear map so just WARN for now.

apply_to_existing_page_range() does not work on huge pages so for now
disallow changing the protection of huge pages.

[jpn: - Allow set memory functions to be used without Strict RWX
      - Hash: Disallow certain regions
      - Have change_page_attr() take function pointers to manipulate ptes
      - Radix: Add ptesync after set_pte_at()]

Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210609013431.9805-2-jniethe5@gmail.com
2021-06-21 21:13:20 +10:00
..
book3s32 powerpc/32s: Rename PTE_SIZE to PTE_T_SIZE 2021-06-17 00:09:10 +10:00
book3s64 Merge branch 'topic/ppc-kvm' into next 2021-06-17 16:51:38 +10:00
kasan
nohash powerpc/nohash: Remove DEBUG_HARDER 2021-06-17 00:09:10 +10:00
ptdump
cacheflush.c powerpc/mem: Use kmap_local_page() in flushing functions 2021-04-14 23:04:19 +10:00
copro_fault.c
dma-noncoherent.c
drmem.c
fault.c powerpc/traps: Enhance readability for trap types 2021-04-17 22:20:19 +10:00
hugetlbpage.c hugetlb: pass vma into huge_pte_alloc() and huge_pmd_share() 2021-05-05 11:27:20 -07:00
init_32.c powerpc: Enable KFENCE for PPC32 2021-03-24 14:09:30 +11:00
init_64.c
init-common.c
ioremap_32.c
ioremap_64.c
ioremap.c mm/vmalloc: remove unmap_kernel_range 2021-04-30 11:20:40 -07:00
maccess.c powerpc: Don't use 'struct ppc_inst' to reference instruction location 2021-06-17 00:09:00 +10:00
Makefile powerpc/mm: Implement set_memory() routines 2021-06-21 21:13:20 +10:00
mem.c powerpc/32: Display modules range in virtual memory layout 2021-06-17 00:09:11 +10:00
mmap.c
mmu_context.c KVM: PPC: Book3S HV: Implement radix prefetch workaround by disabling MMU 2021-06-10 22:12:14 +10:00
mmu_decl.h powerpc: Enable KFENCE for PPC32 2021-03-24 14:09:30 +11:00
numa.c
pageattr.c powerpc/mm: Implement set_memory() routines 2021-06-21 21:13:20 +10:00
pgtable_32.c
pgtable_64.c
pgtable-frag.c
pgtable.c powerpc: Define swapper_pg_dir[] in C 2021-06-17 00:09:10 +10:00
slice.c