[Intel-xe] [PATCH] drm/xe: Fix overflow in vram manager

Dixit, Ashutosh ashutosh.dixit at intel.com
Thu Mar 9 16:51:22 UTC 2023


On Thu, 09 Mar 2023 05:18:56 -0800, Riana Tauro wrote:
>
> The overflow caused xe_bo_restore_kernel to return an error
> Fix overflow in vram manager alloc function.
>
> Signed-off-by: Riana Tauro <riana.tauro at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> index 643365b18bc7..159ca7105df1 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> @@ -118,7 +118,7 @@ static int xe_ttm_vram_mgr_new(struct ttm_resource_manager *man,
>
>		cur_size = size;
>
> -		if (fpfn + size != place->lpfn << PAGE_SHIFT) {
> +		if (fpfn + size != (u64)place->lpfn << PAGE_SHIFT) {

Looks ok but not sure if it should just be lpfn computed above? Copying Matt.

>			/*
>			 * Except for actual range allocation, modify the size and
>			 * min_block_size conforming to continuous flag enablement
> --
> 2.39.1
>


More information about the Intel-xe mailing list