From: Martin Schwidefsky Date: Fri, 26 Sep 2014 07:23:20 +0000 (+0200) Subject: s390/setup: correct 4-level kernel page table detection X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=242a112af62ea73ce507cbe76c2c944c23b6a1e3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git s390/setup: correct 4-level kernel page table detection Fix calculation to decide if a 4-level kernel page table is required. Git commit c972cc60c23f5a63 "s390/vmalloc: have separate modules area" added the separate module area which reduces the size of the vmalloc area but fails to take it into account for the 3 vs 4 level page table decision. Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 82bc113e8c1d..cdfc060dd319 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -452,8 +452,8 @@ static void __init setup_memory_end(void) #ifdef CONFIG_64BIT vmalloc_size = VMALLOC_END ?: (128UL << 30) - MODULES_LEN; tmp = (memory_end ?: max_physmem_end) / PAGE_SIZE; - tmp = tmp * (sizeof(struct page) + PAGE_SIZE) + vmalloc_size; - if (tmp <= (1UL << 42)) + tmp = tmp * (sizeof(struct page) + PAGE_SIZE); + if (tmp + vmalloc_size + MODULES_LEN <= (1UL << 42)) vmax = 1UL << 42; /* 3-level kernel page table */ else vmax = 1UL << 53; /* 4-level kernel page table */