drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
Subsystems (3)
PATCH 1/1 drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
Use vma_lookup() to find the VMA at a specific address. As vma_lookup() will return NULL if the address is not within any VMA, the start address no longer needs to be validated.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -2
@@ -680,9 +680,9 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)return -ESRCH ;mmap_read_lock (mm); - vma =find_vma (mm, start); + vma =vma_lookup (mm, start);mmap_read_unlock (mm); -if (unlikely (!vma || start < vma->vm_start)) { +if (unlikely (!vma)) { r = -EFAULT ; goto out_putmm; }
Signature · 1 line
2.30.2
Am 03.06.21 um 18:09 schrieb Liam Howlett:
Quoted 5 lines
Use
vma_lookup()to find the VMA at a specific address. Asvma_lookup()will return NULL if the address is not within any VMA, the start address no longer needs to be validated.Signed-off-by Liam R. Howlett <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2
-2@@ -680,9 +680,9 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)return -ESRCH ;mmap_read_lock (mm); - vma =find_vma (mm, start); + vma =vma_lookup (mm, start);mmap_read_unlock (mm); -if (unlikely (!vma || start < vma->vm_start)) { +if (unlikely (!vma)) { r = -EFAULT ; goto out_putmm; }
Alex Deucher
Acked-byQuoted 10 lines · Christian König
Am 03.06.21 um 18:09 schrieb Liam Howlett:
Quoted 5 lines
Use
vma_lookup()to find the VMA at a specific address. Asvma_lookup()will return NULL if the address is not within any VMA, the start address no longer needs to be validated.Signed-off-by Liam R. Howlett <[email protected]>Reviewed-by Christian König <[email protected]>
I'm fine to have this go through whatever tree makes sense.
Quoted 11 lines
Quoted 11 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0@@ -680,9 +680,9 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)return -ESRCH ;
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages) · line 688
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2
-2mmap_read_lock (mm); - vma =find_vma (mm, start); + vma =vma_lookup (mm, start);mmap_read_unlock (mm); -if (unlikely (!vma || start < vma->vm_start)) { +if (unlikely (!vma)) { r = -EFAULT ; goto out_putmm; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx