Lines Matching refs:vm_flags
83 static pgprot_t vm_pgprot_modify(pgprot_t oldprot, unsigned long vm_flags) in vm_pgprot_modify() argument
85 return pgprot_modify(oldprot, vm_get_page_prot(vm_flags)); in vm_pgprot_modify()
91 unsigned long vm_flags = vma->vm_flags; in vma_set_page_prot() local
94 vm_page_prot = vm_pgprot_modify(vma->vm_page_prot, vm_flags); in vma_set_page_prot()
96 vm_flags &= ~VM_SHARED; in vma_set_page_prot()
97 vm_page_prot = vm_pgprot_modify(vm_page_prot, vm_flags); in vma_set_page_prot()
109 if (vma->vm_flags & VM_SHARED) in __remove_shared_vm_struct()
412 if (vma->vm_flags & VM_SHARED) in __vma_link_file()
867 struct file *file, unsigned long vm_flags, in is_mergeable_vma() argument
879 if ((vma->vm_flags ^ vm_flags) & ~VM_SOFTDIRTY) in is_mergeable_vma()
918 can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags, in can_vma_merge_before() argument
924 if (is_mergeable_vma(vma, file, vm_flags, vm_userfaultfd_ctx, anon_name) && in can_vma_merge_before()
940 can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags, in can_vma_merge_after() argument
946 if (is_mergeable_vma(vma, file, vm_flags, vm_userfaultfd_ctx, anon_name) && in can_vma_merge_after()
1001 unsigned long end, unsigned long vm_flags, in vma_merge() argument
1017 if (vm_flags & VM_SPECIAL) in vma_merge()
1033 can_vma_merge_after(prev, vm_flags, in vma_merge()
1041 can_vma_merge_before(next, vm_flags, in vma_merge()
1073 khugepaged_enter_vma(res, vm_flags); in vma_merge()
1095 !((a->vm_flags ^ b->vm_flags) & ~(VM_ACCESS_FLAGS | VM_SOFTDIRTY)) && in anon_vma_compatible()
1245 vm_flags_t vm_flags; in do_mmap() local
1306 vm_flags = calc_vm_prot_bits(prot, pkey) | calc_vm_flag_bits(flags) | in do_mmap()
1313 if (mlock_future_check(mm, vm_flags, len)) in do_mmap()
1353 vm_flags |= VM_SHARED | VM_MAYSHARE; in do_mmap()
1355 vm_flags &= ~(VM_MAYWRITE | VM_SHARED); in do_mmap()
1361 if (vm_flags & VM_EXEC) in do_mmap()
1363 vm_flags &= ~VM_MAYEXEC; in do_mmap()
1368 if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP)) in do_mmap()
1378 if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP)) in do_mmap()
1384 vm_flags |= VM_SHARED | VM_MAYSHARE; in do_mmap()
1404 vm_flags |= VM_NORESERVE; in do_mmap()
1408 vm_flags |= VM_NORESERVE; in do_mmap()
1411 addr = mmap_region(file, addr, len, vm_flags, pgoff, uf); in do_mmap()
1413 ((vm_flags & VM_LOCKED) || in do_mmap()
1503 vm_flags_t vm_flags = vma->vm_flags; in vma_wants_writenotify() local
1507 if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED))) in vma_wants_writenotify()
1517 pgprot_val(vm_pgprot_modify(vm_page_prot, vm_flags))) in vma_wants_writenotify()
1532 if (vm_flags & VM_PFNMAP) in vma_wants_writenotify()
1544 static inline int accountable_mapping(struct file *file, vm_flags_t vm_flags) in accountable_mapping() argument
1553 return (vm_flags & (VM_NORESERVE | VM_SHARED | VM_WRITE)) == VM_WRITE; in accountable_mapping()
1878 if (!may_expand_vm(mm, vma->vm_flags, grow)) in acct_stack_growth()
1886 if (mlock_future_check(mm, vma->vm_flags, grow << PAGE_SHIFT)) in acct_stack_growth()
1890 new_start = (vma->vm_flags & VM_GROWSUP) ? vma->vm_start : in acct_stack_growth()
1918 if (!(vma->vm_flags & VM_GROWSUP)) in expand_upwards()
1936 if (!(next->vm_flags & VM_GROWSUP)) in expand_upwards()
1978 if (vma->vm_flags & VM_LOCKED) in expand_upwards()
1980 vm_stat_account(mm, vma->vm_flags, grow); in expand_upwards()
1993 khugepaged_enter_vma(vma, vma->vm_flags); in expand_upwards()
2016 if (prev && !(prev->vm_flags & VM_GROWSDOWN) && in expand_downwards()
2059 if (vma->vm_flags & VM_LOCKED) in expand_downwards()
2061 vm_stat_account(mm, vma->vm_flags, grow); in expand_downwards()
2075 khugepaged_enter_vma(vma, vma->vm_flags); in expand_downwards()
2113 if (prev->vm_flags & VM_LOCKED) in find_extend_vma()
2135 if (!(vma->vm_flags & VM_GROWSDOWN)) in find_extend_vma()
2140 if (vma->vm_flags & VM_LOCKED) in find_extend_vma()
2164 if (vma->vm_flags & VM_ACCOUNT) in remove_mt()
2166 vm_stat_account(mm, vma->vm_flags, -nrpages); in remove_mt()
2283 if (vma->vm_flags & VM_LOCKED) in munmap_sidetree()
2436 if (next && (next->vm_flags & VM_GROWSDOWN)) in do_mas_align_munmap()
2438 else if (prev && (prev->vm_flags & VM_GROWSUP)) in do_mas_align_munmap()
2520 unsigned long len, vm_flags_t vm_flags, unsigned long pgoff, in mmap_region() argument
2535 if (!may_expand_vm(mm, vm_flags, len >> PAGE_SHIFT)) { in mmap_region()
2544 if (!may_expand_vm(mm, vm_flags, in mmap_region()
2556 if (accountable_mapping(file, vm_flags)) { in mmap_region()
2560 vm_flags |= VM_ACCOUNT; in mmap_region()
2565 if (vm_flags & VM_SPECIAL) in mmap_region()
2571 can_vma_merge_before(next, vm_flags, NULL, file, pgoff+pglen, in mmap_region()
2580 (vma ? can_vma_merge_after(prev, vm_flags, vma->anon_vma, file, in mmap_region()
2582 can_vma_merge_after(prev, vm_flags, NULL, file, pgoff, in mmap_region()
2593 khugepaged_enter_vma(vma, vm_flags); in mmap_region()
2613 vma->vm_flags = vm_flags; in mmap_region()
2614 vma->vm_page_prot = vm_get_page_prot(vm_flags); in mmap_region()
2618 if (vm_flags & VM_SHARED) { in mmap_region()
2643 if (unlikely(vm_flags != vma->vm_flags && prev)) { in mmap_region()
2644 merge = vma_merge(mm, prev, vma->vm_start, vma->vm_end, vma->vm_flags, in mmap_region()
2658 vm_flags = vma->vm_flags; in mmap_region()
2663 vm_flags = vma->vm_flags; in mmap_region()
2664 } else if (vm_flags & VM_SHARED) { in mmap_region()
2673 if (!arch_validate_flags(vma->vm_flags)) { in mmap_region()
2699 if (vma->vm_flags & VM_SHARED) in mmap_region()
2712 khugepaged_enter_vma(vma, vma->vm_flags); in mmap_region()
2716 if (file && vm_flags & VM_SHARED) in mmap_region()
2722 vm_stat_account(mm, vm_flags, len >> PAGE_SHIFT); in mmap_region()
2723 if (vm_flags & VM_LOCKED) { in mmap_region()
2724 if ((vm_flags & VM_SPECIAL) || vma_is_dax(vma) || in mmap_region()
2727 vma->vm_flags &= VM_LOCKED_CLEAR_MASK; in mmap_region()
2742 vma->vm_flags |= VM_SOFTDIRTY; in mmap_region()
2758 if (file && (vm_flags & VM_SHARED)) in mmap_region()
2841 if (!vma || !(vma->vm_flags & VM_SHARED)) in SYSCALL_DEFINE5()
2856 if (next->vm_flags != vma->vm_flags) in SYSCALL_DEFINE5()
2869 prot |= vma->vm_flags & VM_READ ? PROT_READ : 0; in SYSCALL_DEFINE5()
2870 prot |= vma->vm_flags & VM_WRITE ? PROT_WRITE : 0; in SYSCALL_DEFINE5()
2871 prot |= vma->vm_flags & VM_EXEC ? PROT_EXEC : 0; in SYSCALL_DEFINE5()
2875 if (vma->vm_flags & VM_LOCKED) in SYSCALL_DEFINE5()
2965 vma->vm_flags |= VM_SOFTDIRTY; in do_brk_flags()
2985 vma->vm_flags = flags; in do_brk_flags()
2998 vma->vm_flags |= VM_SOFTDIRTY; in do_brk_flags()
3108 if (vma->vm_flags & VM_ACCOUNT) in exit_mmap()
3135 if ((vma->vm_flags & VM_ACCOUNT) && in insert_vm_struct()
3192 new_vma = vma_merge(mm, prev, addr, addr + len, vma->vm_flags, in copy_vma()
3383 unsigned long vm_flags, void *priv, in __install_special_mapping() argument
3397 vma->vm_flags = vm_flags | mm->def_flags | VM_DONTEXPAND | VM_SOFTDIRTY; in __install_special_mapping()
3398 vma->vm_flags &= VM_LOCKED_CLEAR_MASK; in __install_special_mapping()
3399 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); in __install_special_mapping()
3408 vm_stat_account(mm, vma->vm_flags, len >> PAGE_SHIFT); in __install_special_mapping()
3441 unsigned long vm_flags, const struct vm_special_mapping *spec) in _install_special_mapping() argument
3443 return __install_special_mapping(mm, addr, len, vm_flags, (void *)spec, in _install_special_mapping()
3449 unsigned long vm_flags, struct page **pages) in install_special_mapping() argument
3452 mm, addr, len, vm_flags, (void *)pages, in install_special_mapping()