[RFC,4/6] mm: Add iommu_mm field to mm_struct
Commit Message
The iommu_mm field has all the information needed for managing sva domain
1:1 with mm pasid. Add it to the mm_struct as the sva-related field and
use default_iommu_mm to initialize init_mm pasid.
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
---
include/linux/mm_types.h | 2 ++
mm/init-mm.c | 1 +
2 files changed, 3 insertions(+)
@@ -581,6 +581,7 @@ struct mm_cid {
#endif
struct kioctx_table;
+struct iommu_mm_data;
struct mm_struct {
struct {
struct maple_tree mm_mt;
@@ -773,6 +774,7 @@ struct mm_struct {
#ifdef CONFIG_IOMMU_SVA
u32 pasid;
+ struct iommu_mm_data *iommu_mm;
#endif
#ifdef CONFIG_KSM
/*
@@ -44,6 +44,7 @@ struct mm_struct init_mm = {
.cpu_bitmap = CPU_BITS_NONE,
#ifdef CONFIG_IOMMU_SVA
.pasid = IOMMU_PASID_INVALID,
+ .iommu_mm = &default_iommu_mm,
#endif
INIT_MM_CONTEXT(init_mm)
};