From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CC50C61DA4 for ; Thu, 9 Mar 2023 16:51:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46CA610E185; Thu, 9 Mar 2023 16:51:26 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF64D10E185 for ; Thu, 9 Mar 2023 16:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678380683; x=1709916683; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=QPiaCGxK1fxYLZ/Pqyy0K4H0oHSgkOUsq7YxUhs3lNo=; b=kV2eXtsoU/SjHf7CHNuYeHSyiXv7+c0tboMT2B5zgZuU7QjA9ww9fLDa 5tsUCJmd8FQ1sGJwZ5xtn+FALMOFakNujRyk6uaXEEnrTaxX9C2BIlfIK F6IDBM/JxM/IGIw2/uop8TkPVrabMCKNxYSEPthRuNS2I9doGVBBykKHs cLJMo7Ulncz8RNawQzDfL2JpMlRDpYahnELp0p4pCW1Rjb0gWYVYCWmWy gsJ723uUznqXvEElQTP2KBlfiiF0ZEu6peQkjnndCSu5YgSa8ZMfWK0Ik mfPnqTrz6XrDCMNA/koKmq2OxF4wwjONsCghtFXAStqrCy1AR2P5dJhOc Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="364140390" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="364140390" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 08:51:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="851567148" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="851567148" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.215.176]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 08:51:23 -0800 Date: Thu, 09 Mar 2023 08:51:22 -0800 Message-ID: <87edpxna0l.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Riana Tauro In-Reply-To: <20230309131856.1480173-1-riana.tauro@intel.com> References: <20230309131856.1480173-1-riana.tauro@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-xe] [PATCH] drm/xe: Fix overflow in vram manager X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: anshuman.gupta@intel.com, intel-xe@lists.freedesktop.org, rodrigo.vivi@intel.com Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" 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 > --- > 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 >