Home
last modified time | relevance | path

Searched refs:vma (Results 1 – 25 of 1026) sorted by relevance

12345678910>>...42

/linux-6.6.21/drivers/gpu/drm/i915/
Di915_vma.h51 static inline bool i915_vma_is_active(const struct i915_vma *vma) in i915_vma_is_active() argument
53 return !i915_active_is_idle(&vma->active); in i915_vma_is_active()
60 int __must_check _i915_vma_move_to_active(struct i915_vma *vma,
65 i915_vma_move_to_active(struct i915_vma *vma, struct i915_request *rq, in i915_vma_move_to_active() argument
68 return _i915_vma_move_to_active(vma, rq, &rq->fence, flags); in i915_vma_move_to_active()
73 static inline bool i915_vma_is_ggtt(const struct i915_vma *vma) in i915_vma_is_ggtt() argument
75 return test_bit(I915_VMA_GGTT_BIT, __i915_vma_flags(vma)); in i915_vma_is_ggtt()
78 static inline bool i915_vma_is_dpt(const struct i915_vma *vma) in i915_vma_is_dpt() argument
80 return i915_is_dpt(vma->vm); in i915_vma_is_dpt()
83 static inline bool i915_vma_has_ggtt_write(const struct i915_vma *vma) in i915_vma_has_ggtt_write() argument
[all …]
Di915_vma.c46 static inline void assert_vma_held_evict(const struct i915_vma *vma) in assert_vma_held_evict() argument
53 if (kref_read(&vma->vm->ref)) in assert_vma_held_evict()
54 assert_object_held_shared(vma->obj); in assert_vma_held_evict()
64 static void i915_vma_free(struct i915_vma *vma) in i915_vma_free() argument
66 return kmem_cache_free(slab_vmas, vma); in i915_vma_free()
73 static void vma_print_allocator(struct i915_vma *vma, const char *reason) in vma_print_allocator() argument
77 if (!vma->node.stack) { in vma_print_allocator()
78 drm_dbg(vma->obj->base.dev, in vma_print_allocator()
80 vma->node.start, vma->node.size, reason); in vma_print_allocator()
84 stack_depot_snprint(vma->node.stack, buf, sizeof(buf), 0); in vma_print_allocator()
[all …]
Di915_gem_evict.c41 static bool dying_vma(struct i915_vma *vma)
43 return !kref_read(&vma->obj->base.refcount);
67 static bool grab_vma(struct i915_vma *vma, struct i915_gem_ww_ctx *ww) in grab_vma() argument
73 if (i915_gem_object_get_rcu(vma->obj)) { in grab_vma()
74 if (!i915_gem_object_trylock(vma->obj, ww)) { in grab_vma()
75 i915_gem_object_put(vma->obj); in grab_vma()
80 atomic_and(~I915_VMA_PIN_MASK, &vma->flags); in grab_vma()
86 static void ungrab_vma(struct i915_vma *vma) in ungrab_vma() argument
88 if (dying_vma(vma)) in ungrab_vma()
91 i915_gem_object_unlock(vma->obj); in ungrab_vma()
[all …]
/linux-6.6.21/drivers/gpu/drm/
Ddrm_vm.c59 struct vm_area_struct *vma; member
63 static void drm_vm_open(struct vm_area_struct *vma);
64 static void drm_vm_close(struct vm_area_struct *vma);
67 struct vm_area_struct *vma) in drm_io_prot() argument
69 pgprot_t tmp = vm_get_page_prot(vma->vm_flags); in drm_io_prot()
78 if (efi_range_is_wc(vma->vm_start, vma->vm_end - in drm_io_prot()
79 vma->vm_start)) in drm_io_prot()
89 static pgprot_t drm_dma_prot(uint32_t map_type, struct vm_area_struct *vma) in drm_dma_prot() argument
91 pgprot_t tmp = vm_get_page_prot(vma->vm_flags); in drm_dma_prot()
112 struct vm_area_struct *vma = vmf->vma; in drm_vm_fault() local
[all …]
/linux-6.6.21/mm/
Dmmap.c80 struct vm_area_struct *vma, struct vm_area_struct *prev,
90 void vma_set_page_prot(struct vm_area_struct *vma) in vma_set_page_prot() argument
92 unsigned long vm_flags = vma->vm_flags; in vma_set_page_prot()
95 vm_page_prot = vm_pgprot_modify(vma->vm_page_prot, vm_flags); in vma_set_page_prot()
96 if (vma_wants_writenotify(vma, vm_page_prot)) { in vma_set_page_prot()
101 WRITE_ONCE(vma->vm_page_prot, vm_page_prot); in vma_set_page_prot()
107 static void __remove_shared_vm_struct(struct vm_area_struct *vma, in __remove_shared_vm_struct() argument
110 if (vma->vm_flags & VM_SHARED) in __remove_shared_vm_struct()
114 vma_interval_tree_remove(vma, &mapping->i_mmap); in __remove_shared_vm_struct()
122 void unlink_file_vma(struct vm_area_struct *vma) in unlink_file_vma() argument
[all …]
Dmremap.c72 static pud_t *alloc_new_pud(struct mm_struct *mm, struct vm_area_struct *vma, in alloc_new_pud() argument
86 static pmd_t *alloc_new_pmd(struct mm_struct *mm, struct vm_area_struct *vma, in alloc_new_pmd() argument
92 pud = alloc_new_pud(mm, vma, addr); in alloc_new_pmd()
105 static void take_rmap_locks(struct vm_area_struct *vma) in take_rmap_locks() argument
107 if (vma->vm_file) in take_rmap_locks()
108 i_mmap_lock_write(vma->vm_file->f_mapping); in take_rmap_locks()
109 if (vma->anon_vma) in take_rmap_locks()
110 anon_vma_lock_write(vma->anon_vma); in take_rmap_locks()
113 static void drop_rmap_locks(struct vm_area_struct *vma) in drop_rmap_locks() argument
115 if (vma->anon_vma) in drop_rmap_locks()
[all …]
Dnommu.c99 struct vm_area_struct *vma; in kobjsize() local
101 vma = find_vma(current->mm, (unsigned long)objp); in kobjsize()
102 if (vma) in kobjsize()
103 return vma->vm_end - vma->vm_start; in kobjsize()
123 int follow_pfn(struct vm_area_struct *vma, unsigned long address, in follow_pfn() argument
126 if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) in follow_pfn()
172 struct vm_area_struct *vma; in __vmalloc_user_flags() local
175 vma = find_vma(current->mm, (unsigned long)ret); in __vmalloc_user_flags()
176 if (vma) in __vmalloc_user_flags()
177 vm_flags_set(vma, VM_USERMAP); in __vmalloc_user_flags()
[all …]
Dmadvise.c94 struct anon_vma_name *anon_vma_name(struct vm_area_struct *vma) in anon_vma_name() argument
96 mmap_assert_locked(vma->vm_mm); in anon_vma_name()
98 return vma->anon_name; in anon_vma_name()
102 static int replace_anon_vma_name(struct vm_area_struct *vma, in replace_anon_vma_name() argument
105 struct anon_vma_name *orig_name = anon_vma_name(vma); in replace_anon_vma_name()
108 vma->anon_name = NULL; in replace_anon_vma_name()
116 vma->anon_name = anon_vma_name_reuse(anon_name); in replace_anon_vma_name()
122 static int replace_anon_vma_name(struct vm_area_struct *vma, in replace_anon_vma_name() argument
137 static int madvise_update_vma(struct vm_area_struct *vma, in madvise_update_vma() argument
142 struct mm_struct *mm = vma->vm_mm; in madvise_update_vma()
[all …]
Dmprotect.c42 bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr, in can_change_pte_writable() argument
47 if (WARN_ON_ONCE(!(vma->vm_flags & VM_WRITE))) in can_change_pte_writable()
55 if (vma_soft_dirty_enabled(vma) && !pte_soft_dirty(pte)) in can_change_pte_writable()
59 if (userfaultfd_pte_wp(vma, pte)) in can_change_pte_writable()
62 if (!(vma->vm_flags & VM_SHARED)) { in can_change_pte_writable()
69 page = vm_normal_page(vma, addr, pte); in can_change_pte_writable()
84 struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, in change_pte_range() argument
96 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); in change_pte_range()
101 if (prot_numa && !(vma->vm_flags & VM_SHARED) && in change_pte_range()
102 atomic_read(&vma->vm_mm->mm_users) == 1) in change_pte_range()
[all …]
Dmemory.c364 struct vm_area_struct *vma, unsigned long floor, in free_pgtables() argument
368 unsigned long addr = vma->vm_start; in free_pgtables()
382 vma_start_write(vma); in free_pgtables()
383 unlink_anon_vmas(vma); in free_pgtables()
384 unlink_file_vma(vma); in free_pgtables()
386 if (is_vm_hugetlb_page(vma)) { in free_pgtables()
387 hugetlb_free_pgd_range(tlb, addr, vma->vm_end, in free_pgtables()
393 while (next && next->vm_start <= vma->vm_end + PMD_SIZE in free_pgtables()
395 vma = next; in free_pgtables()
398 vma_start_write(vma); in free_pgtables()
[all …]
Dhuge_memory.c74 bool hugepage_vma_check(struct vm_area_struct *vma, unsigned long vm_flags, in hugepage_vma_check() argument
77 if (!vma->vm_mm) /* vdso */ in hugepage_vma_check()
86 test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags)) in hugepage_vma_check()
95 if (vma_is_dax(vma)) in hugepage_vma_check()
113 !transhuge_vma_suitable(vma, (vma->vm_end - HPAGE_PMD_SIZE))) in hugepage_vma_check()
121 if (!in_pf && shmem_file(vma->vm_file)) in hugepage_vma_check()
122 return shmem_is_huge(file_inode(vma->vm_file), vma->vm_pgoff, in hugepage_vma_check()
123 !enforce_sysfs, vma->vm_mm, vm_flags); in hugepage_vma_check()
132 if (!in_pf && file_thp_enabled(vma)) in hugepage_vma_check()
135 if (!vma_is_anonymous(vma)) in hugepage_vma_check()
[all …]
Drmap.c150 static void anon_vma_chain_link(struct vm_area_struct *vma, in anon_vma_chain_link() argument
154 avc->vma = vma; in anon_vma_chain_link()
156 list_add(&avc->same_vma, &vma->anon_vma_chain); in anon_vma_chain_link()
188 int __anon_vma_prepare(struct vm_area_struct *vma) in __anon_vma_prepare() argument
190 struct mm_struct *mm = vma->vm_mm; in __anon_vma_prepare()
200 anon_vma = find_mergeable_anon_vma(vma); in __anon_vma_prepare()
213 if (likely(!vma->anon_vma)) { in __anon_vma_prepare()
214 vma->anon_vma = anon_vma; in __anon_vma_prepare()
215 anon_vma_chain_link(vma, avc, anon_vma); in __anon_vma_prepare()
335 int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) in anon_vma_fork() argument
[all …]
Dpagewalk.c154 if ((!walk->vma && (pmd_leaf(*pmd) || !pmd_present(*pmd))) || in walk_pmd_range()
159 if (walk->vma) in walk_pmd_range()
160 split_huge_pmd(walk->vma, pmd, addr); in walk_pmd_range()
208 if ((!walk->vma && (pud_leaf(*pud) || !pud_present(*pud))) || in walk_pud_range()
213 if (walk->vma) in walk_pud_range()
214 split_huge_pud(walk->vma, pud, addr); in walk_pud_range()
312 struct vm_area_struct *vma = walk->vma; in walk_hugetlb_range() local
313 struct hstate *h = hstate_vma(vma); in walk_hugetlb_range()
321 hugetlb_vma_lock_read(vma); in walk_hugetlb_range()
324 pte = hugetlb_walk(vma, addr & hmask, sz); in walk_hugetlb_range()
[all …]
Dmlock.c312 struct vm_area_struct *vma = walk->vma; in mlock_pte_range() local
318 ptl = pmd_trans_huge_lock(pmd, vma); in mlock_pte_range()
325 if (vma->vm_flags & VM_LOCKED) in mlock_pte_range()
332 start_pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); in mlock_pte_range()
341 folio = vm_normal_folio(vma, addr, ptent); in mlock_pte_range()
346 if (vma->vm_flags & VM_LOCKED) in mlock_pte_range()
369 static void mlock_vma_pages_range(struct vm_area_struct *vma, in mlock_vma_pages_range() argument
390 vma_start_write(vma); in mlock_vma_pages_range()
391 vm_flags_reset_once(vma, newflags); in mlock_vma_pages_range()
394 walk_page_range(vma->vm_mm, start, end, &mlock_walk_ops, NULL); in mlock_vma_pages_range()
[all …]
/linux-6.6.21/include/linux/
Duserfaultfd_k.h93 extern long uffd_wp_range(struct vm_area_struct *vma,
97 static inline bool is_mergeable_vm_userfaultfd_ctx(struct vm_area_struct *vma, in is_mergeable_vm_userfaultfd_ctx() argument
100 return vma->vm_userfaultfd_ctx.ctx == vm_ctx.ctx; in is_mergeable_vm_userfaultfd_ctx()
114 static inline bool uffd_disable_huge_pmd_share(struct vm_area_struct *vma) in uffd_disable_huge_pmd_share() argument
116 return vma->vm_flags & (VM_UFFD_WP | VM_UFFD_MINOR); in uffd_disable_huge_pmd_share()
126 static inline bool uffd_disable_fault_around(struct vm_area_struct *vma) in uffd_disable_fault_around() argument
128 return vma->vm_flags & (VM_UFFD_WP | VM_UFFD_MINOR); in uffd_disable_fault_around()
131 static inline bool userfaultfd_missing(struct vm_area_struct *vma) in userfaultfd_missing() argument
133 return vma->vm_flags & VM_UFFD_MISSING; in userfaultfd_missing()
136 static inline bool userfaultfd_wp(struct vm_area_struct *vma) in userfaultfd_wp() argument
[all …]
Dhuge_mm.h17 struct vm_area_struct *vma);
28 bool madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
30 int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, pmd_t *pmd,
32 int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma, pud_t *pud,
34 bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,
36 int change_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
100 static inline bool transhuge_vma_suitable(struct vm_area_struct *vma, in transhuge_vma_suitable() argument
106 if (!vma_is_anonymous(vma)) { in transhuge_vma_suitable()
107 if (!IS_ALIGNED((vma->vm_start >> PAGE_SHIFT) - vma->vm_pgoff, in transhuge_vma_suitable()
114 if (haddr < vma->vm_start || haddr + HPAGE_PMD_SIZE > vma->vm_end) in transhuge_vma_suitable()
[all …]
/linux-6.6.21/drivers/gpu/drm/i915/display/
Dintel_fb_pin.c30 struct i915_vma *vma; in intel_pin_fb_obj_dpt() local
73 vma = i915_vma_instance(obj, vm, view); in intel_pin_fb_obj_dpt()
74 if (IS_ERR(vma)) { in intel_pin_fb_obj_dpt()
75 ret = PTR_ERR(vma); in intel_pin_fb_obj_dpt()
79 if (i915_vma_misplaced(vma, 0, alignment, 0)) { in intel_pin_fb_obj_dpt()
80 ret = i915_vma_unbind(vma); in intel_pin_fb_obj_dpt()
85 ret = i915_vma_pin_ww(vma, &ww, 0, alignment, PIN_GLOBAL); in intel_pin_fb_obj_dpt()
90 vma = ERR_PTR(ret); in intel_pin_fb_obj_dpt()
94 vma->display_alignment = max(vma->display_alignment, alignment); in intel_pin_fb_obj_dpt()
98 i915_vma_get(vma); in intel_pin_fb_obj_dpt()
[all …]
/linux-6.6.21/drivers/gpu/drm/nouveau/
Dnouveau_vmm.c29 nouveau_vma_unmap(struct nouveau_vma *vma) in nouveau_vma_unmap() argument
31 if (vma->mem) { in nouveau_vma_unmap()
32 nvif_vmm_unmap(&vma->vmm->vmm, vma->addr); in nouveau_vma_unmap()
33 vma->mem = NULL; in nouveau_vma_unmap()
38 nouveau_vma_map(struct nouveau_vma *vma, struct nouveau_mem *mem) in nouveau_vma_map() argument
40 struct nvif_vma tmp = { .addr = vma->addr }; in nouveau_vma_map()
41 int ret = nouveau_mem_map(mem, &vma->vmm->vmm, &tmp); in nouveau_vma_map()
44 vma->mem = mem; in nouveau_vma_map()
51 struct nouveau_vma *vma; in nouveau_vma_find() local
53 list_for_each_entry(vma, &nvbo->vma_list, head) { in nouveau_vma_find()
[all …]
/linux-6.6.21/drivers/gpu/drm/msm/
Dmsm_gem_vma.c42 void msm_gem_vma_purge(struct msm_gem_vma *vma) in msm_gem_vma_purge() argument
44 struct msm_gem_address_space *aspace = vma->aspace; in msm_gem_vma_purge()
45 unsigned size = vma->node.size; in msm_gem_vma_purge()
48 if (!vma->mapped) in msm_gem_vma_purge()
51 aspace->mmu->funcs->unmap(aspace->mmu, vma->iova, size); in msm_gem_vma_purge()
53 vma->mapped = false; in msm_gem_vma_purge()
58 msm_gem_vma_map(struct msm_gem_vma *vma, int prot, in msm_gem_vma_map() argument
61 struct msm_gem_address_space *aspace = vma->aspace; in msm_gem_vma_map()
64 if (GEM_WARN_ON(!vma->iova)) in msm_gem_vma_map()
67 if (vma->mapped) in msm_gem_vma_map()
[all …]
/linux-6.6.21/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/
Dvmm.c802 struct nvkm_vma *vma = kzalloc(sizeof(*vma), GFP_KERNEL); in nvkm_vma_new() local
803 if (vma) { in nvkm_vma_new()
804 vma->addr = addr; in nvkm_vma_new()
805 vma->size = size; in nvkm_vma_new()
806 vma->page = NVKM_VMA_PAGE_NONE; in nvkm_vma_new()
807 vma->refd = NVKM_VMA_PAGE_NONE; in nvkm_vma_new()
809 return vma; in nvkm_vma_new()
813 nvkm_vma_tail(struct nvkm_vma *vma, u64 tail) in nvkm_vma_tail() argument
817 BUG_ON(vma->size == tail); in nvkm_vma_tail()
819 if (!(new = nvkm_vma_new(vma->addr + (vma->size - tail), tail))) in nvkm_vma_tail()
[all …]
/linux-6.6.21/drivers/gpu/drm/i915/selftests/
Di915_gem_gtt.c397 struct i915_vma *vma; in close_object_list() local
399 vma = i915_vma_instance(obj, vm, NULL); in close_object_list()
400 if (!IS_ERR(vma)) in close_object_list()
401 ignored = i915_vma_unbind_unlocked(vma); in close_object_list()
420 struct i915_vma *vma; in fill_hole() local
461 vma = i915_vma_instance(obj, vm, NULL); in fill_hole()
462 if (IS_ERR(vma)) in fill_hole()
471 err = i915_vma_pin(vma, 0, 0, offset | flags); in fill_hole()
478 if (!drm_mm_node_allocated(&vma->node) || in fill_hole()
479 i915_vma_misplaced(vma, 0, 0, offset | flags)) { in fill_hole()
[all …]
Di915_vma.c37 static bool assert_vma(struct i915_vma *vma, in assert_vma() argument
43 if (vma->vm != ctx->vm) { in assert_vma()
48 if (vma->size != obj->base.size) { in assert_vma()
50 vma->size, obj->base.size); in assert_vma()
54 if (vma->gtt_view.type != I915_GTT_VIEW_NORMAL) { in assert_vma()
56 vma->gtt_view.type); in assert_vma()
68 struct i915_vma *vma; in checked_vma_instance() local
71 vma = i915_vma_instance(obj, vm, view); in checked_vma_instance()
72 if (IS_ERR(vma)) in checked_vma_instance()
73 return vma; in checked_vma_instance()
[all …]
/linux-6.6.21/drivers/pci/
Dmmap.c23 struct vm_area_struct *vma, in pci_mmap_resource_range() argument
30 if (vma->vm_pgoff + vma_pages(vma) > size) in pci_mmap_resource_range()
34 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); in pci_mmap_resource_range()
36 vma->vm_page_prot = pgprot_device(vma->vm_page_prot); in pci_mmap_resource_range()
39 ret = pci_iobar_pfn(pdev, bar, vma); in pci_mmap_resource_range()
43 vma->vm_pgoff += (pci_resource_start(pdev, bar) >> PAGE_SHIFT); in pci_mmap_resource_range()
45 vma->vm_ops = &pci_phys_vm_ops; in pci_mmap_resource_range()
47 return io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, in pci_mmap_resource_range()
48 vma->vm_end - vma->vm_start, in pci_mmap_resource_range()
49 vma->vm_page_prot); in pci_mmap_resource_range()
/linux-6.6.21/arch/powerpc/mm/book3s64/
Dradix_hugetlbpage.c10 void radix__flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr) in radix__flush_hugetlb_page() argument
13 struct hstate *hstate = hstate_file(vma->vm_file); in radix__flush_hugetlb_page()
16 radix__flush_tlb_page_psize(vma->vm_mm, vmaddr, psize); in radix__flush_hugetlb_page()
19 void radix__local_flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr) in radix__local_flush_hugetlb_page() argument
22 struct hstate *hstate = hstate_file(vma->vm_file); in radix__local_flush_hugetlb_page()
25 radix__local_flush_tlb_page_psize(vma->vm_mm, vmaddr, psize); in radix__local_flush_hugetlb_page()
28 void radix__flush_hugetlb_tlb_range(struct vm_area_struct *vma, unsigned long start, in radix__flush_hugetlb_tlb_range() argument
32 struct hstate *hstate = hstate_file(vma->vm_file); in radix__flush_hugetlb_tlb_range()
39 radix__flush_tlb_pwc_range_psize(vma->vm_mm, start, end, psize); in radix__flush_hugetlb_tlb_range()
41 radix__flush_tlb_range_psize(vma->vm_mm, start, end, psize); in radix__flush_hugetlb_tlb_range()
[all …]
/linux-6.6.21/drivers/gpu/drm/i915/gt/
Dintel_ring.c37 struct i915_vma *vma = ring->vma; in intel_ring_pin() local
46 flags = PIN_OFFSET_BIAS | i915_ggtt_pin_bias(vma); in intel_ring_pin()
48 if (i915_gem_object_is_stolen(vma->obj)) in intel_ring_pin()
53 ret = i915_ggtt_pin(vma, ww, 0, flags); in intel_ring_pin()
57 if (i915_vma_is_map_and_fenceable(vma) && !HAS_LLC(vma->vm->i915)) { in intel_ring_pin()
58 addr = (void __force *)i915_vma_pin_iomap(vma); in intel_ring_pin()
60 int type = intel_gt_coherent_map_type(vma->vm->gt, vma->obj, false); in intel_ring_pin()
62 addr = i915_gem_object_pin_map(vma->obj, type); in intel_ring_pin()
70 i915_vma_make_unshrinkable(vma); in intel_ring_pin()
79 i915_vma_unpin(vma); in intel_ring_pin()
[all …]

12345678910>>...42