提交 451822b6 编写于 作者: W Wang Wensheng 提交者: Zheng Zengkai

mm/sharepool: Don't check the DVPP address space range before merging

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5DS9S
CVE: NA

-------------------------------------------------

The user doesn't care about the start address of the dvpp range, what
is mattered is that the virtual space tagged DVPP located at in a 16G
range. So we can safely drop the dvpp address space as long as it's
empty during merging process.
Signed-off-by: NWang Wensheng <wangwensheng4@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 1e645d0e
......@@ -246,16 +246,23 @@ static int sp_mapping_group_setup(struct mm_struct *mm, struct sp_group *spg)
struct sp_group *local = master->local;
if (!list_empty(&spg->procs) && !(spg->flag & SPG_FLAG_NON_DVPP)) {
if (!can_mappings_merge(local->dvpp, spg->dvpp)) {
pr_info_ratelimited("address space conflict, id=%d\n", spg->id);
return -EINVAL;
}
/*
* Don't return an error when the mappings' address range conflict.
* As long as the mapping is unused, we can drop the empty mapping.
* This may change the address range for the task or group implicitly,
* give a warn for it.
*/
bool is_conflict = !can_mappings_merge(local->dvpp, spg->dvpp);
if (is_mapping_empty(local->dvpp))
if (is_mapping_empty(local->dvpp)) {
sp_mapping_merge(spg->dvpp, local->dvpp);
else if (is_mapping_empty(spg->dvpp))
if (is_conflict)
pr_warn_ratelimited("task address space conflict, spg_id=%d\n", spg->id);
} else if (is_mapping_empty(spg->dvpp)) {
sp_mapping_merge(local->dvpp, spg->dvpp);
else {
if (is_conflict)
pr_warn_ratelimited("group address space conflict, spg_id=%d\n", spg->id);
} else {
pr_info_ratelimited("Duplicate address space, id=%d\n", spg->id);
return -EINVAL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册