* [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
@ 2021-06-03 16:09 ` Liam Howlett
0 siblings, 0 replies; 10+ messages in thread
From: Liam Howlett @ 2021-06-03 16:09 UTC (permalink / raw)
To: Andrew Morton, linux-mm, linux-kernel, amd-gfx, dri-devel
Cc: David Airlie, Daniel Vetter
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.
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 7cb7ffdd1900..dfb5ca3f8da8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -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;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
@ 2021-06-03 16:09 ` Liam Howlett
0 siblings, 0 replies; 10+ messages in thread
From: Liam Howlett @ 2021-06-03 16:09 UTC (permalink / raw)
To: Andrew Morton, linux-mm, linux-kernel, amd-gfx, dri-devel; +Cc: David Airlie
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.
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 7cb7ffdd1900..dfb5ca3f8da8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -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;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
@ 2021-06-03 16:09 ` Liam Howlett
0 siblings, 0 replies; 10+ messages in thread
From: Liam Howlett @ 2021-06-03 16:09 UTC (permalink / raw)
To: Andrew Morton, linux-mm, linux-kernel, amd-gfx, dri-devel
Cc: David Airlie, Daniel Vetter
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.
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 7cb7ffdd1900..dfb5ca3f8da8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -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;
}
--
2.30.2
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
2021-06-03 16:09 ` Liam Howlett
(?)
@ 2021-06-04 11:11 ` Christian König
-1 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2021-06-04 11:11 UTC (permalink / raw)
To: Liam Howlett, Andrew Morton, linux-mm, linux-kernel, amd-gfx, dri-devel
Cc: David Airlie, Daniel Vetter
Am 03.06.21 um 18:09 schrieb Liam Howlett:
> 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.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 7cb7ffdd1900..dfb5ca3f8da8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -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;
> }
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
@ 2021-06-04 11:11 ` Christian König
0 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2021-06-04 11:11 UTC (permalink / raw)
To: Liam Howlett, Andrew Morton, linux-mm, linux-kernel, amd-gfx, dri-devel
Cc: David Airlie
Am 03.06.21 um 18:09 schrieb Liam Howlett:
> 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.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 7cb7ffdd1900..dfb5ca3f8da8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -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;
> }
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
@ 2021-06-04 11:11 ` Christian König
0 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2021-06-04 11:11 UTC (permalink / raw)
To: Liam Howlett, Andrew Morton, linux-mm, linux-kernel, amd-gfx, dri-devel
Cc: David Airlie, Daniel Vetter
Am 03.06.21 um 18:09 schrieb Liam Howlett:
> 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.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 7cb7ffdd1900..dfb5ca3f8da8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -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;
> }
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
2021-06-04 11:11 ` Christian König
(?)
(?)
@ 2021-06-04 20:59 ` Alex Deucher
-1 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2021-06-04 20:59 UTC (permalink / raw)
To: Christian König
Cc: Liam Howlett, Andrew Morton, linux-mm, linux-kernel, amd-gfx,
dri-devel, David Airlie
On Fri, Jun 4, 2021 at 7:11 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 03.06.21 um 18:09 schrieb Liam Howlett:
> > 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.
> >
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
I'm fine to have this go through whatever tree makes sense.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > index 7cb7ffdd1900..dfb5ca3f8da8 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > @@ -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;
> > }
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
@ 2021-06-04 20:59 ` Alex Deucher
0 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2021-06-04 20:59 UTC (permalink / raw)
To: Christian König
Cc: Liam Howlett, Andrew Morton, linux-mm, linux-kernel, amd-gfx,
dri-devel, David Airlie
On Fri, Jun 4, 2021 at 7:11 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 03.06.21 um 18:09 schrieb Liam Howlett:
> > 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.
> >
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
I'm fine to have this go through whatever tree makes sense.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > index 7cb7ffdd1900..dfb5ca3f8da8 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > @@ -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;
> > }
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
@ 2021-06-04 20:59 ` Alex Deucher
0 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2021-06-04 20:59 UTC (permalink / raw)
To: Christian König
Cc: David Airlie, linux-kernel, dri-devel, linux-mm, amd-gfx,
Liam Howlett, Andrew Morton
On Fri, Jun 4, 2021 at 7:11 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 03.06.21 um 18:09 schrieb Liam Howlett:
> > 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.
> >
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
I'm fine to have this go through whatever tree makes sense.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > index 7cb7ffdd1900..dfb5ca3f8da8 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > @@ -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;
> > }
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
@ 2021-06-04 20:59 ` Alex Deucher
0 siblings, 0 replies; 10+ messages in thread
From: Alex Deucher @ 2021-06-04 20:59 UTC (permalink / raw)
To: Christian König
Cc: David Airlie, linux-kernel, dri-devel, linux-mm, amd-gfx,
Liam Howlett, Andrew Morton
On Fri, Jun 4, 2021 at 7:11 AM Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 03.06.21 um 18:09 schrieb Liam Howlett:
> > 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.
> >
> > Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
I'm fine to have this go through whatever tree makes sense.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > index 7cb7ffdd1900..dfb5ca3f8da8 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > @@ -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;
> > }
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2021-06-05 6:24 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 16:09 [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages() Liam Howlett
2021-06-03 16:09 ` Liam Howlett
2021-06-03 16:09 ` Liam Howlett
2021-06-04 11:11 ` Christian König
2021-06-04 11:11 ` Christian König
2021-06-04 11:11 ` Christian König
2021-06-04 20:59 ` Alex Deucher
2021-06-04 20:59 ` Alex Deucher
2021-06-04 20:59 ` Alex Deucher
2021-06-04 20:59 ` Alex Deucher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.