Lines Matching refs:vma
204 ret = expand_downwards(bprm->vma, pos); in get_arg_page()
223 acct_arg_size(bprm, vma_pages(bprm->vma)); in get_arg_page()
240 flush_cache_page(bprm->vma, pos, page_to_pfn(page)); in flush_arg_page()
246 struct vm_area_struct *vma = NULL; in __bprm_mm_init() local
249 bprm->vma = vma = vm_area_alloc(mm); in __bprm_mm_init()
250 if (!vma) in __bprm_mm_init()
252 vma_set_anonymous(vma); in __bprm_mm_init()
266 vma->vm_end = STACK_TOP_MAX; in __bprm_mm_init()
267 vma->vm_start = vma->vm_end - PAGE_SIZE; in __bprm_mm_init()
268 vma->vm_flags = VM_SOFTDIRTY | VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP; in __bprm_mm_init()
269 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); in __bprm_mm_init()
271 err = insert_vm_struct(mm, vma); in __bprm_mm_init()
276 arch_bprm_mm_init(mm, vma); in __bprm_mm_init()
278 bprm->p = vma->vm_end - sizeof(void *); in __bprm_mm_init()
283 bprm->vma = NULL; in __bprm_mm_init()
284 vm_area_free(vma); in __bprm_mm_init()
626 static int shift_arg_pages(struct vm_area_struct *vma, unsigned long shift) in shift_arg_pages() argument
628 struct mm_struct *mm = vma->vm_mm; in shift_arg_pages()
629 unsigned long old_start = vma->vm_start; in shift_arg_pages()
630 unsigned long old_end = vma->vm_end; in shift_arg_pages()
642 if (vma != find_vma(mm, new_start)) in shift_arg_pages()
648 if (vma_adjust(vma, new_start, old_end, vma->vm_pgoff, NULL)) in shift_arg_pages()
655 if (length != move_page_tables(vma, old_start, in shift_arg_pages()
656 vma, new_start, length, false)) in shift_arg_pages()
666 vma->vm_next ? vma->vm_next->vm_start : USER_PGTABLES_CEILING); in shift_arg_pages()
675 vma->vm_next ? vma->vm_next->vm_start : USER_PGTABLES_CEILING); in shift_arg_pages()
682 vma_adjust(vma, new_start, new_end, vma->vm_pgoff, NULL); in shift_arg_pages()
698 struct vm_area_struct *vma = bprm->vma; in setup_arg_pages() local
716 if (vma->vm_end - vma->vm_start > stack_base) in setup_arg_pages()
721 stack_shift = vma->vm_start - stack_base; in setup_arg_pages()
723 bprm->p = vma->vm_end - stack_shift; in setup_arg_pages()
729 unlikely(vma->vm_end - vma->vm_start >= stack_top - mmap_min_addr)) in setup_arg_pages()
732 stack_shift = vma->vm_end - stack_top; in setup_arg_pages()
759 ret = mprotect_fixup(vma, &prev, vma->vm_start, vma->vm_end, in setup_arg_pages()
763 BUG_ON(prev != vma); in setup_arg_pages()
767 ret = shift_arg_pages(vma, stack_shift); in setup_arg_pages()
773 vma->vm_flags &= ~VM_STACK_INCOMPLETE_SETUP; in setup_arg_pages()
776 stack_size = vma->vm_end - vma->vm_start; in setup_arg_pages()
784 stack_base = vma->vm_start + rlim_stack; in setup_arg_pages()
786 stack_base = vma->vm_end + stack_expand; in setup_arg_pages()
789 stack_base = vma->vm_end - rlim_stack; in setup_arg_pages()
791 stack_base = vma->vm_start - stack_expand; in setup_arg_pages()
794 ret = expand_stack(vma, stack_base); in setup_arg_pages()