Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp491222rdb; Thu, 5 Oct 2023 11:44:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEw0EPUY8cUW9EaNzJvD8CDHmfwTipaorbWzEr5uXdCKaYISAyT89P+L7vusDTUzExwXVoX X-Received: by 2002:a17:902:f541:b0:1b6:bced:1dc2 with SMTP id h1-20020a170902f54100b001b6bced1dc2mr7041647plf.0.1696531464516; Thu, 05 Oct 2023 11:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696531464; cv=none; d=google.com; s=arc-20160816; b=Hqz24e7PW775wUiRD7LLT7RVEOOP3yu30g7hW1ny22M8EEQ6cfhPKBrRnVzkB5jdG3 RFoX4v9tQzqtQvj72zeaxkXtDc+wNQCFySQWvAu1KvSv0iEBVqiH+omuR9OeAy7j67jb TolbNIHFLn2hTzcJlCNIheaknkMubICFH+K7KLzW6MyQOZRwhu6jBXpM49knygo6aH4p ke9e+kpQ+a2eZjWBTgqpRE3HcTsWqf922yQ4RNucqcQqHKgxDExWaD6aa477QMLr7/Xm IQnN/+imdBqE18IZWExAOIka3dmE2X+z4PnJy0qhvtpqYr6R4MGKsQ76uW23rjEDoH12 o3uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bv9JmOKZp2Hb05ZdRhbebweP3aei/gOx0hJ6idhzHDo=; fh=4ns45bZfrwFdXPgeQN3ffYKcEqbNQsKKKh0jYm6xn10=; b=Ryk+IJiOKZfSjybdSuZsgqhqscvQNepqU6RngCR/1WWFdijlYRwUzF8NwrzXIi4FHP TRuMEwmn1IGWnrADwYXKGUoW+HrovFY0bihN/rvfVaIeKfDNmQxGK041UEtG+lNA12Aw Agd2/2DWLMQ+14EfZLRMAOk6Nl6MPxy9sWDHfUMa8tltUF1L9ehywpzNaZ63SeLSEuL9 w7pX9RcKqRoPwY6EF6HM+6Dk5vzZ/Vy6Yc3Fxa45dDyiER0LmmY+SQYPBNQ02QENusWj QxXiKLOea29j4HbMYzFjz2QbyJcHZT1UYFelvIWQ1ITZ5ZDq9gBEFKDtCW9LyOmyl0t0 RyhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=dmf58RTw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j8-20020a170903024800b001c612f42c78si2115700plh.513.2023.10.05.11.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 11:44:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=dmf58RTw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 57124807E002; Thu, 5 Oct 2023 11:44:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbjJESoN (ORCPT + 99 others); Thu, 5 Oct 2023 14:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbjJESoM (ORCPT ); Thu, 5 Oct 2023 14:44:12 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECA1790 for ; Thu, 5 Oct 2023 11:44:10 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7757523362fso84240385a.0 for ; Thu, 05 Oct 2023 11:44:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1696531450; x=1697136250; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=bv9JmOKZp2Hb05ZdRhbebweP3aei/gOx0hJ6idhzHDo=; b=dmf58RTwgMd/RCWQ6fVHHyBQpywvRlVQwGEvLdVm02BWV3ZrJqu0v8YvTuasrLieoE wpAeUZ1/SKyOSW4h5NaZq8PCyFz+bLLyy1edMIOiCLtDP1TxXPKAhWcsVfocu0RSdtn5 tnjE/H797uubUvCBKy9YBYJgu6ptVTHExIfdZIxckjMvcwF13L3L0MM6mbdtcNfzBVaf g2E2sTL+nA5IfOz6Ro+oxdQIKmzNuWb7X7cPnUp1iMxAzEoFrH6tTYIPGTU0+/+kmf+U FnQ4y/WkjYpHIE0RoORgvbkv4cFnyB+ONRUPEqYq+y81iZVaYAq4grb/CHAEG+y0sIQ4 1VFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696531450; x=1697136250; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bv9JmOKZp2Hb05ZdRhbebweP3aei/gOx0hJ6idhzHDo=; b=X0G1APhCoc3BEOy/C9sFP9B2EKhPIMuE6wzQ1IDIzVqonuPfTJEZ+j5oHmcgmXSjPv I+uT3HhHeIwbUbnEvY2WO52D7ysE86W9VYAATUTVwo/G6M2yyvvStgj7I/d087+ryyZN hkYrnwzEI4IiWJ73FI1sZg5W652jUx71s5WPGGdU09gPHEfkJ4qYl3bYnjpgehU63TWA GE+1KN/2FMMrF4c41h2XT4oy5etKfZ++gRWeHp7JVqANlrhobB7Poa+4Jcg/GiGGSqsJ XWdrFAsgiM+PIrhNCWYvOhAmJxUZ3ge+7Xjbkbd0RB9FUzAKpHd8KV6dmMxQ4Ul1j9pZ POEw== X-Gm-Message-State: AOJu0YyXRNNezvvGo6cUJ8MN8rj+d7AuZyolLuu0AuYGSQDZ7+0BDZ+U sSvCj3I6LLKiwBWe8wFwTwP6XQ== X-Received: by 2002:a05:620a:2953:b0:775:cf5f:8a81 with SMTP id n19-20020a05620a295300b00775cf5f8a81mr5961620qkp.62.1696531450088; Thu, 05 Oct 2023 11:44:10 -0700 (PDT) Received: from ziepe.ca ([142.68.26.201]) by smtp.gmail.com with ESMTPSA id e2-20020a05620a208200b0076cb1eff83csm687090qka.5.2023.10.05.11.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 11:44:09 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qoTKO-004Z4y-3f; Thu, 05 Oct 2023 15:44:04 -0300 Date: Thu, 5 Oct 2023 15:44:04 -0300 From: Jason Gunthorpe To: Tina Zhang Cc: Kevin Tian , Lu Baolu , Michael Shavit , Vasant Hegde , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 3/6] iommu: Introduce mm_get_pasid() helper function Message-ID: <20231005184404.GT13795@ziepe.ca> References: <20230925023813.575016-1-tina.zhang@intel.com> <20230925023813.575016-4-tina.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230925023813.575016-4-tina.zhang@intel.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 05 Oct 2023 11:44:21 -0700 (PDT) On Mon, Sep 25, 2023 at 10:38:10AM +0800, Tina Zhang wrote: > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index a4eab6697fe1..db2510da28c1 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -1189,10 +1189,14 @@ static inline bool mm_valid_pasid(struct mm_struct *mm) > { > return mm->pasid != IOMMU_PASID_INVALID; > } > -static inline u32 mm_get_enqcmd_pasid(struct mm_struct *mm) > +static inline u32 mm_get_pasid(struct mm_struct *mm) This should not be in a global header Put the mm_get_pasid() in iommu-sva.c as a helper Have SMMUv3 call mm_get_enqcmd_pasid() for now, it will be fixed There is no "mm_pasid" that should leak outside of iommu-sva.c except specifically to support enqcmd. Jason