search for: vm_start

Displaying 20 results from an estimated 129 matches for "vm_start".

Did you mean: va_start
2019 Oct 30
0
[PATCH v2 09/15] xen/gntdev: use mmu_range_notifier_insert
...ev_vmops = { > > /* ------------------------------------------------------------------ */ > > -static bool in_range(struct gntdev_grant_map *map, > - unsigned long start, unsigned long end) > -{ > - if (!map->vma) > - return false; > - if (map->vma->vm_start >= end) > - return false; > - if (map->vma->vm_end <= start) > - return false; > - > - return true; > -} > - > -static int unmap_if_in_range(struct gntdev_grant_map *map, > - unsigned long start, unsigned long end, > - bool blockable) >...
2019 Oct 28
1
[PATCH v2 09/15] xen/gntdev: use mmu_range_notifier_insert
...static const struct vm_operations_struct gntdev_vmops = { /* ------------------------------------------------------------------ */ -static bool in_range(struct gntdev_grant_map *map, - unsigned long start, unsigned long end) -{ - if (!map->vma) - return false; - if (map->vma->vm_start >= end) - return false; - if (map->vma->vm_end <= start) - return false; - - return true; -} - -static int unmap_if_in_range(struct gntdev_grant_map *map, - unsigned long start, unsigned long end, - bool blockable) +static bool gntdev_invalidate(struct mmu_range_notifi...
2020 Mar 04
5
[PATCH v3 0/4] nouveau/hmm: map pages after migration
Originally patch 4 was targeted for Jason's rdma tree since other HMM related changes were queued there. Now that those have been merged, these patches just contain changes to nouveau so they could go through any tree. I guess Ben Skeggs' tree would be appropriate. Changes since v2: Added patches 1-3 to fix some minor issues. Eliminated nouveau_find_svmm() since it is easily found.
2020 Mar 04
0
[PATCH v3 1/4] nouveau/hmm: fix vma range check for migration
find_vma_intersection(mm, start, end) only guarantees that end is greater than or equal to vma->vm_start but doesn't guarantee that start is greater than or equal to vma->vm_start. The calculation for the intersecting range in nouveau_svmm_bind() isn't accounting for this and can call migrate_vma_setup() with a starting address less than vma->vm_start. This results in migrate_vma_setup()...
2020 Apr 15
0
[PATCH AUTOSEL 5.6 078/129] drm/nouveau/svm: fix vma range check for migration
From: Ralph Campbell <rcampbell at nvidia.com> [ Upstream commit b92103b559c77abc5f8b7bec269230a219c880b7 ] find_vma_intersection(mm, start, end) only guarantees that end is greater than or equal to vma->vm_start but doesn't guarantee that start is greater than or equal to vma->vm_start. The calculation for the intersecting range in nouveau_svmm_bind() isn't accounting for this and can call migrate_vma_setup() with a starting address less than vma->vm_start. This results in migrate_vma_setup()...
2020 Apr 15
0
[PATCH AUTOSEL 5.5 066/106] drm/nouveau/svm: fix vma range check for migration
From: Ralph Campbell <rcampbell at nvidia.com> [ Upstream commit b92103b559c77abc5f8b7bec269230a219c880b7 ] find_vma_intersection(mm, start, end) only guarantees that end is greater than or equal to vma->vm_start but doesn't guarantee that start is greater than or equal to vma->vm_start. The calculation for the intersecting range in nouveau_svmm_bind() isn't accounting for this and can call migrate_vma_setup() with a starting address less than vma->vm_start. This results in migrate_vma_setup()...
2020 Apr 15
0
[PATCH AUTOSEL 5.4 49/84] drm/nouveau/svm: fix vma range check for migration
From: Ralph Campbell <rcampbell at nvidia.com> [ Upstream commit b92103b559c77abc5f8b7bec269230a219c880b7 ] find_vma_intersection(mm, start, end) only guarantees that end is greater than or equal to vma->vm_start but doesn't guarantee that start is greater than or equal to vma->vm_start. The calculation for the intersecting range in nouveau_svmm_bind() isn't accounting for this and can call migrate_vma_setup() with a starting address less than vma->vm_start. This results in migrate_vma_setup()...
2010 Dec 08
2
[PATCH] xen: gntdev: move use of GNTMAP_contains_pte next to the map_op
...m_area_struct * vma) static void hypercall_vm_close(struct vm_area_struct * vma) { struct mmap_hypercall *priv = vma->vm_private_data; - struct page *page; + struct page *page, *tpage; printk(KERN_CRIT "hypercall_vm_close: vma %p %#lx-%#lx (%#lx) priv %p\n", vma, vma->vm_start, vma->vm_end, vma->vm_end - vma->vm_start, priv); - list_for_each_entry(page, &priv->list, lru) { + spin_lock(&priv->lock); + list_for_each_entry_safe(page, tpage, &priv->list, lru) { printk(KERN_CRIT "hypercall vm_close: page %p count %d\n", page, page_...
2020 May 29
1
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...*v = vma->vm_file->private_data; > + struct vdpa_device *vdpa = v->vdpa; > + const struct vdpa_config_ops *ops = vdpa->config; > + struct vdpa_notification_area notify; > + int index = vma->vm_pgoff; > + > + if (vma->vm_end - vma->vm_start != PAGE_SIZE) > + return -EINVAL; > + if ((vma->vm_flags & VM_SHARED) == 0) > + return -EINVAL; > + if (vma->vm_flags & VM_READ) > + return -EINVAL; > + if (index > 65535) > + return -EIN...
2007 Apr 18
2
[PATCH] exec-shield style vdso move.
...page, + memcpy(syscall_page, &vsyscall_sysenter_start, &vsyscall_sysenter_end - &vsyscall_sysenter_start); return 0; } + +static struct page* +syscall_nopage(struct vm_area_struct *vma, unsigned long adr, int *type) +{ + struct page *p = virt_to_page(adr - vma->vm_start + syscall_page); + get_page(p); + return p; +} + +/* Prevent VMA merging */ +static void syscall_vma_close(struct vm_area_struct *vma) +{ +} + +static struct vm_operations_struct syscall_vm_ops = { + .close = syscall_vma_close, + .nopage = syscall_nopage, +}; + +/* Defined in vsyscall-sysenter.S */...
2007 Apr 18
2
[PATCH] exec-shield style vdso move.
...page, + memcpy(syscall_page, &vsyscall_sysenter_start, &vsyscall_sysenter_end - &vsyscall_sysenter_start); return 0; } + +static struct page* +syscall_nopage(struct vm_area_struct *vma, unsigned long adr, int *type) +{ + struct page *p = virt_to_page(adr - vma->vm_start + syscall_page); + get_page(p); + return p; +} + +/* Prevent VMA merging */ +static void syscall_vma_close(struct vm_area_struct *vma) +{ +} + +static struct vm_operations_struct syscall_vm_ops = { + .close = syscall_vma_close, + .nopage = syscall_nopage, +}; + +/* Defined in vsyscall-sysenter.S */...
2019 Oct 29
2
[PATCH v2 12/15] drm/amdgpu: Call find_vma under mmap_sem
...down */ > - return -ESRCH; > - > if (unlikely(!mirror)) { > DRM_DEBUG_DRIVER("Failed to get hmm_mirror\n"); > - r = -EFAULT; > - goto out; > + return -EFAULT; > } > > - vma = find_vma(mm, start); > - if (unlikely(!vma || start < vma->vm_start)) { > - r = -EFAULT; > - goto out; > - } > - if (unlikely((gtt->userflags & AMDGPU_GEM_USERPTR_ANONONLY) && > - vma->vm_file)) { > - r = -EPERM; > - goto out; > - } > + mm = mirror->hmm->mmu_notifier.mm; > + if (!mmget_not_zero(mm)) /* Happ...
2020 Jan 13
0
[PATCH v6 5/6] nouveau: use new mmu interval notifiers
...range->end = mmu_interval_notifier_start(mni); + last = range->end - 1; + } + /* + * Might as well create an interval covering the underlying VMA to + * avoid having to create a bunch of small intervals. + */ + vma = find_vma(svmm->mm, range->start); + if (!vma || start < vma->vm_start) { + ret = -ENOENT; + goto err; + } + if (range->end > vma->vm_end) { + range->end = vma->vm_end; + last = range->end - 1; + } else if (!mni) { + /* Anything registered on the right part of the vma? */ + mni = mmu_interval_notifier_find(svmm->mm, &nouveau_svm_mni_ops,...
2020 Jun 10
1
[PATCH] vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()
...vdpa_mmap(struct file *file, struct vm_area_struct *vma) struct vdpa_device *vdpa = v->vdpa; const struct vdpa_config_ops *ops = vdpa->config; struct vdpa_notification_area notify; - int index = vma->vm_pgoff; + unsigned long index = vma->vm_pgoff; if (vma->vm_end - vma->vm_start != PAGE_SIZE) return -EINVAL; -- 2.26.2
2011 Mar 19
1
[patch 1/2] xen-gntdev: return -EFAULT on copy_to_user failure
...Carpenter <error27 at gmail.com> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 017ce60..b0f9e8f 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -273,7 +273,7 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages) map->vma->vm_start + map->notify.addr; err = copy_to_user(tmp, &err, 1); if (err) - return err; + return -EFAULT; map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE; } else if (pgno >= offset && pgno < offset + pages) { uint8_t *tmp = kmap(map->pages[pgno]);
2011 Mar 19
1
[patch 1/2] xen-gntdev: return -EFAULT on copy_to_user failure
...Carpenter <error27 at gmail.com> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 017ce60..b0f9e8f 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -273,7 +273,7 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages) map->vma->vm_start + map->notify.addr; err = copy_to_user(tmp, &err, 1); if (err) - return err; + return -EFAULT; map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE; } else if (pgno >= offset && pgno < offset + pages) { uint8_t *tmp = kmap(map->pages[pgno]);
2011 Mar 19
1
[patch 1/2] xen-gntdev: return -EFAULT on copy_to_user failure
...Carpenter <error27 at gmail.com> diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 017ce60..b0f9e8f 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -273,7 +273,7 @@ static int __unmap_grant_pages(struct grant_map *map, int offset, int pages) map->vma->vm_start + map->notify.addr; err = copy_to_user(tmp, &err, 1); if (err) - return err; + return -EFAULT; map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE; } else if (pgno >= offset && pgno < offset + pages) { uint8_t *tmp = kmap(map->pages[pgno]);
2020 Aug 11
2
[PATCH 1/4] vdpa: introduce config op to get valid iova range
...gt;> This is ambiguous. Is end in the range or just behind it? >>>>> How about first/last? >>>> It is customary in the kernel to use start-end where end corresponds to >>>> the byte following the last in the range. See struct vm_area_struct >>>> vm_start and vm_end fields >>> Exactly my point: >>> >>> include/linux/mm_types.h: unsigned long vm_end; /* The first byte after our end address >>> >>> in this case Jason wants it to be the last byte, not one behind. >>> >>> &gt...
2020 Aug 11
2
[PATCH 1/4] vdpa: introduce config op to get valid iova range
...gt;> This is ambiguous. Is end in the range or just behind it? >>>>> How about first/last? >>>> It is customary in the kernel to use start-end where end corresponds to >>>> the byte following the last in the range. See struct vm_area_struct >>>> vm_start and vm_end fields >>> Exactly my point: >>> >>> include/linux/mm_types.h: unsigned long vm_end; /* The first byte after our end address >>> >>> in this case Jason wants it to be the last byte, not one behind. >>> >>> &gt...
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...e *file, struct vm_area_struct *vma) +{ + struct vhost_vdpa *v = vma->vm_file->private_data; + struct vdpa_device *vdpa = v->vdpa; + const struct vdpa_config_ops *ops = vdpa->config; + struct vdpa_notification_area notify; + int index = vma->vm_pgoff; + + if (vma->vm_end - vma->vm_start != PAGE_SIZE) + return -EINVAL; + if ((vma->vm_flags & VM_SHARED) == 0) + return -EINVAL; + if (vma->vm_flags & VM_READ) + return -EINVAL; + if (index > 65535) + return -EINVAL; + if (!ops->get_vq_notification) + return -ENOTSUPP; + + /* To be safe and easily modelled by us...