Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6632009rwl; Wed, 22 Mar 2023 13:16:22 -0700 (PDT) X-Google-Smtp-Source: AK7set9AYunWqLQGNcuR3hKfWcDZpq6D51UJ/9kwFqNvXvVVb8muJ4cb4qfTRrK3PO7DDQ6c4lHr X-Received: by 2002:aa7:d486:0:b0:500:40f4:f8 with SMTP id b6-20020aa7d486000000b0050040f400f8mr7813417edr.0.1679516182268; Wed, 22 Mar 2023 13:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679516182; cv=none; d=google.com; s=arc-20160816; b=jzblt3hCDHsn8dyILN+lRPo8QpAj/yQ3jhq9HmCryKpVYkmJkAKupXQL2QOcwpRkke 9fuFiKZWPSbDeI7IYI/MM6ZDapVxY0SNyVou/Ho6upq+xF5c03a/1MUiEcqY8+Pg3XtE 4aLxP30y6d9235ma7hfthJG3QYJTs7vBOOgZSivUYhALUSHA2duUAzPpLZ8UQm7EAxac 2lgW/jiemkliCMcN+3SE86FeBtV+YT1IfH+IIud+zqk4MkYdvoTqPxrNhghuiwxhLSrz w6Qp50ic+2/WdWWZsFhVHDMxV/7DlA6oNF9t6EdQFJZEzXbt5a1CA5W81ZNChQ8o+rzy DaZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sOcLBTecpW0uEbga3uefujIypFs+JZ2Os4hkDalP4Po=; b=Z1oj0seMkUHG7oMpP5s+TFRjjHqpbqw2gJCV+lnsN5K9996QspZDQCq0rGIo5BYg8W vcGd1zHgx6xpSYWOccJvlJSNMFqCX81X3HvFeGW7O4prQ+yLGGAnamcrOI21Z91Zf4YV 1ENq8701jFFCFQ6lCbZJdXJsgWRrdM3DFSfs2NQ7IDhOFDAWmpAxvoNYQVFx6vvkBqgW F/2X8g+heWUWEinswuP4j9BFG3Y2+gumnJv5OrKS0y9vdtbKIeU++wgjTXZqzKF7PhwJ qFOTswtIdt5BcvO45DycUCKvwTZ7Q0/y6rloDjKYPltCXNqrrQ8eSErRlZXTUBDVal96 O8Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NrL41IxP; 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 p3-20020a056402074300b004acb5b5b339si17211924edy.219.2023.03.22.13.15.56; Wed, 22 Mar 2023 13:16:22 -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=NrL41IxP; 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 S231637AbjCVUPl (ORCPT + 99 others); Wed, 22 Mar 2023 16:15:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232286AbjCVUOx (ORCPT ); Wed, 22 Mar 2023 16:14:53 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 708CE85B24; Wed, 22 Mar 2023 13:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679515549; x=1711051549; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VVMjsQ1HxJ3krLgi1Lg7Cpv+oN6wKxL1Z/KsE9PULTQ=; b=NrL41IxPFlwvk9O70uufgZh+DZp1hSImXjwVNA+pE2eeqdzwCPfSXluV mDvYSpjHPVIWIYgB2yEAyOoAp/kld92OuBsJ7F+p6EcB7i0Ay3/X1P2Xk ifwteClaMsg5CeNBIVazg6iE5Zt9beQWqfyf00LQv9ox5XLFWNVCrDLqM +Rakopem/j8QqfaayTa5F6wYOH06mW8aCaQm349aDNBvZl7p1WfRfG+Pi Y+2oh/VPvomZ9rYjN63pZvtxBTmbEqPubiiU23uIDCpvptvMR1oxKAzp6 M2kNGBWWOVmZsEvjjc+j+fMVl2SSiby460MkJ8CJSA7Gais3JMubzGRLM g==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="339356825" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="339356825" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2023 13:04:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="682039332" X-IronPort-AV: E=Sophos;i="5.98,282,1673942400"; d="scan'208";a="682039332" Received: from srinivas-otcpl-7600.jf.intel.com (HELO jacob-builder.jf.intel.com) ([10.54.39.106]) by orsmga002.jf.intel.com with ESMTP; 22 Mar 2023 13:04:05 -0700 From: Jacob Pan To: LKML , iommu@lists.linux.dev, Jason Gunthorpe , "Lu Baolu" , Joerg Roedel , Jean-Philippe Brucker , "Robin Murphy" , Dave Hansen , Thomas Gleixner , X86 Kernel , bp@alien8.de, "H. Peter Anvin" , Peter Zijlstra , corbet@lwn.net, vkoul@kernel.org, dmaengine@vger.kernel.org, linux-doc@vger.kernel.org Cc: "Will Deacon" , David Woodhouse , Raj Ashok , "Tian, Kevin" , Yi Liu , "Yu, Fenghua" , Dave Jiang , Kirill Shutemov , Tony Luck , Jacob Pan Subject: [PATCH v8 3/7] iommu/sva: Remove PASID to mm lookup function Date: Wed, 22 Mar 2023 13:07:59 -0700 Message-Id: <20230322200803.869130-4-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230322200803.869130-1-jacob.jun.pan@linux.intel.com> References: <20230322200803.869130-1-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=unavailable 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 There is no user of iommu_sva_find() function, remove it so that PASID allocator can be a simple IDA. Device drivers are expected to store and keep track of their own PASID metadata. Reviewed-by: Lu Baolu Signed-off-by: Jason Gunthorpe Signed-off-by: Jacob Pan --- drivers/iommu/iommu-sva.c | 20 -------------------- drivers/iommu/iommu-sva.h | 1 - 2 files changed, 21 deletions(-) diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index fcfdc80a3939..4f357ef14f04 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -51,26 +51,6 @@ int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t max) } EXPORT_SYMBOL_GPL(iommu_sva_alloc_pasid); -/* ioasid_find getter() requires a void * argument */ -static bool __mmget_not_zero(void *mm) -{ - return mmget_not_zero(mm); -} - -/** - * iommu_sva_find() - Find mm associated to the given PASID - * @pasid: Process Address Space ID assigned to the mm - * - * On success a reference to the mm is taken, and must be released with mmput(). - * - * Returns the mm corresponding to this PASID, or an error if not found. - */ -struct mm_struct *iommu_sva_find(ioasid_t pasid) -{ - return ioasid_find(&iommu_sva_pasid, pasid, __mmget_not_zero); -} -EXPORT_SYMBOL_GPL(iommu_sva_find); - /** * iommu_sva_bind_device() - Bind a process address space to a device * @dev: the device diff --git a/drivers/iommu/iommu-sva.h b/drivers/iommu/iommu-sva.h index 7215a761b962..102eae1817a2 100644 --- a/drivers/iommu/iommu-sva.h +++ b/drivers/iommu/iommu-sva.h @@ -9,7 +9,6 @@ #include int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t max); -struct mm_struct *iommu_sva_find(ioasid_t pasid); /* I/O Page fault */ struct device; -- 2.25.1