Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 761DF39AF0 for ; Fri, 15 Mar 2024 17:09:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710522545; cv=none; b=SbCMm30lqHJQyLnpDmd2+wmrmYrOkl66aM6FmlO92oB81lHbR983BeYOCrF7/j+aqzgTL/xiplBAbLF0RR65RkuoX3x6nfKpP1dKor9KBM9vZXBBu3eOB6zMxdyFDA992TKXW1whHPiRYCdL/PdzZWMHLmMgxtODrsHftxCVfZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710522545; c=relaxed/simple; bh=rDKBtEaBZintqNzBGvOPMViXG4XBLyFGvbuLLtaRa7E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UTEpf4aLnx4IjwLpYsO64NtHg8Vyfr7nFhUNifxrxsy6o5WVg4FAP0p3G6JJ/Qbo61+VBGffYC1VeX0JaMKqqokp+QxGj3Q/CWSb+PxwOKS1Kp9LTsX3PlGwhReBE8lPmJMPgyCfNQE7uEWJLCobQi36QYsouVS/YMQ4ZrL0nkY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Ew+XUH5y; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ew+XUH5y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710522543; x=1742058543; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rDKBtEaBZintqNzBGvOPMViXG4XBLyFGvbuLLtaRa7E=; b=Ew+XUH5yRJad82cwL9RNgPSto32JRJOSTU4uExo0tKg4SauTP/dTRk6N fKlRIqZ6oANBKlwB0xmKH0UGxgJJsWROMF2hTPgBN0NRLrwwfsLXho3ZR 54E/brTfogArzoJgVc1eN2HoHna8qhtiVt3Etnvc/7jY+AkKvC/dQt720 Tf0/UmsfDfn7/KnzGXd2YpR7zSVV0dqtJOxnksdXVSY3GOwcB57zuaKkT SVB9HRaupTCUp2+TwH7Lcmepekj+09KN/CJCPQ41zZV1dcV1OzUBU9x/r t1QvX+4QkBiBucLq/pUg91OLo2dNOnPv0bxrLxMNeY7EFpwTdhpBiSP0D A==; X-IronPort-AV: E=McAfee;i="6600,9927,11014"; a="5590128" X-IronPort-AV: E=Sophos;i="6.07,128,1708416000"; d="scan'208";a="5590128" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2024 10:09:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,128,1708416000"; d="scan'208";a="12659293" Received: from unknown (HELO intel.com) ([10.247.118.169]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2024 10:08:57 -0700 Date: Fri, 15 Mar 2024 18:08:51 +0100 From: Andi Shyti To: Nirmoy Das Cc: Lionel Landwerlin , Andi Shyti , intel-gfx , dri-devel , Andi Shyti , Andrzej Hajda , Chris Wilson , Michal Mrozek , Nirmoy Das , stable@vger.kernel.org Subject: Re: [PATCH] drm/i915/gt: Report full vm address range Message-ID: References: <20240313193907.95205-1-andi.shyti@linux.intel.com> <46ab1d25-5d16-4610-8b8f-2ee07064ec2e@intel.com> <35df0767-384f-49f2-806a-f83765ca7c4c@linux.intel.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35df0767-384f-49f2-806a-f83765ca7c4c@linux.intel.com> Hi Nirmoy, > > In Mesa we've been relying on I915_CONTEXT_PARAM_GTT_SIZE so as long as > > that is adjusted by the kernel > > What do you mean by adjusted by, should it be a aligned size? > > I915_CONTEXT_PARAM_GTT_SIZE ioctl is returning vm->total which is > adjusted(reduced by a page). > > This patch might cause silent error as it is not removing WABB which is > using the reserved page to add dummy blt and if userspace is using that > > page then it will be overwritten. yes, I think this could happen, but there is no solution, unfortunately. We need to fail at some point. On the other hand, I think mesa is miscalculating the vm size. In userspace the total size is derived by the bit size (maxNBitValue()). By doing so, I guess there will always be cases of miscalculation. There are two solutions here: 1. we track two sizes, one the true available size and one the total size. But this looks like a dirty hack to me. 2. UMD fixes the size calculation by taking for granted what the driver provides and we don't have anything to do in KMD. Lionel, Michal, thoughts? Andi