Commit 78333d1f authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Martin Schwidefsky

s390/kasan: add support for mem= kernel parameter

Handle mem= kernel parameter in kasan to limit physical memory.
Reviewed-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 12e55fa1
...@@ -268,6 +268,9 @@ void __init kasan_early_init(void) ...@@ -268,6 +268,9 @@ void __init kasan_early_init(void)
memsize = get_mem_detect_end(); memsize = get_mem_detect_end();
if (!memsize) if (!memsize)
kasan_early_panic("cannot detect physical memory size\n"); 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); memsize = min(memsize, KASAN_SHADOW_START);
if (IS_ENABLED(CONFIG_KASAN_S390_4_LEVEL_PAGING)) { if (IS_ENABLED(CONFIG_KASAN_S390_4_LEVEL_PAGING)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment