From 5dff03813f46f267bc1ecb334901e916346692ff Mon Sep 17 00:00:00 2001 From: Vasily Gorbik Date: Sun, 19 Nov 2017 11:54:14 +0100 Subject: 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 Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/setup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/s390/kernel/setup.c') diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index d7548806d887..4b2039f3e2f4 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -535,7 +535,9 @@ static void __init setup_memory_end(void) /* Choose kernel address space layout: 3 or 4 levels. */ vmalloc_size = VMALLOC_END ?: (128UL << 30) - MODULES_LEN; if (IS_ENABLED(CONFIG_KASAN)) { - vmax = _REGION2_SIZE; /* 3-level kernel page table */ + vmax = IS_ENABLED(CONFIG_KASAN_S390_4_LEVEL_PAGING) + ? _REGION1_SIZE + : _REGION2_SIZE; } else { tmp = (memory_end ?: max_physmem_end) / PAGE_SIZE; tmp = tmp * (sizeof(struct page) + PAGE_SIZE); -- cgit v1.2.3