Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5536749rwb; Wed, 9 Aug 2023 05:51:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAfe5XG+JYsHa/T+tVgnHzDhsyARtiChgBI0j/61aJ7acLoduHIaYPAxrLdlccXiLS5wKH X-Received: by 2002:a17:902:f547:b0:1b8:4baa:52ff with SMTP id h7-20020a170902f54700b001b84baa52ffmr2645217plf.47.1691585517390; Wed, 09 Aug 2023 05:51:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691585517; cv=none; d=google.com; s=arc-20160816; b=k4iZWv7kpTPP/peEdBF5BMA3D4soiJIUT2TZVSYaTIPJH+Oo23X0TdZ7E8uroUk2iw mAax0kDbcV6dlAZLti7fF4r9DpWD/VOlFpJnkzk6LEpd1CPnYQC9t0Pz9wZ3ykiqiJMe oc7stq4GCO1C60JbKRQyKdJCPh6hCAqdoz+B8abiV0r0Zo6P8cGU47PF+mJIBeXoZ2ru 0jWz7Sy0Axiw/kfycMcyC/ktJoGDYt3XZp589RwJ25DdGfY0ZYXTTWRIRcMEbtB5oo3s GBUCxjGFg38ZxFGbWK+Fwk7UZmWxf8VqYtVNVsglyuE3EKInp7TZxSGPAx0LsgzJhGo5 UVyQ== 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=f5XCslQIOYCmCnNpKH1KzypVOjfCXyjjAbvmMflnwzI=; fh=+FtLDDKPxSMPmWO1aA7dPkXMWyw5C42l7YoXEG97T74=; b=dor3A1/579FQsg+9tH1vOZNfghw6Uxs8iqg8791xbB2a8LyOJyddKDwBPu05oNh/sw E3SRjuqxizR+KbzSYwBMdr6UOLRKlt7A4eZV5Ze2bwAuOJmtrzuy7imNp/LttCt3IXii zWfyJtEHRw2O1okY3N4V5Fnluu8uKnUSh3eKHK2ev4V9yZGff98ZbW/qndGcjDxVpOFE gDCH2jrMCVeutAEACQtzhGYwhxYOEOVjnesUh7tINX62vfJS9Op8O/iCLdx1yrBwucQy /74OVloD5laQ3TMvmkWeITSTn48dl9LP3zDgWi10/8pE96wgL+ujPx+N3rsa04UeSr3x KZOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=b3gckT21; 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 l14-20020a170903244e00b001b9ffdd9488si9410084pls.624.2023.08.09.05.51.45; Wed, 09 Aug 2023 05:51:57 -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=b3gckT21; 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 S232750AbjHIK6W (ORCPT + 99 others); Wed, 9 Aug 2023 06:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232763AbjHIK6U (ORCPT ); Wed, 9 Aug 2023 06:58:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F8DF1FF9 for ; Wed, 9 Aug 2023 03:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691578700; x=1723114700; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=VfEV/g4BYLMFSmQMtdobIwp2qdeqXTAh5Riv2DiGEVU=; b=b3gckT2127HmK21zGAHjNh6KS1ojU+YLmDRT17ZhWKQcR7fgsdcSVvTZ +aiDQl2tMlLxdRiMakwiZ7JJqGh1zRaBPYjicXG7Z6bxSUeegCu1JK6h+ qS6aM010BqPnqhX0hXO29Xgw387i5pbwkTwSXwYUUZ6Aj771n3FGXQveo 4E2KGchCm9p7GzQo6drtouK90lVtaauJEogcVwf/ncC/6m8vnGle5faGQ lKeYxTqG20hfGvDpoFUSqAG2H4iWbcx3qBr152sLku/a8SG3dO9en8mw8 E2QtOJvkyT/4iNde2nV1k4/gm/tv+pUgG8nogNvGiTIWkmdUcWJ24ISra A==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="437457747" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="437457747" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2023 03:58:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="801706808" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="801706808" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.254.210.171]) ([10.254.210.171]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2023 03:58:18 -0700 Message-ID: Date: Wed, 9 Aug 2023 18:58:15 +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, "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/5] iommu: Call helper function to get assigned pasid value Content-Language: en-US To: "Tian, Kevin" , "Zhang, Tina" , Jason Gunthorpe , Michael Shavit References: <20230808074944.7825-1-tina.zhang@intel.com> <20230808074944.7825-3-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=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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/9 17:49, Tian, Kevin wrote: >> From: Baolu Lu >> Sent: Wednesday, August 9, 2023 8:22 AM >> >> On 2023/8/8 15:49, Tina Zhang wrote: >>> Use the helper function mm_get_pasid() to get the mm assigned pasid >>> value. >> >> For internal iommu drivers, perhaps we should use another helper. >> Something like sva_domain_get_pasid()? >> >> Suppose that the iommu drivers should have no idea about the "mm". >> > > Aren't all touched functions accept a struct mm_struct pointer? In the end we should remove all mm reference in the individual drivers. The drivers only need to know what they need to know. All mm-aware code should eventually be moved to the core. For now, at least we should avoid using mm in the set/remove_dev_pasid code path. Later, once we complete consolidating mm notification in the core, drivers will have no need to use "mm" anymore. Best regards, baolu