Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4584969rwl; Tue, 28 Mar 2023 08:42:20 -0700 (PDT) X-Google-Smtp-Source: AK7set+o5q1+bwVE8VgB1g+u1g1yPfIyS6KgOttgj9xmijyUbPwhIfqGLjk+wAxh2e/Xp3F4rwx4 X-Received: by 2002:a05:6a00:80d0:b0:627:e677:bc70 with SMTP id ei16-20020a056a0080d000b00627e677bc70mr19271675pfb.14.1680018139736; Tue, 28 Mar 2023 08:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680018139; cv=none; d=google.com; s=arc-20160816; b=v9uXw5PxY40Abk6CIRbd5RxXdC8xKR5LlPNWrAtmoFjaRUUHVzPI9oeX6IpmCMCeMU Chim9QlxcK0xmOq6C6iDTDFoiI/jMPTognkvC32ayl2u2gPLPGZT6UIqOKF+Eg/6G4r+ 5Mayn26HfKYednEbGTXjNOTb2yC4RRUPotKArnZL3fHGgMvayxjMEULRY79mz80U8zup WqkOsbeGaSiy4fe9U0fmchs2rdN5FlTwnV6zanl9oNHTEMSySoQGghq+H5k30syTm7JW FjlHfoXYmFl6nYzRgrRxuGf49rT2cOMZWv0PK1wa7XumFJped3MOXdPcp5qGP0pQMiWy i07Q== 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=haQFcSL6cf7q0Etieg8LRB+Gz0V84/C5OXB2yX0sr/s=; b=xo9KSiLue9sd9Xw0rMUl6qZSuOb454tmThREDqRpyqKxP17DKS2VRN2Bzsgcd0i1K9 SP2dVSaNF0XmLOyrAJdWzyrnlwT2RCldDQLOU8qW704jpXp7vqrRJRcFDqpu8Bhqvql3 05jAAa4HDdH1Te4IwsplsVneSl96MLXAcC6T4z+dRBao1velcZNwkoYTK3gA9GU4/3M9 0/7+ROKUab9ZfCgn77rztAWLh72pIK4pagpvE0k8dfo8w6DRFq/ywGOTEK/H+1tgiN/j /t6+UDWgxC4uTUqabiNv/J/SqHIXyPDCrTcM2hxJxYg4No/USzv/7VvXIzUrRPhIvamj LyMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=du7pmDsw; 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 138-20020a630690000000b005074669ce19si30495217pgg.673.2023.03.28.08.42.07; Tue, 28 Mar 2023 08:42:19 -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=du7pmDsw; 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 S234057AbjC1Phd (ORCPT + 99 others); Tue, 28 Mar 2023 11:37:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232921AbjC1Pgz (ORCPT ); Tue, 28 Mar 2023 11:36:55 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 708BE1BCE; Tue, 28 Mar 2023 08:36: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=1680017778; x=1711553778; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xbE93YN0zae2+8ft70/75Up7UaulvpFbU76HZ3jAYPY=; b=du7pmDsw2tm3z8OyQCseW0DBw3DCjgpZAc39F8T2qUB14Qn+8UEY98cc qs7EP8k+iAiKx3AwIGHvcWq1aoEKXF75zsEdeOwyHP6rPkfN1pzdXk7RW bBnC97Nk/oDARYFa/HO6TUzYdx8j2rfDHuoQxbV31LvJyRMANO7gmmL2f fTECkOVo7fRTmlX8mKgjydZm8GnUIdAVUwjg8ycLu8vXyll+OK1Ks8zA8 W1RBZ9ZkQHCULZ/pWvFpfLJ6xPwZ55LIPmDiSJfp1P+ZqZThUJ+0jXiqe R0rPBtmqrITyq0q69Nq2jfFYZIuPOxe4uZc8xwCKy5nrAkQddSuScpu9Q Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="324499059" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="324499059" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 08:36:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="827504413" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="827504413" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.24.100.114]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 08:36:13 -0700 Date: Tue, 28 Mar 2023 08:40:15 -0700 From: Jacob Pan To: "Tian, Kevin" Cc: LKML , "iommu@lists.linux.dev" , Jason Gunthorpe , Lu Baolu , Joerg Roedel , "dmaengine@vger.kernel.org" , "vkoul@kernel.org" , Robin Murphy , Will Deacon , "David Woodhouse" , "Raj, Ashok" , "Liu, Yi L" , "Yu, Fenghua" , "Jiang, Dave" , "Luck, Tony" , "Zanussi, Tom" , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH v2 6/8] iommu/vt-d: Implement set_dev_pasid domain op Message-ID: <20230328084015.5c8c08ca@jacob-builder> In-Reply-To: References: <20230327232138.1490712-1-jacob.jun.pan@linux.intel.com> <20230327232138.1490712-7-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=-0.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Tue, 28 Mar 2023 07:47:45 +0000, "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Tuesday, March 28, 2023 7:22 AM > > > > Devices that use ENQCMDS to submit work on buffers mapped by DMA API > > must attach a PASID to the default domain of the device. In preparation > > for this use case, this patch implements set_dev_pasid() for the > > default_domain_ops. Besides PASID attachment, device will also be > > attached to the domain as the result of this call if the device has not > > been attached before. > > > > I didn't get the last point. PASID attach should only have the scope > for the pasid. RID of the device might be attached to another domain > which shouldn't be changed by this call. I meant if the RID context has not been set up before attaching this PASID, this call will also set up the context, PASID dir etc. In the end, we eliminated ordering requirement of attaching device, RID_PASID first, then other PASIDs. How about: "If the device context has not been set up prior to this call, this will set up the device context in addition to PASID attachment." Thanks, Jacob