提交 57457a65 编写于 作者: Y Yunfeng Ye 提交者: Yang Yingliang

arm64: mm: support setting page attributes for debugging

euleros inclusion
category: feature
feature: Memory debug feature

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

When pagealloc debug is enabled, block mappings or contiguous hints are
no longer used for linear address area. Therefore, support setting page
attributes in this case is useful for debugging memory corruption
problems.
Signed-off-by: NYunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 07189052
......@@ -87,8 +87,16 @@ static int change_memory_common(unsigned long addr, int numpages,
area = find_vm_area((void *)addr);
if (!area ||
end > (unsigned long)area->addr + area->size ||
!(area->flags & VM_ALLOC))
!(area->flags & VM_ALLOC)) {
/*
* When pagealloc debug is enabled, the linear address is
* mapped with NO_BLOCK_MAPPINGS and NO_CONT_MAPPINGS flags.
*/
if (numpages && debug_pagealloc_enabled())
return __change_memory_common(start, size,
set_mask, clear_mask);
return -EINVAL;
}
if (!numpages)
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册