From: Wang Wensheng wangwensheng4@huawei.com
ascend inclusion category: Feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4NDAW CVE: NA
-------------------
This flag specify that the vm_area_struct is related to share_pool (in detail, has a spa corresponding to it).
Signed-off-by: Wang Wensheng wangwensheng4@huawei.com Signed-off-by: Tang Yizhou tangyizhou@huawei.com Reviewed-by: Kefeng Wangwangkefeng.wang@huawei.com Reviewed-by: Weilong Chen chenweilong@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/linux/mm.h | 6 ++++++ include/linux/share_pool.h | 8 ++++++++ 2 files changed, 14 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h index a4996e11cda6..e2eb3ea63d6a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -378,6 +378,12 @@ extern unsigned int kobjsize(const void *objp); # define VM_MTE_ALLOWED VM_NONE #endif
+#if defined(CONFIG_ASCEND_SHARE_POOL) +# define VM_SHARE_POOL VM_HIGH_ARCH_4 +#else +# define VM_SHARE_POOL VM_NONE +#endif + #ifndef VM_GROWSUP # define VM_GROWSUP VM_NONE #endif diff --git a/include/linux/share_pool.h b/include/linux/share_pool.h index 3a56238c8a4d..c39780ab5a87 100644 --- a/include/linux/share_pool.h +++ b/include/linux/share_pool.h @@ -272,6 +272,14 @@ static inline void sp_area_work_around(struct vm_unmapped_area_info *info, info->high_limit = min(info->high_limit, MMAP_SHARE_POOL_START); }
+static inline bool sp_check_vm_share_pool(unsigned long vm_flags) +{ + if (sp_is_enabled() && (vm_flags & VM_SHARE_POOL)) + return true; + + return false; +} + #else /* CONFIG_ASCEND_SHARE_POOL */
static inline int mg_sp_group_add_task(int pid, unsigned long prot, int spg_id)