Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4849195rdh; Wed, 29 Nov 2023 12:26:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnyK4oUrEXDiG9FoVqLfLJlyKPQOCfl0DuZwe4tkhhrkykwRcA0PFCcadPfiVMn4ExtwOL X-Received: by 2002:a05:6a00:e0f:b0:6cb:b818:c7fc with SMTP id bq15-20020a056a000e0f00b006cbb818c7fcmr19896443pfb.23.1701289608036; Wed, 29 Nov 2023 12:26:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701289608; cv=none; d=google.com; s=arc-20160816; b=VbF4KU5HITtL6Ai+9qsiEC4KjgrVsA0GqgV6rOEbi0F6aGSaWY1UO0svoyYkfw0ROg CyC3J8wei+mM+52F9yKlnMijiOm83XDXuTQewe0HtCqx1NbcwK+1KM4/AQqIoYMu23to jf06vohC88WlmrOVYTrWX+Qh83s+rmnL7psO6EpmXzBiVw8MOob37ShsrVum9+VCA0KK O4CQLGxZn5yXvKV3t/Hny8TVIqRPc0bZvKg75h7vVjYN8UdHwalSQrKSIpGonmG2mTH3 Hq8xFTKckYZ1ddMvMc1SSL00cYlpDPNUea9timIWvCXEXvvwUjfVfPnNP/Z6geT8W5v2 Fzzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x6z49foDTI0A8Rsez/QUHUM8NOSZc6Sqb1M2eWkhgNk=; fh=mz5QG6NCZDzlWIGIimZMfP2nAtOfXpxtZg78m7qqDKQ=; b=OO926uTWnOjs+aRKMQc1kXTHjA7IpqoTtcqKFg3ZFRTtioigG1Lcl14pAKEawlv8c6 FPekOm5nra1k18665eqnijZ+9++qoP+SZ5xlZIUKabfG3rztmvvxz+3KUOpv26nS3qdV mT6K3XSvGekYjbQf31+0WTD3RxC2dKHSgJwJPK911bAWms+pz2bqL5W7rKh36VYd8YBb AEVsrCWYGDWwdZqVTdaquN0XVvr/ptvd96oRHfNMLFsrYlPF3Z9Eugjk5/42G4DZht44 PZawBKTpRJOI/LEpE4uR6Y0gb0tCBsJjdTtHhpZDQ3tV+Tt+i5+uTqiaYca7Qj7ePc7L 6XzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="Z5UYTm/J"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t7-20020a635347000000b005ac2af99d30si15155261pgl.705.2023.11.29.12.26.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:26:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="Z5UYTm/J"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 778F88082DF8; Wed, 29 Nov 2023 12:26:27 -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 S233942AbjK2U0M (ORCPT + 99 others); Wed, 29 Nov 2023 15:26:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233884AbjK2U0L (ORCPT ); Wed, 29 Nov 2023 15:26:11 -0500 Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C79C0D7F for ; Wed, 29 Nov 2023 12:26:17 -0800 (PST) Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1f03d9ad89fso61228fac.1 for ; Wed, 29 Nov 2023 12:26:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1701289577; x=1701894377; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=x6z49foDTI0A8Rsez/QUHUM8NOSZc6Sqb1M2eWkhgNk=; b=Z5UYTm/JjnG8RL34ads3YenjU9zKPt5R1iIECDvPOAWJKQbiYyZeEJwq4nc7a7aoCc meT0ru+roVoQc55D8wwhTjhMj5K6jzTK/Lki+LGtjt7uty7hzW59ENx0J8yTxp4EhAyU JRkK3PhBXlNv5Ej0pUaTMJOHziEHq2WgdmhE7hwFIRkJWwFmUvH+3LrkrungtvJ/XvFd 15ove8Z8aK0idhFK19JJgLxKuNnOC9vGMmlvql8STiig8coQvsE/W7TC20xnZKdx7saA N0QgjENtDlDcwAmnCAxU6CRda/QIUmIK2P3cJiHw4D/xzDPpWhgiLxSCb+NL5yFAS8Ok qgcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701289577; x=1701894377; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=x6z49foDTI0A8Rsez/QUHUM8NOSZc6Sqb1M2eWkhgNk=; b=QtbpEsu+P5dDkoM1QPdYeQPe1tKXGHo/4Saf/j5WeAhH5DDgpFblFex1GfDgegpgb8 ZOuKFxkBZIEayb9MXFxqh9EjRyaZ4mPEjNGSaeZhnkrAWu1m7X+jkzlbQ1wNPuAiEmQk xsv4bKBfoaNKv5Zvx2y4TtvmHCgns6IkQmMcz4U32zHGnaycaVDDWiP06Yk+pmlBYPTo tkAR1XqUQqfdjFHR40XGPyFwDMPdhlCId6kJgtixRg5O4tgAV1924EVxpDHdi/Sm61lL C7afXWC6EJRXxw5HyWy6782bxha2iPvyoeoTwGzboKibpJtx2EsW+4VSbklcC8AhvEgX zHEw== X-Gm-Message-State: AOJu0YxY2TFA2Il57GwQl1Ief3unZUCrc5O+XPXU3/C01oPWhxvs5YIl Z/ysQuGVH35qsD4HWnxj7OaZeA== X-Received: by 2002:a05:6870:b05:b0:1fa:31a1:487c with SMTP id lh5-20020a0568700b0500b001fa31a1487cmr20181244oab.47.1701289577175; Wed, 29 Nov 2023 12:26:17 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-134-23-187.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.134.23.187]) by smtp.gmail.com with ESMTPSA id be5-20020a056830350500b006d6496747b6sm2115087otb.80.2023.11.29.12.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 12:26:16 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1r8R8R-005pZh-Up; Wed, 29 Nov 2023 16:26:15 -0400 Date: Wed, 29 Nov 2023 16:26:15 -0400 From: Jason Gunthorpe To: Lu Baolu Cc: 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 Message-ID: <20231129202615.GN1312390@ziepe.ca> References: <20231120112944.142741-1-baolu.lu@linux.intel.com> <20231120112944.142741-5-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231120112944.142741-5-baolu.lu@linux.intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 12:26:27 -0800 (PST) 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? Jason