Skip to content

Commit

Permalink
mm: Change CONFIG option for mm->pasid field
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Fenghua Yu <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Tony Luck <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Reviewed-by: Lu Baolu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
fyu1 authored and suryasaimadhu committed Feb 14, 2022
1 parent 7ba5647 commit 7a853c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/mm_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7a853c2

Please sign in to comment.