Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4967525rwb; Tue, 8 Aug 2023 17:44:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLXEnWa/rQz3l1lvyBcnTtJ4wo+jbj4Lr4NWo/RWdUxCLnl9Z2Y+elXF80hwPJ4GfCMsLW X-Received: by 2002:a05:6512:b87:b0:4fa:5e76:7ad4 with SMTP id b7-20020a0565120b8700b004fa5e767ad4mr842940lfv.10.1691541865984; Tue, 08 Aug 2023 17:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691541865; cv=none; d=google.com; s=arc-20160816; b=lkxQsZO4FObydPnWJ3OyhFPUWl2H2SBs7AQ8YOjjcLL761oXvV1nptyR2drH3Pb36V cndIkFitUgZjaJZSHEsif4UNOSFmNl8PrHzJl9Vwp75WX/kqJb3iWzLiLENJBw4LQeR0 WVCj6vPUX+jxmifVSpA/d/9Tp0JLf+hHcWoXtYmVtabS1igtzNyfuY1K3Zk51AS2i9Nk p3Lecb60I3aC4ZdR+mRbwXTfSfxoiMDtIr6bjEIG5fO9UYw+8l7lrpD7r20Sl1FxCRal l/5zDR+tWrECP3tJ/YBrcgmV/dK4trcdJKIru8HbtUr1u+Co3GLVPtyD8e2EEdd2n37X pH2Q== 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=9/s/4ZAmhAo92TKh3cy9JsSgQsnkzc1BP4vPwyxfCMQ=; fh=kw3F3bwui6sDY+c4QRd04dBnLqO9snCm5n7wuGz9x6g=; b=T/8n1lrmQ28Pel4zLSpe/ruFoX3KjtER8602ZJfBfzKB469cZFDAxhjf3oifYdRx1n /c1XgSF0pfbot2/ciEfgyNGQ7oI9zXRv7taEYy4X7+8w0M4+7vHkAPPXnneotHuKC6CL 4NW0tgJn5XUMDq5r0FfKKOhvVLG9CsFcVTtXNoJiQ2aYQJim5uXpN8MQEq1ADMj7LWGa 6JhWGp8VAZrIl7xL4lZJo1yPzbDC5klNb2RizrKwqIdR2snRiy9vJ0Gb2kIsCLAfesUq HYn1Dbv48agd/8uJM7uYahnG6/xlD5nb3lbMP/edxDHdF+OTBIj7I/MEor6hcNLtH1bI eiwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="CrWvs1/D"; 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 n22-20020a056402515600b005233d7e345esi2926240edd.289.2023.08.08.17.44.01; Tue, 08 Aug 2023 17:44:25 -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="CrWvs1/D"; 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 S229802AbjHIAb0 (ORCPT + 99 others); Tue, 8 Aug 2023 20:31:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjHIAb0 (ORCPT ); Tue, 8 Aug 2023 20:31:26 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D2FA1995 for ; Tue, 8 Aug 2023 17:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691541085; x=1723077085; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=AywbTO27cVNl/fazmIprghWONbtmeCSn9y1uvPUIl/k=; b=CrWvs1/DGrBYu4jtZoVVJBdoWIF5hvF66q9K7uR9/5dbpfwMdNZarQ39 xReqgL5E2X2OkhxtNiD+ovW/inAimwIw/MueV3t99p6oH0bhlp1Rqc5ai rye0REj0oq9oumzUodKqPRa1ZxSQcR54N6B87mBiyhjWRBfQLc6yb/eVZ iFxnw2s5kuVA95ONiEHxhlWrjJt8LZk0CTleDtctoG8JczecQQ5eseO2w PdYgY70nLAFw6jsMqSDKOjxB5KBaJF2vmAQ0QS9dm2iHOyvIUvEiwLG7X D9IA4QMc+/h9Cyo2PxTMA9T63CLcQTK9Ta0eGe6OrS0kSwzjOp2/R/RQG Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="437353070" X-IronPort-AV: E=Sophos;i="6.01,157,1684825200"; d="scan'208";a="437353070" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 17:31:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="725156738" X-IronPort-AV: E=Sophos;i="6.01,157,1684825200"; d="scan'208";a="725156738" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.249.169.46]) ([10.249.169.46]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 17:31:23 -0700 Message-ID: <8ed60665-fb1c-cf94-ea24-5f43ce8c9903@linux.intel.com> Date: Wed, 9 Aug 2023 08:31:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Cc: baolu.lu@linux.intel.com, Kevin Tian , Michael Shavit , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] iommu: Add mm_get_pasid() helper function Content-Language: en-US To: Jason Gunthorpe , Tina Zhang References: <20230808074944.7825-1-tina.zhang@intel.com> <20230808074944.7825-2-tina.zhang@intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 On 2023/8/8 23:02, Jason Gunthorpe wrote: > On Tue, Aug 08, 2023 at 03:49:40PM +0800, Tina Zhang wrote: >> mm_get_pasid() is for getting mm pasid value. >> >> The motivation is to replace mm->pasid with an iommu private data >> structure that is introduced in a later patch. > Maybe we should start out by calling it what it actually is: > > 'mm_get_enqcmd_pasid()' > > We can't actually have multiple SVA domains with different PASIDs > until the places wrongly calling this are removed :\ > > eg, I would expect this series to also come with removing > 'pasid_private' from the Intel driver. > > The mmu_notifier should be placed in the singular iommu_domain that is > the SVA domain for the mm. Drivers should not attempt to de-duplicate > this, the core code will do it like you are showing in this series. The two tasks mentioned above are part of our plan. They will be conducted in stages, which is more conducive to review and testing. This series is just the beginning. Best regards, baolu