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>
This commit is contained in:
parent
12e55fa194
commit
78333d1f90
1 changed files with 3 additions and 0 deletions
|
@ -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)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue