mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
riscv: add ARCH_SUPPORTS_DEBUG_PAGEALLOC support
ARCH_SUPPORTS_DEBUG_PAGEALLOC provides a hook to map and unmap pages for debugging purposes. Implement the __kernel_map_pages functions to fill the poison pattern. Signed-off-by: Zong Li <zong.li@sifive.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
parent
395a21ff85
commit
5fde3db5eb
2 changed files with 16 additions and 0 deletions
|
@ -131,6 +131,9 @@ config ARCH_SELECT_MEMORY_MODEL
|
||||||
config ARCH_WANT_GENERAL_HUGETLB
|
config ARCH_WANT_GENERAL_HUGETLB
|
||||||
def_bool y
|
def_bool y
|
||||||
|
|
||||||
|
config ARCH_SUPPORTS_DEBUG_PAGEALLOC
|
||||||
|
def_bool y
|
||||||
|
|
||||||
config SYS_SUPPORTS_HUGETLBFS
|
config SYS_SUPPORTS_HUGETLBFS
|
||||||
def_bool y
|
def_bool y
|
||||||
|
|
||||||
|
|
|
@ -172,3 +172,16 @@ int set_direct_map_default_noflush(struct page *page)
|
||||||
|
|
||||||
return walk_page_range(&init_mm, start, end, &pageattr_ops, &masks);
|
return walk_page_range(&init_mm, start, end, &pageattr_ops, &masks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __kernel_map_pages(struct page *page, int numpages, int enable)
|
||||||
|
{
|
||||||
|
if (!debug_pagealloc_enabled())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
__set_memory((unsigned long)page_address(page), numpages,
|
||||||
|
__pgprot(_PAGE_PRESENT), __pgprot(0));
|
||||||
|
else
|
||||||
|
__set_memory((unsigned long)page_address(page), numpages,
|
||||||
|
__pgprot(0), __pgprot(_PAGE_PRESENT));
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue