Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2326231rwr; Fri, 28 Apr 2023 08:56:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xm1eFYRlfQ1Ntsm8JFOYSCO8GOISpxKac6HSTZNPzpOHZF9ivE7QX/CVcAPLKfD6wJdY3 X-Received: by 2002:a17:903:234e:b0:1a9:bc13:7e20 with SMTP id c14-20020a170903234e00b001a9bc137e20mr5702134plh.44.1682697392601; Fri, 28 Apr 2023 08:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682697392; cv=none; d=google.com; s=arc-20160816; b=B2rjwtTxBdB7lapwG1BUYF3EMEMpW7uy/9t4iTMSuLd2kZLn7W4QlBo3J6ni0LnCn1 gl2VZ2Kytewra5uu+NMUhozq/3OL+v+dT67CwKXUfeIwJ+g6oYnfGCU9ZKlaTlsRK2Qc VVh1Wqifatcp4WCP9RPIIoPGaRzhL3s2jpfj+0i36qeaUqEU+XVkOBg1ZHOq/uQrXO5f dK4iXbAOlvsF692Q3qIf6JBOUW83sYYlZSx3O4P5+Fj+78yxL+PGvsxT8s/UJLKCPDIy 9yMRGW/hRj49RUm25t6NUkebcZdAX5mKdUmsLvlKcu25NjlcbTLaoz/6Yvp9M631BeZb keoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=Ow+4IX5/6KD5pQx72T02NSjAtQzTzKhA6HsJCIQWXjA=; b=YAqMUtuH8/M2XqvJic9VICL82EGZYuF6oJKBQjIuM0XlfeaUBprBCEbJ4b5fgmvkl9 0CtTNua9cdTSNWKFpQPaiSPTYV1moYTGzrarj1vHGlU7xn5lrB1jvD9ss93SLWsHYabo NQ5yMXPjdMSX2oBwD5ZzjcGXfxuzJ5o/v0/vIh8sfrZhAL4PCJv+G2D/vgGhYc1MQw4q 5TE2KFybMaBijTXmrdx2smtx+PjFo2aDOQ0tpckMvUrw6hOXiTaobnoZBEeVQOl9u5vv sDKcGNP25i6FIwsbKpalerq/aN25I/3ZUMzlUN2oGi/xLRTUJLSoI6WdVWCQ+7WI/RtB cD0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jy7dWJpp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a17090341c600b001a1d987fe28si19934214ple.405.2023.04.28.08.56.20; Fri, 28 Apr 2023 08:56:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jy7dWJpp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345685AbjD1Pv7 (ORCPT + 99 others); Fri, 28 Apr 2023 11:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230420AbjD1Pv6 (ORCPT ); Fri, 28 Apr 2023 11:51:58 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 917D21984; Fri, 28 Apr 2023 08:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682697117; x=1714233117; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vrd2psdUQes7KhjYx4FBAisXAZuT9MhfS8Jsg+nYJhs=; b=jy7dWJppzhEZhNt80Fuyo0Br5jiJa5VY2+EmWZPxOBdVxpJyFapw8ngx EiIkgoMntyNaPvDaATskLIGMGrBFibRq/cYK1yr+HOnr075VUdjWjUHA0 wP8AkacSkHK5fBwkh+kIqbx9ZxEHB9GzGoTDWH5b+KninxsHbE4oMMnjZ tifLOlv/UfcRuFsiIfQdJ7ddB4r03W6IJypZwnrETftLSkbOp06/ySw5U NqxjGlIuSq3aJzZK3A8rE+5TqlghgEjpqdI/lb/9hyMDdwKDMhZgXJdW1 u9V57OSXLgaf8naHQiK0KO1Z2+Sjv0DhaOJMEoVSSZOnVc76wwk9AUPhj Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10694"; a="434072115" X-IronPort-AV: E=Sophos;i="5.99,235,1677571200"; d="scan'208";a="434072115" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 08:51:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10694"; a="941136513" X-IronPort-AV: E=Sophos;i="5.99,235,1677571200"; d="scan'208";a="941136513" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.24.100.114]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 08:51:56 -0700 Date: Fri, 28 Apr 2023 08:56:15 -0700 From: Jacob Pan To: "Tian, Kevin" Cc: LKML , "iommu@lists.linux.dev" , Robin Murphy , Jason Gunthorpe , Lu Baolu , Joerg Roedel , "dmaengine@vger.kernel.org" , "vkoul@kernel.org" , Will Deacon , David Woodhouse , "Raj, Ashok" , "Liu, Yi L" , "Yu, Fenghua" , "Jiang, Dave" , "Luck, Tony" , "Zanussi, Tom" , "Ranganathan, Narayan" , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH v5 1/7] iommu: Generalize default PCIe requester ID PASID Message-ID: <20230428085615.58e437c9@jacob-builder> In-Reply-To: References: <20230427174937.471668-1-jacob.jun.pan@linux.intel.com> <20230427174937.471668-2-jacob.jun.pan@linux.intel.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kevin, On Fri, 28 Apr 2023 09:38:32 +0000, "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Friday, April 28, 2023 1:50 AM > > > > PCIe Process address space ID (PASID) is used to tag DMA traffic, it > > provides finer grained isolation than requester ID (RID). > > > > For each RID, 0 is as a special PASID for the legacy DMA (without > > PASID), thus RID_PASID. This is universal across all architectures, > > therefore warranted to be declared in the common header. > > Noting that VT-d could support none-zero RID_PASID, but currently not > > used. > > > > By having a common RID_PASID, we can avoid conflicts between different > > use cases in the generic code. e.g. SVA and DMA API with PASIDs. > > You intend it to be generic but in the end only vt-d driver is changed > to use it in this series... change for SVA is in the patch. > > @@ -190,6 +190,7 @@ enum iommu_dev_features { > > IOMMU_DEV_FEAT_IOPF, > > }; > > > > +#define IOMMU_DEF_RID_PASID (0U) /* Reserved for DMA w/o PASID > > */ > > Is RID a general team on other platform? RID, aka requester id is a PCI term. so I this it is common though on SMMU might be better called stream ID PASID? > Would IOMMU_DEF_NO_PASID serve the purpose better? not sure, it is still a PASID. For completeness, might be called IOMMU_DEF_PASID_FOR_DMA_NO_PASID :) other suggestions? Thanks, Jacob