]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
s390/kasan: add kdump support
authorVasily Gorbik <gor@linux.ibm.com>
Tue, 20 Aug 2019 17:45:47 +0000 (19:45 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 29 Aug 2019 13:34:58 +0000 (15:34 +0200)
If kasan enabled kernel is used as crash kernel it crashes itself with
program check loop during kdump execution. The reason for that is that
kasan shadow memory backed by pages beyond OLDMEM_SIZE. Make kasan memory
allocator respect physical memory limit imposed by kdump.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/mm/kasan_init.c

index 4a61bc95538827f94d9de6f63de8f570e5b1d3d9..460f2557294021f0f7bd49e1f31bcfbaed007f31 100644 (file)
@@ -261,6 +261,8 @@ void __init kasan_early_init(void)
        /* respect mem= cmdline parameter */
        if (memory_end_set && memsize > memory_end)
                memsize = memory_end;
+       if (IS_ENABLED(CONFIG_CRASH_DUMP) && OLDMEM_BASE)
+               memsize = min(memsize, OLDMEM_SIZE);
        memsize = min(memsize, KASAN_SHADOW_START);
 
        if (IS_ENABLED(CONFIG_KASAN_S390_4_LEVEL_PAGING)) {