linux/arch/powerpc
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
..
boot powerpc/boot: add zImage.lds to targets 2021-06-21 21:13:19 +10:00
configs powerpc/Makefile: Add ppc32/ppc64_randconfig targets 2021-05-23 20:51:35 +10:00
crypto crypto: powepc/sha1 - remove unneeded semicolon 2021-03-07 15:13:14 +11:00
include powerpc/mm: Implement set_memory() routines 2021-06-21 21:13:20 +10:00
kernel powerpc/security: Add a security feature for STF barrier 2021-06-21 21:13:19 +10:00
kexec powerpc/kexec_file: Use current CPU info while setting up FDT 2021-05-04 22:26:57 +10:00
kvm Merge branch 'topic/ppc-kvm' into next 2021-06-17 16:51:38 +10:00
lib powerpc: Don't use 'struct ppc_inst' to reference instruction location 2021-06-17 00:09:00 +10:00
math-emu powerpc/math: Fix missing __user qualifier for get_user() and other sparse warnings 2021-03-29 13:22:12 +11:00
mm powerpc/mm: Implement set_memory() routines 2021-06-21 21:13:20 +10:00
net powerpc/ebpf32: Use _Rx macros instead of __REG_Rx ones 2021-06-16 00:16:48 +10:00
perf powerpc: make stack walking KASAN-safe 2021-06-17 00:09:11 +10:00
platforms powerpc/pesries: Get STF barrier requirement from H_GET_CPU_CHARACTERISTICS 2021-06-21 21:13:19 +10:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev Merge branch 'akpm' (patches from Andrew) 2021-04-30 14:38:01 -07:00
tools powerpc/tools: Remove 90 line limit in checkpatch script 2020-09-08 22:57:11 +10:00
xmon powerpc: Don't use 'struct ppc_inst' to reference instruction location 2021-06-17 00:09:00 +10:00
Kbuild
Kconfig powerpc/mm: Implement set_memory() routines 2021-06-21 21:13:20 +10:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-04-08 21:17:46 +10:00
Makefile powerpc/Makefile: Add ppc32/ppc64_randconfig targets 2021-05-23 20:51:35 +10:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00