Skip to content

Commit 541a3e2

Browse files
TinaZhangZWjoergroedel
authored andcommitted
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: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Tina Zhang <tina.zhang@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20231027000525.1278806-5-tina.zhang@intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 2396046 commit 541a3e2

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

include/linux/iommu.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,11 @@ struct iommu_sva {
812812
struct iommu_domain *domain;
813813
};
814814

815+
struct iommu_mm_data {
816+
u32 pasid;
817+
struct list_head sva_domains;
818+
};
819+
815820
int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode,
816821
const struct iommu_ops *ops);
817822
void iommu_fwspec_free(struct device *dev);

include/linux/mm_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ struct mm_cid {
727727
#endif
728728

729729
struct kioctx_table;
730+
struct iommu_mm_data;
730731
struct mm_struct {
731732
struct {
732733
/*
@@ -940,6 +941,7 @@ struct mm_struct {
940941

941942
#ifdef CONFIG_IOMMU_MM_DATA
942943
u32 pasid;
944+
struct iommu_mm_data *iommu_mm;
943945
#endif
944946
#ifdef CONFIG_KSM
945947
/*

0 commit comments

Comments
 (0)