Re: [PATCH] drm/amdgpu: make sure userptr ttm is allocated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-08-06 2:56 p.m., Christian König wrote:
> We need to allocate that manually now.
> 
> Signed-off-by: Christian König <christian.koenig@xxxxxxx>
> Fixes: 2ddef17678bc (HEAD) drm/ttm: make TT creation purely optional v3
> ---
>  .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c    |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c         |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c         | 17 +++++++++++------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h         |  4 ++--
>  4 files changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 9015c7b76d60..55d2e870fdda 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -564,7 +564,7 @@ static int init_user_pages(struct kgd_mem *mem, uint64_t user_addr)
>  
>  	mutex_lock(&process_info->lock);
>  
> -	ret = amdgpu_ttm_tt_set_userptr(bo->tbo.ttm, user_addr, 0);
> +	ret = amdgpu_ttm_tt_set_userptr(&bo->tbo, user_addr, 0);
>  	if (ret) {
>  		pr_err("%s: Failed to set userptr: %d\n", __func__, ret);
>  		goto out;

I suspect more needs to be done for KFD, e.g.
amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu can dereference
bo->tbo.ttm before calling init_user_pages, and there are more usages of
bo->tbo.ttm that need to be audited.


-- 
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux