Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp578063rwr; Fri, 5 May 2023 01:32:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JhhAOeIdlcGFwdHE0dZ4/tfRsXHq3TffN4rLYfOSj/Y4/O9KL4ACujfmTwvuS4Cjd1Z4x X-Received: by 2002:a05:6a20:ad9b:b0:fa:fc3f:32bd with SMTP id dd27-20020a056a20ad9b00b000fafc3f32bdmr721348pzb.28.1683275546048; Fri, 05 May 2023 01:32:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683275546; cv=pass; d=google.com; s=arc-20160816; b=g7+ZK5D+Dk3SKQd+w7PDFrydhYQFCuU3PX3UltmrukzV5Ddc/B7LfKGm0d6wMPuv2F w+DzmZMGh0M+FSxLJx3I1emENfIkmlCggIetILD1922Yt1TQzBy08BrcOtIIfBfVWEjF eWIQb+90zTOHTb+HGLtbXMcVfyFaDZoF44qObfgwlvFO2r0voiIe0biasGZ2QDRhMfo9 WSLt4ihHG+aerEyWKf8vqM13s6Whm/6ldc9NegPeSylK78LJOl6xoO3Hw0H9tkpy/hpf OXF7yMDEEkxfVOlQAp+tM3+c5gzJ05ClTdJlryv1SJgANtQHFR+HyKVX9J8pF9MoGW96 9lLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=/YhEcGPbyCH9fBNVKhLik2p/VmeIOVpkhplUqGh8EpI=; b=EQKQlW0AUea+rhFbWAg+Pq9Ge2tkcYfeW0D1wReOt13iPVkV31Oy3Px5q+wqq8wBD9 FPzO+xAA+D5l2Tt4YgPifN5Bq50Q4rgAqDZcFp3d2NszMhNSAUMFaDmWAWeQjP1+eljz LP0ZrZI2BJaUOc5YeW/2IlpjCVCFNPLkiYld4ZsCkMRTQW6KtK8thN/1oRthZ13V5TUR wiypE0iPpQQxtw5rzaO0OoFldOP+/wmcPkbq2ObOtLBSXLxTFd4moxBJm2N95aW8Q3Aw VCR12IHsDhpSBCZYeB/UZEipwOIgyxdZMokTLqRh8Pb+gq2hnB2eD51GA57O+pwLyZA2 o0WA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=il8ozFSn; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); 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 f28-20020a63755c000000b0050bede17e7bsi1522856pgn.347.2023.05.05.01.32.10; Fri, 05 May 2023 01:32:26 -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=il8ozFSn; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); 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 S231587AbjEEI3l (ORCPT + 99 others); Fri, 5 May 2023 04:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230459AbjEEI2r (ORCPT ); Fri, 5 May 2023 04:28:47 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D1E818172; Fri, 5 May 2023 01:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683275298; x=1714811298; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=nHtUAgHBPwgUu6Uedja/OE5sb7xBvmIwwegbmSE8LVU=; b=il8ozFSnMm1SYG6KPvw/7rZ0cttUbaO+aqPbnBBJErLrLZV6AoKIu4ax 73Zks4GjeyBPpAuvbpDTCWCkg0XwuATtc+0bfnw2uLc9IALmXIr38kIMu f9lJLdQO/ytA1jMtZpFk/+TTWk6rc67tC/qr1qTewbZntIHWau+QVcdr2 w2objz64UyecuSOVN7oqA6qzTA3xO8BWQCMyoIlM4fm4YKaIeGh4FIt5v /zk39+/7we37AXi0ONI6gJegFAQBieeMc/QXyKyhPusloXMTLK3cHV8Dp hzfjCHM3LNE0yQqQId631WIi7i5J2p2d4rj6jxAyVWSTaLYg8hhxyTTVp A==; X-IronPort-AV: E=McAfee;i="6600,9927,10700"; a="328782813" X-IronPort-AV: E=Sophos;i="5.99,251,1677571200"; d="scan'208";a="328782813" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2023 01:28:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10700"; a="762345705" X-IronPort-AV: E=Sophos;i="5.99,251,1677571200"; d="scan'208";a="762345705" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga008.fm.intel.com with ESMTP; 05 May 2023 01:28:17 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 5 May 2023 01:28:17 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 5 May 2023 01:28:16 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Fri, 5 May 2023 01:28:16 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.42) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Fri, 5 May 2023 01:28:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IjUgF2fIcQGnLUfgFR4eFHqZhnTzvzs1CvqMqsF0pxzcxJ9Y0LiUGu2FiidRD0dWm/EiTC5o4U9WKLoJsWEcCw1+fHzkrL5NMptUFo65czHFz2bORk0WwimaPODKtKnbQlxQotT16oG6pbQYsDJ8pooPh98kh3808IPeWgXCm0AKg1xd+WdFB9LdLlcibDBmttzMlsS81ppl/SVIxv2qT++7gvvKjhSHZ3ozFfFF3MKup0PdUmaRUcxiNQERrqwEghBM6jHW+Hq+wqBiYRIFZAQq2ysSt4A3XYntAOiU0D9ECvvPLVaJeRwkzxgz60282od6vcaL69rALxjx/S9m3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/YhEcGPbyCH9fBNVKhLik2p/VmeIOVpkhplUqGh8EpI=; b=FoO8ZCKLleMbcfmzs9TKQIk9eRq+jvAFFloCvE/F09c03q7SfhXlzTP8+TxCbkEKZ4N/39RBCWJ4Due8DkMC+uwJFK9rUpjxK+fKfm4sEarEUfXSHYwwRdx6B/1DS8EKjNrmkP5XSu5XGb9Df8+63yaXBtJh9JWIHYhFqQ3JTeGW2ReuaOonJ/ZezWdFHIHYJbe/HCQZZ3j3KD0++pcFqD+Qqb+NwmqaK63iNLDZfWU+izELYEQ9X6KV2brUMuKx1SIPE2WwRR7IXnHy/aTdGAuc86lFjXcdJNM9pf8h6om5r1ghHO9yTxTpz2frBStaKwooASfDyFJubjPQ+kq0vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BN9PR11MB5276.namprd11.prod.outlook.com (2603:10b6:408:135::18) by LV8PR11MB8584.namprd11.prod.outlook.com (2603:10b6:408:1f0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27; Fri, 5 May 2023 08:28:13 +0000 Received: from BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::73e9:b405:2cae:9174]) by BN9PR11MB5276.namprd11.prod.outlook.com ([fe80::73e9:b405:2cae:9174%8]) with mapi id 15.20.6363.027; Fri, 5 May 2023 08:28:13 +0000 From: "Tian, Kevin" To: Jacob Pan 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" Subject: RE: [PATCH v5 1/7] iommu: Generalize default PCIe requester ID PASID Thread-Topic: [PATCH v5 1/7] iommu: Generalize default PCIe requester ID PASID Thread-Index: AQHZeTASrtonzxFRJk+i3Dzn6cfwy69Ad3fggABqFYCACoJxgA== Date: Fri, 5 May 2023 08:28:13 +0000 Message-ID: References: <20230427174937.471668-1-jacob.jun.pan@linux.intel.com> <20230427174937.471668-2-jacob.jun.pan@linux.intel.com> <20230428085615.58e437c9@jacob-builder> In-Reply-To: <20230428085615.58e437c9@jacob-builder> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR11MB5276:EE_|LV8PR11MB8584:EE_ x-ms-office365-filtering-correlation-id: ebd51753-7079-48c4-f20d-08db4d42aacf x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CWR3lMadIzJYhZQ/5QfutzPTsaT0d/LwU7E45M25kxBWkK380m54QTvIV/ugUVVCQCtzheSfC5lPi/dp49jzx0piaaGW9ZNBWsf0A/UAP3VsYj4m4ZvIaowU/KqIGHGUSBsJewSZO5fDNfgMy8EsEzJJ1CrxEjdGkffEsIGMSLVG7NwQRzydmKF7inNe7lkJxX4QmUwTOwlR4o7GePkFMFc93FAVqIYsF3dnBKjamZe/IiejIMfQaom0612NQJpt02zTBb+75iV9UFfGbS0gWXnz6H0VcYrDqzEJJYtlAOMTA14oHsnvImGauD9QQgaC7PkTssX/HFZOfCtV+vGA/w7uipaLfZvBkB3MkF2zhcfETxqVA1NHo1UgEsvw3MDJZ4gZ2LW4HiuheThmJWsZH1UVJizk4Cchdb9Eq9P+98d6qkacokMbYtkZGkBDBx42eOlaCVcHjBlLhdnTcBbwJBxXm9stU8KZSCmUqb1qTjZHu4YjL/LV1wU4qPcZgOFjgKAVssQtUNlvlFqhiwxChCGELjTE4jhA7MuwISb+XHbt9d4MYAUzAEbMjLM8vGF9TN2A8GKQ/dkbPqPmm9GmfrByFwmK7T2hImlHxQTXmHTtpd2rKiIgqo0+Svbtpv+1 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5276.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(366004)(376002)(396003)(39860400002)(451199021)(86362001)(33656002)(54906003)(316002)(76116006)(66946007)(66556008)(66476007)(66446008)(64756008)(6916009)(4326008)(7696005)(478600001)(71200400001)(55016003)(8676002)(8936002)(5660300002)(52536014)(2906002)(7416002)(41300700001)(38070700005)(82960400001)(38100700002)(122000001)(186003)(9686003)(6506007)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ky2qG/2ZbsX9chtUKcGTzB3hevOLcIBA3rqGQddrtFxI0WPKavZozsi4K6Fu?= =?us-ascii?Q?8jGJ7PeDieiFwtdZPWS3+ITbbOe2ddOfUu2Cm1i4mDMFdduARVzjAQsPX5cu?= =?us-ascii?Q?jog0yLdl1tEEUjs1uu9rcfrOwQxg6gN2OjeEaycOK5y9dsJStBvnjNaLX8w2?= =?us-ascii?Q?c4PBVz8cvM91QLGyRD3dwUPQ/iuZW87xH2iP9Vs7iPazr5J6lINe6eOyaI4p?= =?us-ascii?Q?k8VHq/nbq5JJZUkX9vhE7MmQnE5T1X6FPALlFbJ+4qAElLPnrL1t97Mxf8xe?= =?us-ascii?Q?lqQCusRXZDlhpohZq0vxJnKX5tZ24bAmulV3pfHfpgQM5G8TZpP/ENJ1oeXT?= =?us-ascii?Q?egciNMfJtJz+p+bUIKrKeC3S0trLuddY+JpAaoYHYeW54EcfYoN7bN/AuT84?= =?us-ascii?Q?R5npmr9RMubZ6wRfok3bu4v2QpLKlUoklRAm5l/BJx2W9DMW8DGqwJF1TDc6?= =?us-ascii?Q?5ZBWJ3cTXZnTu81TD9D2/Ij8dDM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?DINiI3Lsy+spqsA4Ba5fzrbrLqyhNEO9eDT2liSCzY0zGl8DlFCyRBffWKrP?= =?us-ascii?Q?KPZu0uiyFS2qQT2RLaL5nf9X94ib1Ucv6GCaZjWtG+oOfdlWi+pUZI02dv1o?= =?us-ascii?Q?l6ij/OqFhzQtzQOhUcLo8P0k8vm3Zi31/eT5egogkmTfRt4niNGDmHB9tQ?= =?us-ascii?Q?=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5276.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebd51753-7079-48c4-f20d-08db4d42aacf X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2023 08:28:13.1358 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: grYdsUaupIYZkAa0DsvZvA2hPLVPXTaIgW0u/mnx5BN3U/+KSGgLSSYS0hueNq6kYFB6nN2q5HTZl0RvL8HBiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR11MB8584 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 > From: Jacob Pan > Sent: Friday, April 28, 2023 11:56 PM >=20 > Hi Kevin, >=20 > On Fri, 28 Apr 2023 09:38:32 +0000, "Tian, Kevin" > wrote: >=20 > > > 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 differen= t > > > 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. My point was that since it is common why there is no change in arm-smmu driver to use the common macro? >=20 > > > @@ -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 SM= MU > might be better called stream ID PASID? >=20 > > 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 :) >=20 > other suggestions? >=20 that is even worse. Let's keep the original one and see whether others have better suggestion.