mm: Change CONFIG option for mm->pasid field
authorFenghua Yu <fenghua.yu@intel.com>
Mon, 7 Feb 2022 23:02:45 +0000 (15:02 -0800)
committerBorislav Petkov <bp@suse.de>
Mon, 14 Feb 2022 18:23:50 +0000 (19:23 +0100)
This currently depends on CONFIG_IOMMU_SUPPORT. But it is only
needed when CONFIG_IOMMU_SVA option is enabled.

Change the CONFIG guards around definition and initialization
of mm->pasid field.

Suggested-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20220207230254.3342514-3-fenghua.yu@intel.com
include/linux/mm_types.h
kernel/fork.c

index 5140e5feb486613cdf42df80b4403c68480db8c6..c5cbfd7915adbd885d3dbc1d962f0ac1fe327344 100644 (file)
@@ -631,7 +631,7 @@ struct mm_struct {
 #endif
                struct work_struct async_put_work;
 
-#ifdef CONFIG_IOMMU_SUPPORT
+#ifdef CONFIG_IOMMU_SVA
                u32 pasid;
 #endif
        } __randomize_layout;
index d75a528f7b2196675c35a4c3ea8484eff88bddd2..6ee7551d3bd253c6a2e78d1a22274bc0948b6e52 100644 (file)
@@ -1021,7 +1021,7 @@ static void mm_init_owner(struct mm_struct *mm, struct task_struct *p)
 
 static void mm_init_pasid(struct mm_struct *mm)
 {
-#ifdef CONFIG_IOMMU_SUPPORT
+#ifdef CONFIG_IOMMU_SVA
        mm->pasid = INIT_PASID;
 #endif
 }