diff options
author | Mikhail Zaslonko <zaslonko@linux.ibm.com> | 2018-10-10 13:44:45 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-10-11 17:02:38 +0200 |
commit | 5eaf436e0e5b7ce05ef9371e82f87319bc9a5173 (patch) | |
tree | 6950b59cb976262b6f14c363b70c7834d07d5cf8 /arch | |
parent | c72251ad879056d096d39db21c08cb52e481eb2d (diff) | |
download | linux-stable-5eaf436e0e5b7ce05ef9371e82f87319bc9a5173.tar.gz linux-stable-5eaf436e0e5b7ce05ef9371e82f87319bc9a5173.tar.bz2 linux-stable-5eaf436e0e5b7ce05ef9371e82f87319bc9a5173.zip |
s390/vmalloc: fix VMALLOC_START calculation
With the introduction of the module area on top of the vmalloc area, the
calculation of VMALLOC_START in setup_memory_end() function hasn't been
adjusted. As a result we got vmalloc area 2 Gb (MODULES_LEN) smaller than
it should be and the preceding vmemmap area got extra memory instead.
The patch fixes this calculation error although there were no visible
negative effects.
Apart from that, change 'tmp' variable to 'vmemmap' in memory_end
calculation for better readability.
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/kernel/setup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 4b2039f3e2f4..a2e952b66248 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c @@ -551,7 +551,7 @@ static void __init setup_memory_end(void) MODULES_END = vmax; MODULES_VADDR = MODULES_END - MODULES_LEN; VMALLOC_END = MODULES_VADDR; - VMALLOC_START = vmax - vmalloc_size; + VMALLOC_START = VMALLOC_END - vmalloc_size; /* Split remaining virtual space between 1:1 mapping & vmemmap array */ tmp = VMALLOC_START / (PAGE_SIZE + sizeof(struct page)); @@ -563,7 +563,7 @@ static void __init setup_memory_end(void) vmemmap = (struct page *) tmp; /* Take care that memory_end is set and <= vmemmap */ - memory_end = min(memory_end ?: max_physmem_end, tmp); + memory_end = min(memory_end ?: max_physmem_end, (unsigned long)vmemmap); #ifdef CONFIG_KASAN /* fit in kasan shadow memory region between 1:1 and vmemmap */ memory_end = min(memory_end, KASAN_SHADOW_START); |