[PATCH v2]arm64:move elfcorehdr reservation early for crash dump kernel

Poonam Aggrwal poonam.aggrwal at nxp.com
Fri Jan 17 20:31:13 PST 2020


Hello Akashi

Can you please help review.

Regards
Poonam
> -----Original Message-----
> From: Poonam Aggrwal <poonam.aggrwal at nxp.com>
> Sent: Monday, December 30, 2019 2:01 PM
> To: takahiro.akashi at linaro.org; linux-arm-kernel at lists.infradead.org
> Cc: Nikhil Gupta <nikhil.gupta at nxp.com>; Poonam Aggrwal
> <poonam.aggrwal at nxp.com>
> Subject: [PATCH v2]arm64:move elfcorehdr reservation early for crash dump
> kernel
> 
> on some SOCs, elfcorehdr address may overlap with the address of reserved
> memory allocated using early_init_fdt_scan_reserved_mem
> 
> Reviewed-by: Prabhakar Kushwaha <pkushwaha at marvell.com>
> Signed-off-by: Poonam Aggrwal <poonam.aggrwal at nxp.com>
> ---
> Overlaps seen on LS1043A SoC:
> [    0.000000] Reserved memory: created DMA memory pool at
> 0x00000000f7c00000, size 4 MiB
> [    0.000000] OF: reserved mem: initialized node qman-fqd, compatible id
> shared-dma-pool
> [    0.000000] Reserved memory: created DMA memory pool at
> 0x00000000f4000000, size 32 MiB
> [    0.000000] OF: reserved mem: initialized node qman-pfdr, compatible id
> shared-dma-pool
> [    0.000000] Reserved memory: created DMA memory pool at
> 0x00000000f6000000, size 16 MiB
> [    0.000000] OF: reserved mem: initialized node bman-fbpr, compatible id
> shared-dma-pool
> [    0.000000] Reserving 1KB of memory at 0xf7fff000 for elfcorehdr
> 
> panic in elfcorehdr_read:
> [    0.443984] Unable to handle kernel paging request at virtual address
> ffff000037fff000
> [    0.451942] Mem abort info:
> [    0.454740]   ESR = 0x96000006
> [    0.457806]   EC = 0x25: DABT (current EL), IL = 32 bits
> [    0.463142]   SET = 0, FnV = 0
> [    0.466202]   EA = 0, S1PTW = 0
> [    0.469353] Data abort info:
> [    0.472243]   ISV = 0, ISS = 0x00000006
> [    0.476094]   CM = 0, WnR = 0
> [    0.479072] swapper pgtable: 4k pages, 48-bit VAs,
> pgdp=00000000d9373000
> [    0.485806] [ffff000037fff000] pgd=00000000f7bf7003,
> pud=00000000f7bf6003, pmd=0000000000000000
> [    0.494553] Internal error: Oops: 96000006 [#1] PREEMPT SMP
> [    0.500146] Modules linked in:
> [    0.503211] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc3-00062-
> gbf8d1cd #5
> [    0.510725] Hardware name: LS1043A RDB Board (DT)
> [    0.515446] pstate: 80000005 (Nzcv daif -PAN -UAO)
> [    0.520260] pc : __memcpy+0x78/0x180
> [    0.523847] lr : elfcorehdr_read+0x28/0x38
> <snip>
> [    0.611262] Call trace:
> [    0.613713]  __memcpy+0x78/0x180
> [    0.616950]  vmcore_init+0x70/0x534
>  arch/arm64/mm/init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index
> b65dffd..e610180 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -438,6 +438,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_DMA)) {
> @@ -452,8 +454,6 @@ void __init arm64_memblock_init(void)
> 
>  	reserve_crashkernel();
> 
> -	reserve_elfcorehdr();
> -
>  	high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
> 
>  	dma_contiguous_reserve(arm64_dma32_phys_limit);
> --
> 2.7.4




More information about the linux-arm-kernel mailing list