Re: [PATCH 6.0 108/148] drm/amdgpu: Fix size validation for non-exclusive domains (v4)

2023-01-12 Thread Greg Kroah-Hartman
On Thu, Jan 12, 2023 at 11:59:06AM -0500, Luben Tuikov wrote:
> On 2023-01-12 11:49, Greg Kroah-Hartman wrote:
> > On Thu, Jan 12, 2023 at 11:25:08AM -0500, Luben Tuikov wrote:
> >> Hi Greg,
> >>
> >> The patch in the link is a Fixes patch of the quoted patch, and should 
> >> also go in:
> >>
> >> https://lore.kernel.org/all/20230104221935.113400-1-luben.tui...@amd.com/
> > 
> > Is that in Linus's tree already?  if so, what is the git commit id?
> 
> I just checked, and not yet. Just wanted to give a heads up.
> 
> It does have a Fixes tag, and I hope it would be picked up automatically,
> when it lands in Linus' tree.

That does not always happen if it does not have a "cc: stable@..." tag.
So when it does land in Linus's tree, please let us know the id so we
are sure to pick it up.

thanks,

greg k-h


Re: [PATCH 6.0 108/148] drm/amdgpu: Fix size validation for non-exclusive domains (v4)

2023-01-12 Thread Luben Tuikov
On 2023-01-12 11:49, Greg Kroah-Hartman wrote:
> On Thu, Jan 12, 2023 at 11:25:08AM -0500, Luben Tuikov wrote:
>> Hi Greg,
>>
>> The patch in the link is a Fixes patch of the quoted patch, and should also 
>> go in:
>>
>> https://lore.kernel.org/all/20230104221935.113400-1-luben.tui...@amd.com/
> 
> Is that in Linus's tree already?  if so, what is the git commit id?

I just checked, and not yet. Just wanted to give a heads up.

It does have a Fixes tag, and I hope it would be picked up automatically,
when it lands in Linus' tree.
-- 
Regards,
Luben


Re: [PATCH 6.0 108/148] drm/amdgpu: Fix size validation for non-exclusive domains (v4)

2023-01-12 Thread Greg Kroah-Hartman
On Thu, Jan 12, 2023 at 11:25:08AM -0500, Luben Tuikov wrote:
> Hi Greg,
> 
> The patch in the link is a Fixes patch of the quoted patch, and should also 
> go in:
> 
> https://lore.kernel.org/all/20230104221935.113400-1-luben.tui...@amd.com/

Is that in Linus's tree already?  if so, what is the git commit id?

thanks,

greg k-h


Re: [PATCH 6.0 108/148] drm/amdgpu: Fix size validation for non-exclusive domains (v4)

2023-01-12 Thread Luben Tuikov
Hi Greg,

The patch in the link is a Fixes patch of the quoted patch, and should also go 
in:

https://lore.kernel.org/all/20230104221935.113400-1-luben.tui...@amd.com/

Regards,
Luben

On 2023-01-10 13:03, Greg Kroah-Hartman wrote:
> From: Luben Tuikov 
> 
> [ Upstream commit 7554886daa31eacc8e7fac9e15bbce67d10b8f1f ]
> 
> Fix amdgpu_bo_validate_size() to check whether the TTM domain manager for the
> requested memory exists, else we get a kernel oops when dereferencing "man".
> 
> v2: Make the patch standalone, i.e. not dependent on local patches.
> v3: Preserve old behaviour and just check that the manager pointer is not
> NULL.
> v4: Complain if GTT domain requested and it is uninitialized--most likely a
> bug.
> 
> Cc: Alex Deucher 
> Cc: Christian König 
> Cc: AMD Graphics 
> Signed-off-by: Luben Tuikov 
> Reviewed-by: Christian König 
> Signed-off-by: Alex Deucher 
> Signed-off-by: Sasha Levin 
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 19 ---
>  1 file changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index bfe0fc258fc1..60ab2d952d5c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -446,27 +446,24 @@ static bool amdgpu_bo_validate_size(struct 
> amdgpu_device *adev,
>  
>   /*
>* If GTT is part of requested domains the check must succeed to
> -  * allow fall back to GTT
> +  * allow fall back to GTT.
>*/
>   if (domain & AMDGPU_GEM_DOMAIN_GTT) {
>   man = ttm_manager_type(>mman.bdev, TTM_PL_TT);
>  
> - if (size < man->size)
> + if (man && size < man->size)
>   return true;
> - else
> - goto fail;
> - }
> -
> - if (domain & AMDGPU_GEM_DOMAIN_VRAM) {
> + else if (!man)
> + WARN_ON_ONCE("GTT domain requested but GTT mem manager 
> uninitialized");
> + goto fail;
> + } else if (domain & AMDGPU_GEM_DOMAIN_VRAM) {
>   man = ttm_manager_type(>mman.bdev, TTM_PL_VRAM);
>  
> - if (size < man->size)
> + if (man && size < man->size)
>   return true;
> - else
> - goto fail;
> + goto fail;
>   }
>  
> -
>   /* TODO add more domains checks, such as AMDGPU_GEM_DOMAIN_CPU */
>   return true;
>