diff options
author | Ingo Molnar <mingo@kernel.org> | 2022-03-15 14:50:49 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2022-03-15 14:50:59 +0300 |
commit | 8c490b42fe91c10d5756efe56014240c669e7720 (patch) | |
tree | 305c483f5d51cf9866ab4c75282da89d333247c1 /include/linux/sched | |
parent | aaeed6ecc1253ce1463fa1aca0b70a4ccbc9fa75 (diff) | |
parent | 83aa52ffed5d35a08e24452d0471e1684075cdf8 (diff) | |
download | linux-8c490b42fe91c10d5756efe56014240c669e7720.tar.xz |
Merge branch 'x86/pasid' into x86/core, to resolve conflicts
Conflicts:
tools/objtool/arch/x86/decode.c
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched')
-rw-r--r-- | include/linux/sched/mm.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index aa5f09ca5bcf..a80356e9dc69 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -8,6 +8,7 @@ #include <linux/mm_types.h> #include <linux/gfp.h> #include <linux/sync_core.h> +#include <linux/ioasid.h> /* * Routines for handling mm_structs @@ -433,4 +434,29 @@ static inline void membarrier_update_current_mm(struct mm_struct *next_mm) } #endif +#ifdef CONFIG_IOMMU_SVA +static inline void mm_pasid_init(struct mm_struct *mm) +{ + mm->pasid = INVALID_IOASID; +} + +/* Associate a PASID with an mm_struct: */ +static inline void mm_pasid_set(struct mm_struct *mm, u32 pasid) +{ + mm->pasid = pasid; +} + +static inline void mm_pasid_drop(struct mm_struct *mm) +{ + if (pasid_valid(mm->pasid)) { + ioasid_free(mm->pasid); + mm->pasid = INVALID_IOASID; + } +} +#else +static inline void mm_pasid_init(struct mm_struct *mm) {} +static inline void mm_pasid_set(struct mm_struct *mm, u32 pasid) {} +static inline void mm_pasid_drop(struct mm_struct *mm) {} +#endif + #endif /* _LINUX_SCHED_MM_H */ |