Displaying 20 results from an estimated 88 matches for "vm_pgoff".
2017 Sep 12
2
[PATCH] drm: qxl: ratelimit pr_info message, reduce log spamming
...iff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 7ecf8a4b9fe6..6502e699f462 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -124,7 +124,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
int r;
if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
- pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
+ pr_info_ratelimited("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
__func__, vma->vm_pgoff);
return -EINVAL;
}
--
2.14.1
2017 Sep 12
2
[PATCH] drm: qxl: ratelimit pr_info message, reduce log spamming
...iff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 7ecf8a4b9fe6..6502e699f462 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -124,7 +124,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
int r;
if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
- pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
+ pr_info_ratelimited("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
__func__, vma->vm_pgoff);
return -EINVAL;
}
--
2.14.1
2020 Jun 10
1
[PATCH] vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()
The "vma->vm_pgoff" variable is an unsigned long so if it's larger than
INT_MAX then "index" can be negative leading to an underflow. Fix this
by changing the type of "index" to "unsigned long".
Fixes: ddd89d0a059d ("vhost_vdpa: support doorbell mapping via mmap")
Si...
2017 Sep 12
0
[PATCH][V2] drm: qxl: remove pr_info message, stops log spamming
...qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 7ecf8a4b9fe6..0f50c0b25a58 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -123,11 +123,8 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
struct qxl_device *qdev;
int r;
- if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
- pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
- __func__, vma->vm_pgoff);
+ if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
return -EINVAL;
- }
file_priv = filp->private_data;
qdev = file_priv->minor->de...
2017 Sep 12
0
[PATCH][V2] drm: qxl: remove pr_info message, stops log spamming
...qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
index 7ecf8a4b9fe6..0f50c0b25a58 100644
--- a/drivers/gpu/drm/qxl/qxl_ttm.c
+++ b/drivers/gpu/drm/qxl/qxl_ttm.c
@@ -123,11 +123,8 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
struct qxl_device *qdev;
int r;
- if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
- pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
- __func__, vma->vm_pgoff);
+ if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
return -EINVAL;
- }
file_priv = filp->private_data;
qdev = file_priv->minor->de...
2017 Sep 12
0
[PATCH] drm: qxl: ratelimit pr_info message, reduce log spamming
...rivers/gpu/drm/qxl/qxl_ttm.c
> index 7ecf8a4b9fe6..6502e699f462 100644
> --- a/drivers/gpu/drm/qxl/qxl_ttm.c
> +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
> @@ -124,7 +124,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
> int r;
>
> if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
> - pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
> + pr_info_ratelimited("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
Quick grep suggests that only qxl and vmwgfx produce any output...
2020 May 29
1
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...vmf->vma->vm_file->private_data;
> + struct vdpa_device *vdpa = v->vdpa;
> + const struct vdpa_config_ops *ops = vdpa->config;
> + struct vdpa_notification_area notify;
> + struct vm_area_struct *vma = vmf->vma;
> + u16 index = vma->vm_pgoff;
> +
> + notify = ops->get_vq_notification(vdpa, index);
> +
> + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> + if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
> + notify.addr >> PAGE_SHIFT, PAGE_SI...
2018 Mar 10
0
[RFC PATCH 13/13] drm/nouveau: HACK FOR HMM AREA
...m/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index dff51a0ee028..eafde4c6b7d4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -172,6 +172,13 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
return drm_legacy_mmap(filp, vma);
+ /* Hack for HMM */
+ if (vma->vm_pgoff < (DRM_FILE_PAGE_OFFSET + (4UL << 30))) {
+ struct nouveau_cli *cli = file_priv->driver_priv;
+
+ return nouveau_vmm_hmm(cli, filp, vma);
+ }
+
return ttm_bo_mmap(filp, vm...
2019 Aug 08
0
[PATCH v4 14/17] drm/qxl: drop qxl_ttm_fault
...rea_struct *vma)
{
- int r;
struct drm_file *file_priv = filp->private_data;
struct qxl_device *qdev = file_priv->minor->dev->dev_private;
@@ -77,16 +61,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n",
filp->private_data, vma->vm_pgoff);
- r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev);
- if (unlikely(r != 0))
- return r;
- if (unlikely(ttm_vm_ops == NULL)) {
- ttm_vm_ops = vma->vm_ops;
- qxl_ttm_vm_ops = *ttm_vm_ops;
- qxl_ttm_vm_ops.fault = &qxl_ttm_f...
2019 Oct 17
0
[PATCH 1/5] drm/qxl: drop qxl_ttm_fault
...rea_struct *vma)
{
- int r;
struct drm_file *file_priv = filp->private_data;
struct qxl_device *qdev = file_priv->minor->dev->dev_private;
@@ -77,16 +61,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n",
filp->private_data, vma->vm_pgoff);
- r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev);
- if (unlikely(r != 0))
- return r;
- if (unlikely(ttm_vm_ops == NULL)) {
- ttm_vm_ops = vma->vm_ops;
- qxl_ttm_vm_ops = *ttm_vm_ops;
- qxl_ttm_vm_ops.fault = &qxl_ttm_f...
2019 Oct 17
0
[PATCH 2/5] drm/qxl: switch qxl to &drm_gem_object_funcs.mmap
...->private_data;
- struct qxl_device *qdev = file_priv->minor->dev->dev_private;
-
- if (qdev == NULL) {
- DRM_ERROR(
- "filp->private_data->minor->dev->dev_private == NULL\n");
- return -EINVAL;
- }
- DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n",
- filp->private_data, vma->vm_pgoff);
-
- return ttm_bo_mmap(filp, vma, &qdev->mman.bdev);
-}
-
static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
{
return 0;
--
2.18.1
2019 Aug 08
0
[PATCH v4 15/17] drm/qxl: switch qxl to drm_gem_object_funcs->mmap codepath
...->private_data;
- struct qxl_device *qdev = file_priv->minor->dev->dev_private;
-
- if (qdev == NULL) {
- DRM_ERROR(
- "filp->private_data->minor->dev->dev_private == NULL\n");
- return -EINVAL;
- }
- DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n",
- filp->private_data, vma->vm_pgoff);
-
- return ttm_bo_mmap(filp, vma, &qdev->mman.bdev);
-}
-
static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags)
{
return 0;
--
2.18.1
2019 Jun 20
0
[PATCH 5/6] drm/ttm: use gem vma_node
...u/drm/ttm/ttm_bo_vm.c
index 6dacff49c1cc..fb6875a789b7 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -211,9 +211,9 @@ static vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf)
}
page_offset = ((address - vma->vm_start) >> PAGE_SHIFT) +
- vma->vm_pgoff - drm_vma_node_start(&bo->vma_node);
+ vma->vm_pgoff - drm_vma_node_start(&bo->base.vma_node);
page_last = vma_pages(vma) + vma->vm_pgoff -
- drm_vma_node_start(&bo->vma_node);
+ drm_vma_node_start(&bo->base.vma_node);
if (unlikely(page_offset >= bo->...
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...fault(struct vm_fault *vmf)
+{
+ struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
+ struct vdpa_device *vdpa = v->vdpa;
+ const struct vdpa_config_ops *ops = vdpa->config;
+ struct vdpa_notification_area notify;
+ struct vm_area_struct *vma = vmf->vma;
+ u16 index = vma->vm_pgoff;
+
+ notify = ops->get_vq_notification(vdpa, index);
+
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+ if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
+ notify.addr >> PAGE_SHIFT, PAGE_SIZE,
+ vma->vm_page_prot))
+ return VM_FAULT_SIGBUS;
+
+ re...
2020 Jun 01
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...5 struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
746 struct vdpa_device *vdpa = v->vdpa;
747 const struct vdpa_config_ops *ops = vdpa->config;
748 struct vdpa_notification_area notify;
749 struct vm_area_struct *vma = vmf->vma;
750 u16 index = vma->vm_pgoff;
751
752 notify = ops->get_vq_notification(vdpa, index);
753
> 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
755 if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
756 notify.addr >> PAGE_SHIFT, PAGE_SIZE,
757 vma->vm_...
2020 Jun 01
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...5 struct vhost_vdpa *v = vmf->vma->vm_file->private_data;
746 struct vdpa_device *vdpa = v->vdpa;
747 const struct vdpa_config_ops *ops = vdpa->config;
748 struct vdpa_notification_area notify;
749 struct vm_area_struct *vma = vmf->vma;
750 u16 index = vma->vm_pgoff;
751
752 notify = ops->get_vq_notification(vdpa, index);
753
> 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
755 if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
756 notify.addr >> PAGE_SHIFT, PAGE_SIZE,
757 vma->vm_...
2006 Feb 08
3
[PATCH] direct_remap_pfn_range vm_flags fix
direct_remap_pfn_range() does not properly mark vma with VM_PFNMAP.
This triggers improper reference counting on what rmap thought was
a normal page, and a subsequent BUG() such as:
Eeek! page_mapcount(page) went negative! (-1)
page->flags = 414
page->count = 1
page->mapping = 00000000
------------[ cut here ]------------
kernel BUG at
2020 May 29
0
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...>vma->vm_file->private_data;
>> +??? struct vdpa_device *vdpa = v->vdpa;
>> +??? const struct vdpa_config_ops *ops = vdpa->config;
>> +??? struct vdpa_notification_area notify;
>> +??? struct vm_area_struct *vma = vmf->vma;
>> +??? u16 index = vma->vm_pgoff;
>> +
>> +??? notify = ops->get_vq_notification(vdpa, index);
>> +
>> +??? vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
>> +??? if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
>> +??????????????? notify.addr >> PAGE_SHIFT, PAG...
2020 Jun 02
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...>private_data;
>> 746 struct vdpa_device *vdpa = v->vdpa;
>> 747 const struct vdpa_config_ops *ops = vdpa->config;
>> 748 struct vdpa_notification_area notify;
>> 749 struct vm_area_struct *vma = vmf->vma;
>> 750 u16 index = vma->vm_pgoff;
>> 751
>> 752 notify = ops->get_vq_notification(vdpa, index);
>> 753
>> > 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
>> 755 if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
>> 756 notify.ad...
2020 Jun 02
2
[PATCH 4/6] vhost_vdpa: support doorbell mapping via mmap
...>private_data;
>> 746 struct vdpa_device *vdpa = v->vdpa;
>> 747 const struct vdpa_config_ops *ops = vdpa->config;
>> 748 struct vdpa_notification_area notify;
>> 749 struct vm_area_struct *vma = vmf->vma;
>> 750 u16 index = vma->vm_pgoff;
>> 751
>> 752 notify = ops->get_vq_notification(vdpa, index);
>> 753
>> > 754 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
>> 755 if (remap_pfn_range(vma, vmf->address & PAGE_MASK,
>> 756 notify.ad...