From: Vasily Gorbik Date: Wed, 26 Sep 2018 11:46:26 +0000 (+0200) Subject: s390/kasan: add support for mem= kernel parameter X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=78333d1f908a25c9565d7518966cef717279fe32;p=openwrt%2Fstaging%2Fblogic.git s390/kasan: add support for mem= kernel parameter Handle mem= kernel parameter in kasan to limit physical memory. Reviewed-by: Martin Schwidefsky Signed-off-by: Vasily Gorbik Signed-off-by: Martin Schwidefsky --- 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)) {