From 78333d1f908a25c9565d7518966cef717279fe32 Mon Sep 17 00:00:00 2001 From: Vasily Gorbik Date: Wed, 26 Sep 2018 13:46:26 +0200 Subject: [PATCH] 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 --- arch/s390/mm/kasan_init.c | 3 +++ 1 file changed, 3 insertions(+) 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)) { -- 2.30.2