Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp96297rdb; Wed, 29 Nov 2023 22:10:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFC2oJhGyIqMYV+/zbHzICLekbyvyN3x6HiOBgRTSSGt4+/+pSjR2ap0vDxk9U/pQkAuoIy X-Received: by 2002:a05:6a20:918b:b0:15d:4cf1:212e with SMTP id v11-20020a056a20918b00b0015d4cf1212emr33073228pzd.4.1701324608612; Wed, 29 Nov 2023 22:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701324608; cv=none; d=google.com; s=arc-20160816; b=gIFTeYLr/sOUxT6Izq31VP208SWnvrqHKhxaDHXbiFp/q9uqIb6qiylvEmHxXqf/Hk Bza2n/n5a4T8aH27EXbPJFDxvGEYgwWgti/cMWXcsBWzoKGXgZK1mqr5vkLIzI8KfX4H 9+XYuapyAa7mbbc9M9DPvD5XbMWMS66f3o3PxFzcJQ7+IuBOdjXhdDvxWvbq+0aNq1fG 69B6g2sRdYDML3GPGxqJeE/745ZaOih4KdvNHCvcsDSW/qsQ5boYU0G4+omYBClOgJSK p8MuENi+qsGD0xDuQI9e7dLD8PYtcXHFNw5ZdOxSRuZolnjQfCUuV/zOz9lUl309dz+w zHCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=EW/8cf74nT5qCLcmasgCp8N+JNZjjknc+cqFdszGHes=; fh=8/826sHyvMnMWdflnxEzXIZR01aRPkXPH4R+m1BU7v8=; b=0HE685+7Nr7UKX56AqUAyXcHvFl87uGYlaa8j2zRuf/zQ8pPdhumLX0o95MM0HYS4K 3wBG/0Q7mEyIwBiUT9KI1YHA0+/yJiPy/Fqn0Tgh1pk4upuy1ngp97amIbbzzwW2W779 S64DOFtemakl1cScuBJbBsTIsDAcybimj64DnWhlP31YqY8whcaQqXeI+hPY3ZZKtu4e +MNkdUbSNOPprRRw2nB57UE/m6qsGHBcprKWZprncnukhvXGTqzwo5iV8dXhK6VQol7f oNQ6/Zlm3GnK4zZFrZ2Hpur1ZIfBpQJiIPJEoCA1hsk9fRQwxM8rI8qQGS0+/RaD4rEF hqnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OzYN5lnd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s20-20020a634514000000b005b8f298110csi615074pga.6.2023.11.29.22.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 22:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OzYN5lnd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EE46880423B9; Wed, 29 Nov 2023 22:10:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231706AbjK3GJv (ORCPT + 99 others); Thu, 30 Nov 2023 01:09:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbjK3GJu (ORCPT ); Thu, 30 Nov 2023 01:09:50 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E616BB9 for ; Wed, 29 Nov 2023 22:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701324597; x=1732860597; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=od25jifz4eVRuBZX5AfB3lIKHX+oCAQS49YG9v4v83A=; b=OzYN5lndYI/Wun8azJuPeiQ6Q5qQi5LA59ELybXYrS6B+TnzY8TkOLhA tqkNo0S12nZlTgyLwC5xao70mCdCstRf+1DhBUTNQaOqtIRY1QzAE5n1v l4y9vG8k9RzfBxijrTbnRYuH9Oqbt2vKYor6lV0A6011LeRBlQGcL/Bfk T4IBJPM+QLQKeg88nkgGkT91Fm3nqZeUClfYPu3U2f23E3AvkvTbgsHKF j1kNyDdeaqDVfIJojL/CzzDZblDBiBLU5tEvDJ6rmyz1uqSb86mprOOvr 7J9QBuYUEc3EFsvgdTCDVzocDoB7V78sHqb2IC870MK0g3xoH1SHNYulr w==; X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="154305" X-IronPort-AV: E=Sophos;i="6.04,237,1695711600"; d="scan'208";a="154305" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 22:09:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="913087219" X-IronPort-AV: E=Sophos;i="6.04,237,1695711600"; d="scan'208";a="913087219" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.249.171.155]) ([10.249.171.155]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 22:09:54 -0800 Message-ID: <1af87099-ad52-4b34-a87c-f12925903a15@linux.intel.com> Date: Thu, 30 Nov 2023 14:09:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, Joerg Roedel , Will Deacon , Robin Murphy , Kevin Tian , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] iommu/vt-d: Add support for static identity domain Content-Language: en-US To: Jason Gunthorpe References: <20231120112944.142741-1-baolu.lu@linux.intel.com> <20231120112944.142741-5-baolu.lu@linux.intel.com> <20231129202615.GN1312390@ziepe.ca> <20231129202851.GG436702@nvidia.com> From: Baolu Lu In-Reply-To: <20231129202851.GG436702@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 29 Nov 2023 22:10:06 -0800 (PST) On 2023/11/30 4:28, Jason Gunthorpe wrote: > On Wed, Nov 29, 2023 at 04:26:15PM -0400, Jason Gunthorpe wrote: >> On Mon, Nov 20, 2023 at 07:29:43PM +0800, Lu Baolu wrote: >> >>> @@ -2311,6 +2316,13 @@ static int device_def_domain_type(struct device *dev) >>> return IOMMU_DOMAIN_IDENTITY; >>> } >>> >>> + /* >>> + * Hardware does not support the passthrough translation mode. >>> + * Always use a dynamaic mapping domain. >>> + */ >>> + if (!ecap_pass_through(iommu->ecap)) >>> + return IOMMU_DOMAIN_DMA; >>> + >> Doesn't this return from def_domain_type completely prevent using an >> identity domain? >> >> I thought the point of this was to allow the identity domain but have >> it be translating? > I suppose the answer is the next patch deletes that stuff. > > I would probably have structured this in the other order, first add > this hunk and say that old HW is being de-supported. Remove all the > now-dead code creating the 1:1 page table, then refactor the remainder > to create the global static. Okay, that would be more readable. Best regards, baolu