Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) (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 BBA8619B for ; Tue, 5 Sep 2023 00:10:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693872604; x=1725408604; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=69SRzUQvDZdG00nzwrRDO1edksKrqqQn3DhViP1IvTM=; b=Ar5uB7+kKeHOlniMdRqJegTFGV2Ydq0FY7Fjet4X0SMJH9Xb2iehZg6i 9NPriKCM7s56vc8Y9qPViquFFFV0U6UVAclnWvg/K3K1EfenQBnB9+Zsl 5ec3VsXW91eifETSOsCkWoEbcTWMNc746EPIIEU7JAGjX1LQkf43CPVYZ NGg/IRDHnyx7NO53/3BudqNKAIdkXeu1gDM61DSiIfbKXcCoDJuolbJza xT1Qd53Ejc9VG+jnwy/QZ1wybrzqxm/DLrsuzWCXU8KszIoPPFjOnRqZE iFuSEjEua4emMEYf+uEiH3Y3ArywxXzBdVIQK718f6M2GN2fbuiZa7CX7 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10823"; a="463039976" X-IronPort-AV: E=Sophos;i="6.02,227,1688454000"; d="scan'208";a="463039976" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2023 17:10:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10823"; a="884125137" X-IronPort-AV: E=Sophos;i="6.02,227,1688454000"; d="scan'208";a="884125137" Received: from kechen-optiplex-9020.bj.intel.com ([10.238.157.62]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2023 17:09:55 -0700 From: Tina Zhang To: Jason Gunthorpe , Kevin Tian , Lu Baolu Cc: Michael Shavit , Vasant Hegde , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Tina Zhang Subject: [PATCH v3 4/6] mm: Add structure to keep sva information Date: Tue, 5 Sep 2023 08:09:28 +0800 Message-Id: <20230905000930.24515-5-tina.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230905000930.24515-1-tina.zhang@intel.com> References: <20230905000930.24515-1-tina.zhang@intel.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Introduce iommu_mm_data structure to keep sva information (pasid and the related sva domains). Add iommu_mm pointer, pointing to an instance of iommu_mm_data structure, to mm. Signed-off-by: Tina Zhang --- include/linux/iommu.h | 5 +++++ include/linux/mm_types.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index ab8784dfdbd9..937f3abc26f2 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -670,6 +670,11 @@ struct iommu_sva { struct iommu_domain *domain; }; +struct iommu_mm_data { + u32 pasid; + struct list_head sva_domains; +}; + int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode, const struct iommu_ops *ops); void iommu_fwspec_free(struct device *dev); diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 7d30dc4ff0ff..b486f521afee 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -595,6 +595,7 @@ struct mm_cid { #endif struct kioctx_table; +struct iommu_mm_data; struct mm_struct { struct { /* @@ -808,6 +809,7 @@ struct mm_struct { #ifdef CONFIG_IOMMU_SVA u32 pasid; + struct iommu_mm_data *iommu_mm; #endif #ifdef CONFIG_KSM /* -- 2.17.1