Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2847035iob; Mon, 16 May 2022 07:29:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRckxdfQrpHxumiU1ZUCErO2QAmV0kWq5qAW51tc/L7HUS59Kzwma4K/TZem/WyTRZNvTP X-Received: by 2002:a05:6a00:1492:b0:50e:11ae:f62f with SMTP id v18-20020a056a00149200b0050e11aef62fmr18024386pfu.43.1652711386344; Mon, 16 May 2022 07:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652711386; cv=none; d=google.com; s=arc-20160816; b=yb+qKjHeuWkRNOMDun5E+y2+bO6wHshby1kSp308gQQZmCHHbpIcOcZjS5dwSer4f9 uXyp2NmOzlNLQyLcvSlNLajyG7UZ+LXhAERtB/yjvxpregeFDXULA24y5UOKht+tG4KQ wKe0zClXxJsg+w97XZmIy73WEKcW4Tw8JdlsMQBjHi3JZFgJWMVWD2SvdeC2l0wTRz4q 6LYGrc1sfoWaZhPv6SKSt47WLiXUdW8NiYvHBJ5j8XRnusVj1wIxwrGo219D2Op4SqnA xxq541S4H5Yjw7qvRDYWQ1pic/dawrWKEUcNlOaHQDH8v2TiR/XYdapFftSPXLvVVpwZ Ih0g== 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=UrjvW8HnW6sWSBhzByDZjhv07oJMWRRqUhP+aZ5H41w=; b=aFTJ+q/IGSu3Q7bgfdPHZybRkyiteuQ6NEexJHGpic+oHXEw2+XzRyPPXqjdjcEyFA VmbS4xjpf3INqPiVyLdGOHg4eIfOKms/Gu5ZIIZMWM8w38WJzwIFZak+E75IkWpt+pD7 PhRtkWHlx1Qr2n9heeKhWnsf+eFKpFphxAL5YnJ9XM2F2votFUL5gNA2opq2ltGi3X8X 81YXYgE2Q+D97pTaGcpZNl0nsLCjP8VLTNF5iCH/BeEehh/ODZ9V9vYPGL2XeJL2c8YQ O41nNbQdHJ/yz8/q8Oc/MWwX8YRzApAH/xr23UzWJOutM56xl5a6TD560zyJxizDvkMd EhOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZArC2NGz; 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 l15-20020a056a00140f00b00510a6524248si13420432pfu.224.2022.05.16.07.29.34; Mon, 16 May 2022 07:29:46 -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=ZArC2NGz; 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 S238834AbiEPCEH (ORCPT + 99 others); Sun, 15 May 2022 22:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231318AbiEPCEE (ORCPT ); Sun, 15 May 2022 22:04:04 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656E9192BE for ; Sun, 15 May 2022 19:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652666643; x=1684202643; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=mw8DJE8yvOSuw3spkKWsSAhd7sIYW0oNHvTKwxzir2Y=; b=ZArC2NGzT0y65F6cs+UgYiPWDubNdpfq+dJZ0Ty3J7Mwcts+9kgSi4dl Jtf4TA+P6a/Sd/Dk7p7lcby5Oxci0GeI4VQQ8LGloFb1ZOS3zUGCgQK8u XIO6LTE1unIC6Dc2cMCNniRnQMbQOKtTmuryCcUrhCwzmxCJvNg78VUdW bC0rKNzuGtGzPVWFd004stWawg2miJt7JrArvlIinz7AAauq2mdjh7mCZ OE3RCKAjZUDsbNjAvwSlK0JwaC963wP8h0BNpczBVCXvY6txVFLXjhQXM oJZfI58Za5ydpdCyBeSDyDaJ4HIt+wgbntoOLXAMyWiYAf/fkQ1Fk0+DG w==; X-IronPort-AV: E=McAfee;i="6400,9594,10348"; a="252778603" X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="252778603" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2022 19:04:01 -0700 X-IronPort-AV: E=Sophos;i="5.91,229,1647327600"; d="scan'208";a="522254130" Received: from yanjiepa-mobl.ccr.corp.intel.com (HELO [10.249.192.19]) ([10.249.192.19]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2022 19:03:56 -0700 Message-ID: <90619325-ea39-410e-2e8b-a38895f0dabf@linux.intel.com> Date: Mon, 16 May 2022 10:03:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Cc: baolu.lu@linux.intel.com, "Tian, Kevin" , Joerg Roedel , Christoph Hellwig , "Raj, Ashok" , Will Deacon , Robin Murphy , Jean-Philippe Brucker , "Jiang, Dave" , Vinod Koul , Eric Auger , "Liu, Yi L" , "Pan, Jacob jun" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops Content-Language: en-US To: Jason Gunthorpe , Jean-Philippe Brucker References: <20220510061738.2761430-1-baolu.lu@linux.intel.com> <20220510061738.2761430-4-baolu.lu@linux.intel.com> <20220510140238.GD49344@nvidia.com> <20220511120240.GY49344@nvidia.com> <20220512115101.GU49344@nvidia.com> From: Baolu Lu In-Reply-To: <20220512115101.GU49344@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, 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 On 2022/5/12 19:51, Jason Gunthorpe wrote: > On Thu, May 12, 2022 at 08:00:59AM +0100, Jean-Philippe Brucker wrote: > >>> It is not "missing" it is just renamed to blocking_domain->ops->set_dev_pasid() >>> >>> The implementation of that function would be identical to >>> detach_dev_pasid. >> >> attach(dev, pasid, sva_domain) >> detach(dev, pasid, sva_domain) >> >> versus >> >> set_dev_pasid(dev, pasid, sva_domain) >> set_dev_pasid(dev, pasid, blocking) >> >> we loose the information of the domain previously attached, and the SMMU >> driver has to retrieve it to find the ASID corresponding to the mm. > > It would be easy to have the old domain be an input as well - the core > code knows it. Thanks a lot for all suggestions. I have posted a follow-up series for this: https://lore.kernel.org/linux-iommu/20220516015759.2952771-1-baolu.lu@linux.intel.com/ Let's discuss this there. Best regards, baolu