提交 05a944e0 编写于 作者: W Wang Wensheng 提交者: Zheng Zengkai

share_pool: Add VM_SHARE_POOL flag for vm_area_struct

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: NWang Wensheng <wangwensheng4@huawei.com>
Signed-off-by: NTang Yizhou <tangyizhou@huawei.com>
Reviewed-by: Kefeng Wang<wangkefeng.wang@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 d83dcc99
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册