Commit 541a3e25 authored by Tina Zhang's avatar Tina Zhang Committed by Joerg Roedel
Browse files

mm: Add structure to keep sva information



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.

Reviewed-by: default avatarVasant Hegde <vasant.hegde@amd.com>
Reviewed-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Tested-by: default avatarNicolin Chen <nicolinc@nvidia.com>
Signed-off-by: default avatarTina Zhang <tina.zhang@intel.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20231027000525.1278806-5-tina.zhang@intel.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 2396046d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -812,6 +812,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);
+2 −0
Original line number Diff line number Diff line
@@ -727,6 +727,7 @@ struct mm_cid {
#endif

struct kioctx_table;
struct iommu_mm_data;
struct mm_struct {
	struct {
		/*
@@ -940,6 +941,7 @@ struct mm_struct {

#ifdef CONFIG_IOMMU_MM_DATA
		u32 pasid;
		struct iommu_mm_data *iommu_mm;
#endif
#ifdef CONFIG_KSM
		/*