Blob Blame History Raw
From: Fenghua Yu <fenghua.yu@intel.com>
Date: Mon, 7 Feb 2022 15:02:45 -0800
Subject: mm: Change CONFIG option for mm->pasid field
Git-commit: 7a853c2d5951419fdf3c1c9d2b6f5a38f6a6857d
Patch-mainline: v5.18-rc1
References: jsc#SLE-24350

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

  [ bp: Make the mm_types.h conditional a compound one to avoid s390 kabi
    breakage. ]

---
 include/linux/mm_types.h |    2 +-
 kernel/fork.c            |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -581,7 +581,7 @@ struct mm_struct {
 #endif
 		struct work_struct async_put_work;
 
-#ifdef CONFIG_IOMMU_SUPPORT
+#if defined(CONFIG_IOMMU_SUPPORT) || defined(CONFIG_IOMMU_SVA)
 		u32 pasid;
 #endif
 	} __randomize_layout;
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1008,7 +1008,7 @@ static void mm_init_owner(struct mm_stru
 
 static void mm_init_pasid(struct mm_struct *mm)
 {
-#ifdef CONFIG_IOMMU_SUPPORT
+#ifdef CONFIG_IOMMU_SVA
 	mm->pasid = INIT_PASID;
 #endif
 }