LF-3296-1 arm64:move elfcorehdr reservation early for crash dump kernel
authorNikhil Gupta <nikhil.gupta@nxp.com>
Tue, 9 Mar 2021 04:07:46 +0000 (09:37 +0530)
committerXiaobo Xie <xiaobo.xie@nxp.com>
Mon, 7 Jun 2021 04:10:25 +0000 (06:10 +0200)
elfcorehdr_addr is fixed address passed to 2nd kernel which may be conflicted
with potential reserved memory in 2nd kernel,so reserve_elfcorehdr() ahead of
early_init_fdt_scan_reserved_mem() can relieve this situation.

Signed-off-by: Nikhil Gupta <nikhil.gupta@nxp.com>
Signed-off-by: Poonam Aggrwal <poonam.aggrwal@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Reviewed-by: Aisheng Dong <aisheng.dong@nxp.com>
arch/arm64/mm/init.c

index f1758fc..32ad659 100644 (file)
@@ -398,6 +398,8 @@ void __init arm64_memblock_init(void)
                initrd_end = initrd_start + phys_initrd_size;
        }
 
+       reserve_elfcorehdr();
+
        early_init_fdt_scan_reserved_mem();
 
        if (IS_ENABLED(CONFIG_ZONE_DMA32))
@@ -405,8 +407,6 @@ void __init arm64_memblock_init(void)
        else
                arm64_dma32_phys_limit = PHYS_MASK + 1;
 
-       reserve_elfcorehdr();
-
        high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
 
        dma_contiguous_reserve(arm64_dma32_phys_limit);