summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2018-09-26 13:46:26 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-10-09 11:21:35 +0200
commit78333d1f908a25c9565d7518966cef717279fe32 (patch)
tree7b1fc4746a7c9dbbd72aa4579e7009b3d5129fe4
parent12e55fa1944d2f2f15c580a94eda80cb7623f89d (diff)
downloadlinux-78333d1f908a25c9565d7518966cef717279fe32.tar.bz2
s390/kasan: add support for mem= kernel parameter
Handle mem= kernel parameter in kasan to limit physical memory. 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>
-rw-r--r--arch/s390/mm/kasan_init.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/s390/mm/kasan_init.c b/arch/s390/mm/kasan_init.c
index 5b253247bc97..55982142b2b5 100644
--- a/arch/s390/mm/kasan_init.c
+++ b/arch/s390/mm/kasan_init.c
@@ -268,6 +268,9 @@ void __init kasan_early_init(void)
memsize = get_mem_detect_end();
if (!memsize)
kasan_early_panic("cannot detect physical memory size\n");
+ /* respect mem= cmdline parameter */
+ if (memory_end_set && memsize > memory_end)
+ memsize = memory_end;
memsize = min(memsize, KASAN_SHADOW_START);
if (IS_ENABLED(CONFIG_KASAN_S390_4_LEVEL_PAGING)) {