linux/arch/s390
Heiko Carstens 34e4c79f3b s390/mm: use VM_FLUSH_RESET_PERMS in module_alloc()
Make use of the set_direct_map() calls for module allocations.
In particular:

- All changes to read-only permissions in kernel VA mappings are also
  applied to the direct mapping. Note that execute permissions are
  intentionally not applied to the direct mapping in order to make
  sure that all allocated pages within the direct mapping stay
  non-executable

- module_alloc() passes the VM_FLUSH_RESET_PERMS to __vmalloc_node_range()
  to make sure that all implicit permission changes made to the direct
  mapping are reset when the allocated vm area is freed again

Side effects: the direct mapping will be fragmented depending on how many
vm areas with VM_FLUSH_RESET_PERMS and/or explicit page permission changes
are allocated and freed again.

For example, just after boot of a system the direct mapping statistics look
like:

$cat /proc/meminfo
...
DirectMap4k:      111628 kB
DirectMap1M:    16665600 kB
DirectMap2G:           0 kB

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2023-04-20 11:36:29 +02:00
..
appldata s390: simplify dynamic sysctl registration for appldata_register_ops 2023-03-20 10:56:49 +01:00
boot s390/mm: fix direct map accounting 2023-04-13 17:36:28 +02:00
configs s390: update defconfigs 2023-03-13 09:15:11 +01:00
crypto s390/crc32le: use SYM* macros instead of ENTRY(), etc. 2023-04-19 17:24:17 +02:00
hypfs s390/hypfs: remove unused info_blk_hdr__pcpus() function 2022-11-23 16:24:07 +01:00
include s390/mm: enable ARCH_HAS_SET_DIRECT_MAP 2023-04-20 11:36:29 +02:00
kernel s390/mm: use VM_FLUSH_RESET_PERMS in module_alloc() 2023-04-20 11:36:29 +02:00
kvm * Two more V!=R patches 2023-02-15 12:35:26 -05:00
lib s390/lib: use SYM* macros instead of ENTRY(), etc. 2023-04-19 17:24:16 +02:00
mm s390/mm: use VM_FLUSH_RESET_PERMS in module_alloc() 2023-04-20 11:36:29 +02:00
net s390/bpf: Implement bpf_jit_supports_kfunc_call() 2023-01-29 19:16:29 -08:00
pci Merge branch 'uaccess-inline-asm-cleanup' into features 2023-04-04 18:29:28 +02:00
purgatory s390/purgatory: use SYM* macros instead of ENTRY(), etc. 2023-04-19 17:24:18 +02:00
tools KVM: s390: Add facility 197 to the allow list 2022-07-13 15:25:25 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig s390/mm: enable ARCH_HAS_SET_DIRECT_MAP 2023-04-20 11:36:29 +02:00
Kconfig.debug s390/Kconfig.debug: fix indentation 2022-06-01 12:03:15 +02:00
Makefile s390: always build relocatable kernel 2022-11-08 19:32:32 +01:00