• Heiko Carstens's avatar
    s390/mm: use VM_FLUSH_RESET_PERMS in module_alloc() · 34e4c79f
    Heiko Carstens authored
    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: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    34e4c79f
pageattr.c 11.2 KB