Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2426980lqb; Mon, 27 May 2024 21:57:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxlGA6jpZ93vgDHaawMxQC95XWYRCU8SBstTY6ds0rwx2aRZlkABuE4oaZ1KcBeO8TbCaQw26bMGzx1KtM7qQpl4saQSLMEsp4aPtf0A== X-Google-Smtp-Source: AGHT+IFELXRAVwka221zFUsCYu+ZED+2es1+sAxIAzDLWTKgCbB0AADoUe+DS//cINJJVmdZr7zi X-Received: by 2002:a05:6214:3907:b0:6ab:8ca2:579e with SMTP id 6a1803df08f44-6abcd138bf2mr132727006d6.41.1716872235055; Mon, 27 May 2024 21:57:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716872235; cv=pass; d=google.com; s=arc-20160816; b=ryVdCow5Cedl164vAB1npxvW1BjtvyGP1eofeIhbsKks9ZV5dhowQYhsspImxqhWXW oBvgOH+bI1JA1A0br220C5v/rEFtGsOEEqcg3kjk/QXVi1oL8QyjsKJ4CNAli7QCfzdB JY021gCbrPngr5PD0d7SEx5CRPJ7sAY4E8mSWceHLGl1KqEIijG+MonuiakK/bTZ4a6R +jbwxh2nfZX5SPCYsFU9JLZxqWXzcqeqRqyv6E611sqfPMJESwAl6qHyOZqao+WLbyKB A1WtLmzjUkZGQ0GFCaiApoq3+CJnTPQqRrR5Alk0EAMi0SoGKnHBf7KjHiqXYp48EF7O L/gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=h5sKVpjagRpJSA2CFjKv7QmdLfiK96IbqlN1MrziCzk=; fh=o/A5129la4wXDHTLAOHoV/G5lGCvNJVIDIBY8NIm10Y=; b=0GkwkwC8Dka4b3nw1WRuHP/vtsolhknFRYKrmsb5omiy4d5yEYJzC6NHSBEMg2ZCQp 4dNSpm18hJCnfZYbHVK0lsrzzzxbWkqYlN0Bm105ZluaxR020MPWKrG+18G5JhGYnaC3 jYyr/FLEZsW0HNIOW3LKRytMFkDfWyhFb9N13dN+RpHrpBHotxi049PqPSdaNmHimwnL DipDbA49gKCKIjdtBpyBdbUSddK2TX3gx2JEgNws79Zl+YHbm4wjdLY58oWlDTq7tzmw OdYcDfdWkU9Zz807j4LEJza60B0SVJlulrRq3/ekjCGowBXDxQyttV6Q6Q1Ibv75o63K kyYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fFLjRmuW; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-191743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac11705805si95981516d6.409.2024.05.27.21.57.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 21:57:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fFLjRmuW; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-191743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C6D691C21CBA for ; Tue, 28 May 2024 04:57:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAEDF1BC4B; Tue, 28 May 2024 04:57:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fFLjRmuW" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C7EC645 for ; Tue, 28 May 2024 04:57:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716872229; cv=none; b=kWXnAmUL+xofoyGvwCL7vCsQt1FwEJS7tcW3iiNDW28HV3Y4H01BjzmKz7jU4V/a+7XpOeMMis1xUYVGUX2AmS1RfMar9t6NmxQPRudDVMe/vEbW5TBISgSib8tHEiFLtIvqSUWGQvBHlBxRmWI1j9s1eJBZNG5vgZxhCFLipjE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716872229; c=relaxed/simple; bh=ba3iMqZ2mVcpdjFj398KFn5b1Uae31zCbUmpsYwDZxI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=OICVrVPNl26GOlQ6biWa08H++/tFOr1tA83XzGVQj5o9FH7Tuu145MNAWFyCavr3CHbE2zOt34PCHswz6pmuudrlZK8DlgpfKS9q3RNvGJ4jAZfFeT4it7nvp0h18BHsxROMYr6HO/4116SaS0RjY1FQueNlqHZUAVpil9VjwqI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fFLjRmuW; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716872227; x=1748408227; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ba3iMqZ2mVcpdjFj398KFn5b1Uae31zCbUmpsYwDZxI=; b=fFLjRmuW5eN0hJzXfdZgshSYP5TE73NK9dP4YMpqcZsjNKxPdqotYVcP k5BrTmwEl/1flwU1jVSkevbRyAU/F6AT5V/5nzm0VGllFJmyclwAhXyk2 l1gWKge1d+l5gPWquChqtxxsHxUCxZ3AKbVG1PTI6bjGI9zxwJypnMrp+ 0q/Z5NdyhhDdUzb3LXXSoOn4DkD7h6S4o22wSESNvwHcmOcm5lbZE8ZOS 80Fbu/5K5rNRCIi/3ItlQxVbjJI2ORgcYyJoyozDNW4N10B9hx7Ue7z1D JL326M7a7isKhiirh+oFJ3PEAhD4fZ1xliHP4Q+2NAgpvCcxd00ZVQ3Cj w==; X-CSE-ConnectionGUID: xfefWEZ+RZqze2qaLOZLFw== X-CSE-MsgGUID: zH+bp8SJToy0QlSpjRPkmQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13319867" X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="13319867" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 21:57:07 -0700 X-CSE-ConnectionGUID: T6MY8SfYRwK0ifOZ/jp4XQ== X-CSE-MsgGUID: A2aBLC5SSEqrUGX//ypULA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="34840002" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by orviesa010.jf.intel.com with ESMTP; 27 May 2024 21:57:05 -0700 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian , Jean-Philippe Brucker Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH 1/1] iommu: Make iommu_sva_domain_alloc() static Date: Tue, 28 May 2024 12:54:58 +0800 Message-Id: <20240528045458.81458-1-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit iommu_sva_domain_alloc() is only called in iommu-sva.c, hence make it static. On the other hand, iommu_sva_domain_alloc() should not return NULL anymore after commit <80af5a452024> ("iommu: Add ops->domain_alloc_sva()"), the removal of inline code avoids potential confusion. Fixes: 80af5a452024 ("iommu: Add ops->domain_alloc_sva()") Signed-off-by: Lu Baolu --- include/linux/iommu.h | 8 -------- drivers/iommu/iommu-sva.c | 6 ++++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 7bc8dff7cf6d..5cdd3d41b87b 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1527,8 +1527,6 @@ struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm); void iommu_sva_unbind_device(struct iommu_sva *handle); u32 iommu_sva_get_pasid(struct iommu_sva *handle); -struct iommu_domain *iommu_sva_domain_alloc(struct device *dev, - struct mm_struct *mm); #else static inline struct iommu_sva * iommu_sva_bind_device(struct device *dev, struct mm_struct *mm) @@ -1553,12 +1551,6 @@ static inline u32 mm_get_enqcmd_pasid(struct mm_struct *mm) } static inline void mm_pasid_drop(struct mm_struct *mm) {} - -static inline struct iommu_domain * -iommu_sva_domain_alloc(struct device *dev, struct mm_struct *mm) -{ - return NULL; -} #endif /* CONFIG_IOMMU_SVA */ #ifdef CONFIG_IOMMU_IOPF diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index 18a35e798b72..25e581299226 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -10,6 +10,8 @@ #include "iommu-priv.h" static DEFINE_MUTEX(iommu_sva_lock); +static struct iommu_domain *iommu_sva_domain_alloc(struct device *dev, + struct mm_struct *mm); /* Allocate a PASID for the mm within range (inclusive) */ static struct iommu_mm_data *iommu_alloc_mm_data(struct mm_struct *mm, struct device *dev) @@ -277,8 +279,8 @@ static int iommu_sva_iopf_handler(struct iopf_group *group) return 0; } -struct iommu_domain *iommu_sva_domain_alloc(struct device *dev, - struct mm_struct *mm) +static struct iommu_domain *iommu_sva_domain_alloc(struct device *dev, + struct mm_struct *mm) { const struct iommu_ops *ops = dev_iommu_ops(dev); struct iommu_domain *domain; -- 2.34.1