s390/kasan: add option for 4-level paging support
By default 3-level paging is used when the kernel is compiled with kasan support. Add 4-level paging option to support systems with more then 3TB of physical memory and to cover 4-level paging specific code with kasan as well. Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
这个提交包含在:
@@ -252,12 +252,23 @@ void __init kasan_early_init(void)
|
||||
pgt_prot &= ~_PAGE_NOEXEC;
|
||||
pte_z = __pte(__pa(kasan_zero_page) | pgt_prot);
|
||||
|
||||
/* 3 level paging */
|
||||
BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_START, PUD_SIZE));
|
||||
BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_END, PUD_SIZE));
|
||||
crst_table_init((unsigned long *)early_pg_dir, _REGION3_ENTRY_EMPTY);
|
||||
untracked_mem_end = vmax = _REGION2_SIZE;
|
||||
asce_type = _ASCE_TYPE_REGION3;
|
||||
if (IS_ENABLED(CONFIG_KASAN_S390_4_LEVEL_PAGING)) {
|
||||
/* 4 level paging */
|
||||
BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_START, P4D_SIZE));
|
||||
BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_END, P4D_SIZE));
|
||||
crst_table_init((unsigned long *)early_pg_dir,
|
||||
_REGION2_ENTRY_EMPTY);
|
||||
untracked_mem_end = vmax = _REGION1_SIZE;
|
||||
asce_type = _ASCE_TYPE_REGION2;
|
||||
} else {
|
||||
/* 3 level paging */
|
||||
BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_START, PUD_SIZE));
|
||||
BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_END, PUD_SIZE));
|
||||
crst_table_init((unsigned long *)early_pg_dir,
|
||||
_REGION3_ENTRY_EMPTY);
|
||||
untracked_mem_end = vmax = _REGION2_SIZE;
|
||||
asce_type = _ASCE_TYPE_REGION3;
|
||||
}
|
||||
|
||||
/* init kasan zero shadow */
|
||||
crst_table_init((unsigned long *)kasan_zero_p4d, p4d_val(p4d_z));
|
||||
|
在新工单中引用
屏蔽一个用户