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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1593DC433F5 for ; Wed, 10 Nov 2021 07:26:07 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BCE866113D for ; Wed, 10 Nov 2021 07:26:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BCE866113D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07CB86E049; Wed, 10 Nov 2021 07:26:04 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 285A189BD4; Wed, 10 Nov 2021 07:26:03 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10163"; a="219822294" X-IronPort-AV: E=Sophos;i="5.87,223,1631602800"; d="scan'208";a="219822294" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2021 23:26:02 -0800 X-IronPort-AV: E=Sophos;i="5.87,223,1631602800"; d="scan'208";a="491991308" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.212.217]) ([10.254.212.217]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2021 23:26:00 -0800 Message-ID: Date: Wed, 10 Nov 2021 15:25:58 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Content-Language: en-US To: Tvrtko Ursulin , Lucas De Marchi References: <20211109121759.170915-1-tvrtko.ursulin@linux.intel.com> <20211109171926.vrb5juvp64mv65b4@ldmartin-desk2> From: Lu Baolu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH] drm/i915: Use per device iommu check X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, baolu.lu@linux.intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 2021/11/10 1:35, Tvrtko Ursulin wrote: > > On 09/11/2021 17:19, Lucas De Marchi wrote: >> On Tue, Nov 09, 2021 at 12:17:59PM +0000, Tvrtko Ursulin wrote: >>> From: Tvrtko Ursulin >>> >>> On igfx + dgfx setups, it appears that intel_iommu=igfx_off option only >>> disables the igfx iommu. Stop relying on global intel_iommu_gfx_mapped >>> and probe presence of iommu domain per device to accurately reflect its >>> status. >> >> nice, I was just starting to look into thus but for another reason: we >> are adding support for other archs, like aarch64, and the global from >> here >> was a problem > > Yes I realized the other iommu angle as well. To do this properly we > need to sort the intel_vtd_active call sites into at least two buckets - > which are truly about VT-d and which are just IOMMU. > > For instance the THP decision in i915_gemfs.co would be "are we behind > any iommu". Some other call sites are possibly only about the bugs in > the igfx iommu. Not sure if there is a third bucket for any potential > differences between igfx iommu and other Intel iommu in case of dgfx. > > I'd like to hear from Baolu as well to confirm if intel_iommu driver is > handling igfx + dgfx correctly in respect to the two global variables I > mention in the commit message. I strongly agree that the drivers should call the IOMMU interface directly for portability. For Intel graphic driver, we have two issues: #1) driver asks vt-d driver for identity map with intel_iommu=igfx_off. #2) driver query the status with a global intel_iommu_gfx_mapped. We need to solve these two problems step by step. This patch is definitely a good start point. Best regards, baolu