Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp176427rwl; Tue, 28 Mar 2023 23:29:18 -0700 (PDT) X-Google-Smtp-Source: AKy350YxwjUtN6npu3N+AXsvauq1HcK1wCZggC2bwARDgYI05umFvqr0AW84jOKbPPTzpTKbbM2g X-Received: by 2002:aa7:c554:0:b0:502:2148:298c with SMTP id s20-20020aa7c554000000b005022148298cmr18187059edr.19.1680071358410; Tue, 28 Mar 2023 23:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680071358; cv=none; d=google.com; s=arc-20160816; b=Nn1PypR15Ky6r2vdO7OxJa6OLEieQKHnBXq32pldUthoPKWpN/BTkiBnoc85tX5/N7 JDBusCzyqQzB0ejKSqCNrPBg3zK9zjdsGOSDrg9PHgIbjDF1/KTgFhXPJyRzQvvuu8c/ B/M3qwqb56cjhdjUI1qTnXH4r5barG2qNR+sLBGG8H2ExroldqpeLGF6Q2on3p+OvJ+V JM99Wf8a9dnuG3AIQ/hIoJZLuiw8CqN1Gr/ibdwkDIW37b5x9sWszyWaRl1iZM4pY6i/ 684LCDhQM2Kkt5Hrn6+jCFIKwh9CNglvTY7qH+83RoSpyWzlfWNkta96CnG0B6VCN8Yd pt5Q== 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=qZJAm4saRYeFH34HBrrjhQe34GrDbaUOIZ2WSjrtApk=; b=XnizrlYYnVPsyx6HMiJF6IsIobYh6c4ea0tWQ4JIGEtlO1rko1DJOTjN6J8ltO4X00 lAClK1XE9Z376h6uYa0BHLfjmQgaxHcWB4PWRmgh+0xuQIfebIBI/T6s7ZilnLoQFQ62 FzV1OL1+zGvly0NiEZVQgDiHuNRA/6wl0YbiEg4wxs1cjyDSnLe4KeBKEYrpV50c/xYY h3OcelAqyjY8DfE6lgd5GTAyg1dEajV8zNcKO01hLe/RqyJ/NZ0E0vdYAGzerwFqrncl RpmUzD6scu6iPHHNOCSemsWmQ1X8vVd8RsZMz0rPknMHXRJKFIdKHkglndqlXL6ann1D EoWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X8VT2yqc; 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 n25-20020aa7db59000000b005021cf63eacsi13615076edt.265.2023.03.28.23.28.54; Tue, 28 Mar 2023 23:29:18 -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=X8VT2yqc; 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 S229598AbjC2GWj (ORCPT + 99 others); Wed, 29 Mar 2023 02:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjC2GWi (ORCPT ); Wed, 29 Mar 2023 02:22:38 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C5D41FE0; Tue, 28 Mar 2023 23:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680070957; x=1711606957; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=RENjv1pFPkUUvA/QrzQeFxG/sxZXAb6K1H65xfm0QFc=; b=X8VT2yqcyKjasbQhhIF1q/Ebmh7fywoXirTFUTr/to3bXDh1OFF3Cmr4 SJOp9pBQoxwrnWGIKxlNiQ8QcYhQFKJ4ee9vCJo+jLrV0AUhK4WXp2zvW BKK2Hd3kMInEXHwgZc3kV5ZmakFDb5P2pcbZTiF145ZnVsxx3dMTKDhyB ARHr+8VY9PevN2QElvUbTfoYP+Jo5SqLM4OUwyegvEDX6xTpCxeKT5bvA jvnNDraYk0UbNCgJgkyoRt5Ecf5ahIwAjvnrWX+pfU0doxvvwKJRJAChe qcIJYvca0xAsbmxp3ezk1mekyjlFD9U9gQ6uD4Ko/M2uyRMRU2kQJpr5g A==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="403414243" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="403414243" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 23:22:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="930180199" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="930180199" Received: from allen-box.sh.intel.com (HELO [10.239.159.48]) ([10.239.159.48]) by fmsmga006.fm.intel.com with ESMTP; 28 Mar 2023 23:22:32 -0700 Message-ID: <797fec71-67d5-6420-3b2b-7056095d4bb7@linux.intel.com> Date: Wed, 29 Mar 2023 14:22:50 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: baolu.lu@linux.intel.com, LKML , "iommu@lists.linux.dev" , Jason Gunthorpe , 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" Subject: Re: [PATCH v2 6/8] iommu/vt-d: Implement set_dev_pasid domain op Content-Language: en-US To: Jacob Pan , "Tian, Kevin" References: <20230327232138.1490712-1-jacob.jun.pan@linux.intel.com> <20230327232138.1490712-7-jacob.jun.pan@linux.intel.com> <20230328084015.5c8c08ca@jacob-builder> From: Baolu Lu In-Reply-To: <20230328084015.5c8c08ca@jacob-builder> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED,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 On 3/28/23 11:40 PM, Jacob Pan wrote: > 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. This occurs in default domain deferred attaching case. > 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." Best regards, baolu