From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EA0FC433EF for ; Fri, 6 May 2022 05:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389233AbiEFFk1 (ORCPT ); Fri, 6 May 2022 01:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241031AbiEFFkZ (ORCPT ); Fri, 6 May 2022 01:40:25 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 243AF5E76E for ; Thu, 5 May 2022 22:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651815404; x=1683351404; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=7WUabhyWEk0L7SRCIeRBJvTnaBGJT01I1lM5YJHnXF8=; b=I1+oMP8uW81gtiV+Cja77FEA063QVbPXr+81v1ktL8HloNXxz4iL4GBQ Wb8H64tr7gAd+f+BloX2xpv0UmtFBE/NyO5wY+yQ+xuhX3ZzpwJGN5OWQ B2rUreI6uJq5ebmu7lUt1z8iWhSU7qNNZX2iD5DQzrnY5PGFE/ePsvFvz jjy43P7OmmGtCh/3bkq9KZWT3l1PikCihw3IrZ/lBYAxFdrACug0lzGWI iGo8gI55rRAvi7k+a0J+tqMJ1+gBjF6FTyz7smhy9mw9nMg32gxV830fK zezjxzLsK97/xhYInhmEdNulFvUzuVAhNZGC4+z0eLmvZr0SMYOFcEa+1 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="267198191" X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="267198191" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 22:36:43 -0700 X-IronPort-AV: E=Sophos;i="5.91,203,1647327600"; d="scan'208";a="735407780" Received: from sunyanwa-mobl1.ccr.corp.intel.com (HELO [10.255.31.183]) ([10.255.31.183]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 22:36:39 -0700 Message-ID: Date: Fri, 6 May 2022 13:36:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v4 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit Content-Language: en-US To: Jean-Philippe Brucker Cc: Fenghua Yu , Dave Hansen , Tony Luck , Ashok Raj , Ravi V Shankar , Peter Zijlstra , robin.murphy@arm.com, Dave Hansen , x86 , linux-kernel , iommu , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Josh Poimboeuf , zhangfei.gao@linaro.org, Thomas Gleixner , will@kernel.org References: <8c044e49-74bb-df56-8a60-663013c0910e@intel.com> <63582490-a794-fd11-0380-44b27cc660b7@intel.com> <044595e6-e5d0-26c2-af8e-fc9d06906179@linux.intel.com> <3ea91623-97ea-f318-70db-55f08922d7ce@linux.intel.com> From: Baolu Lu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/5/3 15:49, Jean-Philippe Brucker wrote: > On Sat, Apr 30, 2022 at 03:33:17PM +0800, Baolu Lu wrote: >> Jean, another quick question about the iommu_sva_bind_device() >> >> /** >> * iommu_sva_bind_device() - Bind a process address space to a device >> * @dev: the device >> * @mm: the mm to bind, caller must hold a reference to it >> * @drvdata: opaque data pointer to pass to bind callback >> >> This interface requires the caller to take a reference to mm. Which >> reference should it take, mm->mm_count or mm->mm_users? It's better to >> make it explicit in this comment. > > Agreed, it's mm_users as required by mmu_notifier_register() Thanks! I will add this in my refactoring patch. Best regards, baolu