Lines Matching refs:vma

69                struct vm_area_struct *vma,
222 struct vm_area_struct *vma; member
230 struct vm_area_struct *vma = st->vma; in mmap_gfn_range() local
240 ((msg->va+(msg->npages<<PAGE_SHIFT)) > vma->vm_end)) in mmap_gfn_range()
243 rc = xen_remap_domain_gfn_range(vma, in mmap_gfn_range()
246 vma->vm_page_prot, in mmap_gfn_range()
261 struct vm_area_struct *vma; in privcmd_ioctl_mmap() local
291 vma = vma_lookup(mm, msg->va); in privcmd_ioctl_mmap()
294 if (!vma || (msg->va != vma->vm_start) || vma->vm_private_data) in privcmd_ioctl_mmap()
296 vma->vm_private_data = PRIV_VMA_LOCKED; in privcmd_ioctl_mmap()
299 state.va = vma->vm_start; in privcmd_ioctl_mmap()
300 state.vma = vma; in privcmd_ioctl_mmap()
320 struct vm_area_struct *vma; member
344 struct vm_area_struct *vma = st->vma; in mmap_batch_fn() local
345 struct page **pages = vma->vm_private_data; in mmap_batch_fn()
353 ret = xen_remap_domain_gfn_array(st->vma, st->va & PAGE_MASK, gfnp, nr, in mmap_batch_fn()
354 (int *)gfnp, st->vma->vm_page_prot, in mmap_batch_fn()
424 static int alloc_empty_pages(struct vm_area_struct *vma, int numpgs) in alloc_empty_pages() argument
440 BUG_ON(vma->vm_private_data != NULL); in alloc_empty_pages()
441 vma->vm_private_data = pages; in alloc_empty_pages()
455 struct vm_area_struct *vma; in privcmd_ioctl_mmap_batch() local
507 vma = find_vma(mm, m.addr); in privcmd_ioctl_mmap_batch()
508 if (!vma || in privcmd_ioctl_mmap_batch()
509 vma->vm_ops != &privcmd_vm_ops) { in privcmd_ioctl_mmap_batch()
525 if (vma->vm_private_data == NULL) { in privcmd_ioctl_mmap_batch()
526 if (m.addr != vma->vm_start || in privcmd_ioctl_mmap_batch()
527 m.addr + (nr_pages << PAGE_SHIFT) != vma->vm_end) { in privcmd_ioctl_mmap_batch()
532 ret = alloc_empty_pages(vma, nr_pages); in privcmd_ioctl_mmap_batch()
536 vma->vm_private_data = PRIV_VMA_LOCKED; in privcmd_ioctl_mmap_batch()
538 if (m.addr < vma->vm_start || in privcmd_ioctl_mmap_batch()
539 m.addr + (nr_pages << PAGE_SHIFT) > vma->vm_end) { in privcmd_ioctl_mmap_batch()
543 if (privcmd_vma_range_is_mapped(vma, m.addr, nr_pages)) { in privcmd_ioctl_mmap_batch()
550 state.vma = vma; in privcmd_ioctl_mmap_batch()
732 struct vm_area_struct *vma; in privcmd_ioctl_mmap_resource() local
763 vma = find_vma(mm, kdata.addr); in privcmd_ioctl_mmap_resource()
764 if (!vma || vma->vm_ops != &privcmd_vm_ops) { in privcmd_ioctl_mmap_resource()
781 rc = alloc_empty_pages(vma, nr); in privcmd_ioctl_mmap_resource()
785 pages = vma->vm_private_data; in privcmd_ioctl_mmap_resource()
793 vma->vm_private_data = PRIV_VMA_LOCKED; in privcmd_ioctl_mmap_resource()
808 rc = xen_remap_vma_range(vma, kdata.addr, kdata.num << PAGE_SHIFT); in privcmd_ioctl_mmap_resource()
816 num = xen_remap_domain_mfn_array(vma, in privcmd_ioctl_mmap_resource()
819 vma->vm_page_prot, in privcmd_ioctl_mmap_resource()
1179 static void privcmd_close(struct vm_area_struct *vma) in privcmd_close() argument
1181 struct page **pages = vma->vm_private_data; in privcmd_close()
1182 int numpgs = vma_pages(vma); in privcmd_close()
1183 int numgfns = (vma->vm_end - vma->vm_start) >> XEN_PAGE_SHIFT; in privcmd_close()
1189 rc = xen_unmap_domain_gfn_range(vma, numgfns, pages); in privcmd_close()
1201 vmf->vma, vmf->vma->vm_start, vmf->vma->vm_end, in privcmd_fault()
1212 static int privcmd_mmap(struct file *file, struct vm_area_struct *vma) in privcmd_mmap() argument
1216 vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTCOPY | in privcmd_mmap()
1218 vma->vm_ops = &privcmd_vm_ops; in privcmd_mmap()
1219 vma->vm_private_data = NULL; in privcmd_mmap()
1235 struct vm_area_struct *vma, in privcmd_vma_range_is_mapped() argument
1239 return apply_to_page_range(vma->vm_mm, addr, nr_pages << PAGE_SHIFT, in privcmd_vma_range_is_mapped()