Home
last modified time | relevance | path

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

/kernel/events/
Duprobes.c121 static bool valid_vma(struct vm_area_struct *vma, bool is_register) in valid_vma() argument
128 return vma->vm_file && (vma->vm_flags & flags) == VM_MAYEXEC; in valid_vma()
131 static unsigned long offset_to_vaddr(struct vm_area_struct *vma, loff_t offset) in offset_to_vaddr() argument
133 return vma->vm_start + offset - ((loff_t)vma->vm_pgoff << PAGE_SHIFT); in offset_to_vaddr()
136 static loff_t vaddr_to_offset(struct vm_area_struct *vma, unsigned long vaddr) in vaddr_to_offset() argument
138 return ((loff_t)vma->vm_pgoff << PAGE_SHIFT) + (vaddr - vma->vm_start); in vaddr_to_offset()
154 static int __replace_page(struct vm_area_struct *vma, unsigned long addr, in __replace_page() argument
157 struct mm_struct *mm = vma->vm_mm; in __replace_page()
160 .vma = vma, in __replace_page()
166 mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, mm, addr, in __replace_page()
[all …]
Dcore.c5841 struct perf_event *event = vmf->vma->vm_file->private_data; in perf_mmap_fault()
5864 vmf->page->mapping = vmf->vma->vm_file->f_mapping; in perf_mmap_fault()
5979 static void perf_mmap_open(struct vm_area_struct *vma) in perf_mmap_open() argument
5981 struct perf_event *event = vma->vm_file->private_data; in perf_mmap_open()
5986 if (vma->vm_pgoff) in perf_mmap_open()
5990 event->pmu->event_mapped(event, vma->vm_mm); in perf_mmap_open()
6003 static void perf_mmap_close(struct vm_area_struct *vma) in perf_mmap_close() argument
6005 struct perf_event *event = vma->vm_file->private_data; in perf_mmap_close()
6013 event->pmu->event_unmapped(event, vma->vm_mm); in perf_mmap_close()
6020 if (rb_has_aux(rb) && vma->vm_pgoff == rb->aux_pgoff && in perf_mmap_close()
[all …]
/kernel/dma/
Dops_helpers.c34 int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, in dma_common_mmap() argument
39 unsigned long user_count = vma_pages(vma); in dma_common_mmap()
41 unsigned long off = vma->vm_pgoff; in dma_common_mmap()
45 vma->vm_page_prot = dma_pgprot(dev, vma->vm_page_prot, attrs); in dma_common_mmap()
47 if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret)) in dma_common_mmap()
53 return remap_pfn_range(vma, vma->vm_start, in dma_common_mmap()
54 page_to_pfn(page) + vma->vm_pgoff, in dma_common_mmap()
55 user_count << PAGE_SHIFT, vma->vm_page_prot); in dma_common_mmap()
Dcoherent.c264 struct vm_area_struct *vma, void *vaddr, size_t size, int *ret) in __dma_mmap_from_coherent() argument
268 unsigned long off = vma->vm_pgoff; in __dma_mmap_from_coherent()
270 unsigned long user_count = vma_pages(vma); in __dma_mmap_from_coherent()
276 *ret = remap_pfn_range(vma, vma->vm_start, pfn, in __dma_mmap_from_coherent()
278 vma->vm_page_prot); in __dma_mmap_from_coherent()
300 int dma_mmap_from_dev_coherent(struct device *dev, struct vm_area_struct *vma, in dma_mmap_from_dev_coherent() argument
305 return __dma_mmap_from_coherent(mem, vma, vaddr, size, ret); in dma_mmap_from_dev_coherent()
308 int dma_mmap_from_global_coherent(struct vm_area_struct *vma, void *vaddr, in dma_mmap_from_global_coherent() argument
314 return __dma_mmap_from_coherent(dma_coherent_default_memory, vma, in dma_mmap_from_global_coherent()
Ddirect.c450 int dma_direct_mmap(struct device *dev, struct vm_area_struct *vma, in dma_direct_mmap() argument
454 unsigned long user_count = vma_pages(vma); in dma_direct_mmap()
459 vma->vm_page_prot = dma_pgprot(dev, vma->vm_page_prot, attrs); in dma_direct_mmap()
461 if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret)) in dma_direct_mmap()
464 if (vma->vm_pgoff >= count || user_count > count - vma->vm_pgoff) in dma_direct_mmap()
466 return remap_pfn_range(vma, vma->vm_start, pfn + vma->vm_pgoff, in dma_direct_mmap()
467 user_count << PAGE_SHIFT, vma->vm_page_prot); in dma_direct_mmap()
Ddummy.c7 static int dma_dummy_mmap(struct device *dev, struct vm_area_struct *vma, in dma_dummy_mmap() argument
Dmapping.c388 int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma, in dma_mmap_attrs() argument
395 return dma_direct_mmap(dev, vma, cpu_addr, dma_addr, size, in dma_mmap_attrs()
399 return ops->mmap(dev, vma, cpu_addr, dma_addr, size, attrs); in dma_mmap_attrs()
Ddirect.h16 int dma_direct_mmap(struct device *dev, struct vm_area_struct *vma,
/kernel/
Dsys.c1896 struct vm_area_struct *vma; in prctl_set_mm_exe_file() local
1899 for (vma = mm->mmap; vma; vma = vma->vm_next) { in prctl_set_mm_exe_file()
1900 if (!vma->vm_file) in prctl_set_mm_exe_file()
1902 if (path_equal(&vma->vm_file->f_path, in prctl_set_mm_exe_file()
2141 struct vm_area_struct *vma; in prctl_set_mm() local
2174 vma = find_vma(mm, addr); in prctl_set_mm()
2244 if (!vma) { in prctl_set_mm()
2311 static int prctl_update_vma_anon_name(struct vm_area_struct *vma, in prctl_update_vma_anon_name() argument
2316 struct mm_struct *mm = vma->vm_mm; in prctl_update_vma_anon_name()
2320 if (name_addr == vma_get_anon_name(vma)) { in prctl_update_vma_anon_name()
[all …]
Dacct.c544 struct vm_area_struct *vma; in acct_collect() local
547 vma = current->mm->mmap; in acct_collect()
548 while (vma) { in acct_collect()
549 vsize += vma->vm_end - vma->vm_start; in acct_collect()
550 vma = vma->vm_next; in acct_collect()
Drelay.c33 static void relay_file_mmap_close(struct vm_area_struct *vma) in relay_file_mmap_close() argument
35 struct rchan_buf *buf = vma->vm_private_data; in relay_file_mmap_close()
36 buf->chan->cb->buf_unmapped(buf, vma->vm_file); in relay_file_mmap_close()
45 struct rchan_buf *buf = vmf->vma->vm_private_data; in relay_buf_fault()
96 static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma) in relay_mmap_buf() argument
98 unsigned long length = vma->vm_end - vma->vm_start; in relay_mmap_buf()
99 struct file *filp = vma->vm_file; in relay_mmap_buf()
107 vma->vm_ops = &relay_file_mmap_ops; in relay_mmap_buf()
108 vma->vm_flags |= VM_DONTEXPAND; in relay_mmap_buf()
109 vma->vm_private_data = buf; in relay_mmap_buf()
[all …]
Dkcov.c456 static int kcov_mmap(struct file *filep, struct vm_area_struct *vma) in kcov_mmap() argument
460 struct kcov *kcov = vma->vm_file->private_data; in kcov_mmap()
465 area = vmalloc_user(vma->vm_end - vma->vm_start); in kcov_mmap()
471 if (kcov->mode != KCOV_MODE_INIT || vma->vm_pgoff != 0 || in kcov_mmap()
472 vma->vm_end - vma->vm_start != size) { in kcov_mmap()
478 vma->vm_flags |= VM_DONTEXPAND; in kcov_mmap()
482 if (vm_insert_page(vma, vma->vm_start + off, page)) in kcov_mmap()
Dfork.c352 struct vm_area_struct *vma; in vm_area_alloc() local
354 vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); in vm_area_alloc()
355 if (vma) in vm_area_alloc()
356 vma_init(vma, mm); in vm_area_alloc()
357 return vma; in vm_area_alloc()
378 void vm_area_free(struct vm_area_struct *vma) in vm_area_free() argument
380 kmem_cache_free(vm_area_cachep, vma); in vm_area_free()
Dsignal.c4565 __weak const char *arch_vma_name(struct vm_area_struct *vma) in arch_vma_name() argument
/kernel/bpf/
Dringbuf.c245 static int ringbuf_map_mmap(struct bpf_map *map, struct vm_area_struct *vma) in ringbuf_map_mmap() argument
251 if (vma->vm_flags & VM_WRITE) { in ringbuf_map_mmap()
253 if (vma->vm_pgoff != 0 || vma->vm_end - vma->vm_start != PAGE_SIZE) in ringbuf_map_mmap()
256 vma->vm_flags &= ~VM_MAYWRITE; in ringbuf_map_mmap()
259 return remap_vmalloc_range(vma, rb_map->rb, in ringbuf_map_mmap()
260 vma->vm_pgoff + RINGBUF_PGOFF); in ringbuf_map_mmap()
Dstackmap.c255 static int stack_map_get_build_id(struct vm_area_struct *vma, in stack_map_get_build_id() argument
264 if (!vma->vm_file) in stack_map_get_build_id()
267 page = find_get_page(vma->vm_file->f_mapping, 0); in stack_map_get_build_id()
297 struct vm_area_struct *vma; in stack_map_get_build_id_offset() local
339 vma = find_vma(current->mm, ips[i]); in stack_map_get_build_id_offset()
340 if (!vma || stack_map_get_build_id(vma, id_offs[i].build_id)) { in stack_map_get_build_id_offset()
347 id_offs[i].offset = (vma->vm_pgoff << PAGE_SHIFT) + ips[i] in stack_map_get_build_id_offset()
348 - vma->vm_start; in stack_map_get_build_id_offset()
Darraymap.c483 static int array_map_mmap(struct bpf_map *map, struct vm_area_struct *vma) in array_map_mmap() argument
491 if (vma->vm_pgoff * PAGE_SIZE + (vma->vm_end - vma->vm_start) > in array_map_mmap()
495 return remap_vmalloc_range(vma, array_map_vmalloc_addr(array), in array_map_mmap()
496 vma->vm_pgoff + pgoff); in array_map_mmap()
Dsyscall.c605 static void bpf_map_mmap_open(struct vm_area_struct *vma) in bpf_map_mmap_open() argument
607 struct bpf_map *map = vma->vm_file->private_data; in bpf_map_mmap_open()
609 if (vma->vm_flags & VM_MAYWRITE) in bpf_map_mmap_open()
614 static void bpf_map_mmap_close(struct vm_area_struct *vma) in bpf_map_mmap_close() argument
616 struct bpf_map *map = vma->vm_file->private_data; in bpf_map_mmap_close()
618 if (vma->vm_flags & VM_MAYWRITE) in bpf_map_mmap_close()
627 static int bpf_map_mmap(struct file *filp, struct vm_area_struct *vma) in bpf_map_mmap() argument
635 if (!(vma->vm_flags & VM_SHARED)) in bpf_map_mmap()
640 if (vma->vm_flags & VM_WRITE) { in bpf_map_mmap()
657 vma->vm_ops = &bpf_map_default_vmops; in bpf_map_mmap()
[all …]
/kernel/trace/
Dtrace_output.c394 const struct vm_area_struct *vma; in seq_print_user_ip() local
397 vma = find_vma(mm, ip); in seq_print_user_ip()
398 if (vma) { in seq_print_user_ip()
399 file = vma->vm_file; in seq_print_user_ip()
400 vmstart = vma->vm_start; in seq_print_user_ip()
/kernel/sched/
Dfair.c2742 struct vm_area_struct *vma; in task_numa_work() local
2798 vma = find_vma(mm, start); in task_numa_work()
2799 if (!vma) { in task_numa_work()
2802 vma = mm->mmap; in task_numa_work()
2804 for (; vma; vma = vma->vm_next) { in task_numa_work()
2805 if (!vma_migratable(vma) || !vma_policy_mof(vma) || in task_numa_work()
2806 is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) { in task_numa_work()
2816 if (!vma->vm_mm || in task_numa_work()
2817 (vma->vm_file && (vma->vm_flags & (VM_READ|VM_WRITE)) == (VM_READ))) in task_numa_work()
2824 if (!vma_is_accessible(vma)) in task_numa_work()
[all …]