drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
Subsystems (3)
PATCH 1/1 drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
VMAs with a pg_offs that's offset from the start of the vma_node need to adjust the offset within the BO accordingly. This matches the offset calculation in ttm_bo_vm_fault_reserved.
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo_vm.c +3 -1
@@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo,int ttm_bo_vm_access (struct vm_area_struct *vma,unsigned long addr,void *buf,int len,int write) { -unsigned long offset = (addr) - vma->vm_start;struct ttm_buffer_object *bo = vma->vm_private_data; +unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff -drm_vma_node_start (&bo->base.vma_node)) + <<PAGE_SHIFT );int ret;if (len <1 || (offset + len) >>PAGE_SHIFT > bo->num_pages)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 28.07.20 um 20:27 schrieb Felix Kuehling:
Quoted 6 lines
VMAs with a
pg_offsthat's offset from the start of thevma_nodeneed to adjust the offset within the BO accordingly. This matches the offset calculation inttm_bo_vm_fault_reserved.Signed-off-by Felix Kuehling <[email protected]>Tested-by Laurent Morichetti <[email protected]>
Going to pick that up for inclusion in drm-misc-next.
Quoted 10 lines
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_bo_vm.c +0
-0@@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,
drivers/gpu/drm/ttm/ttm_bo_vm.c static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, · line 414
Quoted 10 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-1void *buf, int len, int write) { - unsigned long offset = (addr) - vma->vm_start;struct ttm_buffer_object *bo = vma->vm_private_data; +unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff -drm_vma_node_start (&bo->base.vma_node)) + <<PAGE_SHIFT );int ret;if (len <1 || (offset + len) >>PAGE_SHIFT > bo->num_pages)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 2020-07-29 um 4:08 a.m. schrieb Christian König:
Quoted 11 lines
Am 28.07.20 um 20:27 schrieb Felix Kuehling:
Quoted 6 lines
VMAs with a
pg_offsthat's offset from the start of thevma_nodeneed to adjust the offset within the BO accordingly. This matches the offset calculation inttm_bo_vm_fault_reserved.Signed-off-by Felix Kuehling <[email protected]>Tested-by Laurent Morichetti <[email protected]>Reviewed-by Christian König <[email protected]>Going to pick that up for inclusion in drm-misc-next.
Thanks. I'll submit it to amd-staging-drm-next so it makes its way into our DKMS branch quickly.
Alex, would you push this to drm-fixes?
Regards,
Felix
Quoted 14 lines
Quoted 14 lines
---
drivers/gpu/drm/ttm/ttm_bo_vm.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_bo_vm.c +0
-0@@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(structttm_buffer_object *bo, int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr, void *buf, int len, int write)
Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, · line 414
Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-1{ - unsigned long offset = (addr) - vma->vm_start; struct ttm_buffer_object *bo = vma->vm_private_data; + unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff - drm_vma_node_start(&bo->base.vma_node)) + << PAGE_SHIFT); int ret; if (len < 1 || (offset + len) >> PAGE_SHIFT > bo->num_pages)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
Christian, Can you cc stable when you apply it to drm-misc?
Alex
________________________________
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, July 29, 2020 10:15 AM
To: Koenig, Christian <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Morichetti, Laurent <[email protected]>
Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
Am 2020-07-29 um 4:08 a.m. schrieb Christian König:
Quoted 11 lines
Am 28.07.20 um 20:27 schrieb Felix Kuehling:
Quoted 6 lines
VMAs with a
pg_offsthat's offset from the start of thevma_nodeneed to adjust the offset within the BO accordingly. This matches the offset calculation inttm_bo_vm_fault_reserved.Signed-off-by Felix Kuehling <[email protected]>Tested-by Laurent Morichetti <[email protected]>Reviewed-by Christian König <[email protected]>Going to pick that up for inclusion in drm-misc-next.
Thanks. I'll submit it to amd-staging-drm-next so it makes its way into our DKMS branch quickly.
Alex, would you push this to drm-fixes?
Regards,
Felix
Quoted 14 lines
Quoted 14 lines
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_bo_vm.c +0
-0@@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(structttm_buffer_object *bo, int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,void *buf,int len,int write)
Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, · line 414
Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-1{ -unsigned long offset = (addr) - vma->vm_start;struct ttm_buffer_object *bo = vma->vm_private_data; +unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff -drm_vma_node_start (&bo->base.vma_node)) + <<PAGE_SHIFT );int ret;if (len <1 || (offset + len) >>PAGE_SHIFT > bo->num_pages)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sure.
Christian.
Am 29.07.2020 17:30 schrieb "Deucher, Alexander" <[email protected]>:
[AMD Public Use]
Christian, Can you cc stable when you apply it to drm-misc?
Alex
________________________________
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, July 29, 2020 10:15 AM
To: Koenig, Christian <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Morichetti, Laurent <[email protected]>
Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with a pg_offs in ttm_bo_vm_access
Am 2020-07-29 um 4:08 a.m. schrieb Christian König:
Quoted 11 lines
Am 28.07.20 um 20:27 schrieb Felix Kuehling:
Quoted 6 lines
VMAs with a
pg_offsthat's offset from the start of thevma_nodeneed to adjust the offset within the BO accordingly. This matches the offset calculation inttm_bo_vm_fault_reserved.Signed-off-by Felix Kuehling <[email protected]>Tested-by Laurent Morichetti <[email protected]>Reviewed-by Christian König <[email protected]>Going to pick that up for inclusion in drm-misc-next.
Thanks. I'll submit it to amd-staging-drm-next so it makes its way into our DKMS branch quickly.
Alex, would you push this to drm-fixes?
Regards,
Felix
Quoted 14 lines
Quoted 14 lines
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_bo_vm.c +0
-0@@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(structttm_buffer_object *bo, int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,void *buf,int len,int write)
Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, · line 414
Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-1{ -unsigned long offset = (addr) - vma->vm_start;struct ttm_buffer_object *bo = vma->vm_private_data; +unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff -drm_vma_node_start (&bo->base.vma_node)) + <<PAGE_SHIFT );int ret;if (len <1 || (offset + len) >>PAGE_SHIFT > bo->num_pages)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 2 lines · Christian
Sure.
Note that drm-misc-next isn't the right branch for cc: stable stuff, see
https://drm.pages.freedesktop.org/maintainer-tools/committer-drm-misc.html#where-do-i-apply-my-patch
Just to avoid confusion and needless cherrypicking across branches. -Daniel
Quoted 67 lines
Christian.
Am 29.07.2020 17:30 schrieb "Deucher, Alexander" <[email protected]>:
[AMD Public Use]
Christian, Can you cc stable when you apply it to drm-misc?
Alex
________________________________
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, July 29, 2020 10:15 AM
To: Koenig, Christian <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Morichetti, Laurent <[email protected]>
Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with apg_offsinttm_bo_vm_accessAm 2020-07-29 um 4:08 a.m. schrieb Christian König:
Quoted 11 lines
Am 28.07.20 um 20:27 schrieb Felix Kuehling:
Quoted 6 lines
VMAs with a
pg_offsthat's offset from the start of thevma_nodeneed to adjust the offset within the BO accordingly. This matches the offset calculation inttm_bo_vm_fault_reserved.Signed-off-by Felix Kuehling <[email protected]>Tested-by Laurent Morichetti <[email protected]>Reviewed-by Christian König <[email protected]>Going to pick that up for inclusion in drm-misc-next.
Thanks. I'll submit it to amd-staging-drm-next so it makes its way into our DKMS branch quickly.
Alex, would you push this to drm-fixes?
Regards,
FelixQuoted 14 lines
Quoted 14 lines
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_bo_vm.c +0
-0@@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(structttm_buffer_object *bo, int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,void *buf,int len,int write)Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, · line 414
Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-1{ -unsigned long offset = (addr) - vma->vm_start;struct ttm_buffer_object *bo = vma->vm_private_data; +unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff -drm_vma_node_start (&bo->base.vma_node)) + <<PAGE_SHIFT );int ret;if (len <1 || (offset + len) >>PAGE_SHIFT > bo->num_pages)_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 30.07.20 um 13:40 schrieb Daniel Vetter:
Quoted 6 lines
Quoted 1 line · Christian
Sure.
Note that drm-misc-next isn't the right branch for cc: stable stuff, see
https://drm.pages.freedesktop.org/maintainer-tools/committer-drm-misc.html#where-do-i-apply-my-patch
So this should go into drm-misc-fixes? The bug is there for quite a while.
Christian.
Quoted 68 lines
Just to avoid confusion and needless cherrypicking across branches. -Daniel
Quoted 62 lines
Christian.
Am 29.07.2020 17:30 schrieb "Deucher, Alexander" <[email protected]>:
[AMD Public Use]
Christian, Can you cc stable when you apply it to drm-misc?
Alex
________________________________
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, July 29, 2020 10:15 AM
To: Koenig, Christian <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Morichetti, Laurent <[email protected]>
Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with apg_offsinttm_bo_vm_accessAm 2020-07-29 um 4:08 a.m. schrieb Christian König:
Quoted 10 lines
Am 28.07.20 um 20:27 schrieb Felix Kuehling:
Quoted 6 lines
VMAs with a
pg_offsthat's offset from the start of thevma_nodeneed to adjust the offset within the BO accordingly. This matches the offset calculation inttm_bo_vm_fault_reserved.Signed-off-by Felix Kuehling <[email protected]>Tested-by Laurent Morichetti <[email protected]>Reviewed-by Christian König <[email protected]>Going to pick that up for inclusion in drm-misc-next.
Thanks. I'll submit it to amd-staging-drm-next so it makes its way into our DKMS branch quickly.
Alex, would you push this to drm-fixes?
Regards,
FelixQuoted 13 lines
Quoted 13 lines
--- drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_bo_vm.c +0
-0@@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(structttm_buffer_object *bo, int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr,void *buf,int len,int write)Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo, · line 414
Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-1{ -unsigned long offset = (addr) - vma->vm_start;struct ttm_buffer_object *bo = vma->vm_private_data; +unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff -drm_vma_node_start (&bo->base.vma_node)) + <<PAGE_SHIFT );int ret;if (len <1 || (offset + len) >>PAGE_SHIFT > bo->num_pages)_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 30.07.20 um 13:50 schrieb Christian König:
Quoted 10 lines
Am 30.07.20 um 13:40 schrieb Daniel Vetter:
Quoted 7 lines
Quoted 1 line · Christian
Sure.
Note that drm-misc-next isn't the right branch for cc: stable stuff, see
So this should go into drm-misc-fixes? The bug is there for quite a while.
Ok, so I pushed this to drm-misc-fixes, but forgot to add the CC stable tag.
To much to do and not enough time,
Christian.
Quoted 73 lines
Christian.
Quoted 69 lines
Just to avoid confusion and needless cherrypicking across branches. -Daniel
Quoted 63 lines
Christian.
Am 29.07.2020 17:30 schrieb "Deucher, Alexander" <[email protected]>:
[AMD Public Use]
Christian, Can you cc stable when you apply it to drm-misc?
Alex
________________________________
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, July 29, 2020 10:15 AM
To: Koenig, Christian <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Morichetti, Laurent <[email protected]>
Subject: Re: [PATCH 1/1] drm/ttm: fix offset in VMAs with apg_offsinttm_bo_vm_accessAm 2020-07-29 um 4:08 a.m. schrieb Christian König:
Quoted 10 lines
Am 28.07.20 um 20:27 schrieb Felix Kuehling:
Quoted 6 lines
VMAs with a
pg_offsthat's offset from the start of thevma_nodeneed to adjust the offset within the BO accordingly. This matches the offset calculation inttm_bo_vm_fault_reserved.Signed-off-by Felix Kuehling <[email protected]>Tested-by Laurent Morichetti <[email protected]>Reviewed-by Christian König <[email protected]>Going to pick that up for inclusion in drm-misc-next.
Thanks. I'll submit it to amd-staging-drm-next so it makes its way into our DKMS branch quickly.
Alex, would you push this to drm-fixes?
Regards,
FelixQuoted 13 lines
Quoted 13 lines
---
drivers/gpu/drm/ttm/ttm_bo_vm.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_bo_vm.c +0
-0@@ -405,8 +405,10 @@ static int ttm_bo_vm_access_kmap(structttm_buffer_object *bo, int ttm_bo_vm_access(struct vm_area_struct *vma, unsigned long addr, void *buf, int len, int write)Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c static int ttm_bo_vm_access_kmap(struct · line 414
Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-1{ - unsigned long offset = (addr) - vma->vm_start; struct ttm_buffer_object *bo = vma->vm_private_data; + unsigned long offset = (addr) - vma->vm_start + + ((vma->vm_pgoff - drm_vma_node_start(&bo->base.vma_node)) + << PAGE_SHIFT); int ret; if (len < 1 || (offset + len) >> PAGE_SHIFT > bo->num_pages)_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=02%7C01%7CChristian.Koenig%40amd.com%7Cfdb80f31688743c1279f08d8347ece50%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637317066517801827&sdata=ZQofPqGAHNmglMcDPQzjpq0AzGbzaUx5RAfwr9zfJ%2FQ%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx