No subject

Aditya Gupta adityag at linux.ibm.com
Sun Mar 8 07:01:06 AEDT 2026


maddy at linux.ibm.com, mahesh at linux.ibm.com, mpe at ellerman.id.au,
ritesh.list at gmail.com, shivangu at linux.ibm.com
Bcc: adityag at linux.ibm.com
Subject: Re: [PATCH v2 1/2] powerpc/crash: fix backup region offset update to
 eflcorehdr
Message-ID: <aayC-Ux4TXwv2zwN at li-3c92a0cc-27cf-11b2-a85c-b804d9ca68fa.ibm.com>
Reply-To:
In-Reply-To: <20260307052102.944952-2-sourabhjain at linux.ibm.com>

Minor nit in subject: s/eflcorehdr/elfcorehdr

On 26/03/07 10:50AM, Sourabh Jain wrote:
> <...snip...>
>
> --- a/arch/powerpc/kexec/file_load_64.c
> +++ b/arch/powerpc/kexec/file_load_64.c
> @@ -391,7 +391,7 @@ static void update_backup_region_phdr(struct kimage *image, Elf64_Ehdr *ehdr)
>  	unsigned int i;
>  
>  	phdr = (Elf64_Phdr *)(ehdr + 1);
> -	for (i = 0; i < ehdr->e_phnum; i++) {
> +	for (i = 0; i < ehdr->e_phnum; i++, phdr++) {
>  		if (phdr->p_paddr == BACKUP_SRC_START) {
>  			phdr->p_offset = image->arch.backup_start;
>  			kexec_dprintk("Backup region offset updated to 0x%lx\n",

Interesting catch, I see in current images compiler was just optimising
this to not even run more than 1 iteration since phdr never changed :)

With the patch, able to see the offset changing now:

	Previously, without the patch:
	(gdb) p/x *phdr
	$13 = {
	  p_type = 0x1,
	  p_flags = 0x7,
	  p_offset = 0x0,   <--- never changed
	  p_vaddr = 0xc000000000000000,
	  p_paddr = 0x0,
	  p_filesz = 0x10000,
	  p_memsz = 0x10000,
	  p_align = 0x0
	}

	With the patch, the offset gets set correctly:
	  p_type = 0x1,
	  p_flags = 0x7,
	  p_offset = 0x240b0000,
	  p_vaddr = 0xc000000000000000,
	  p_paddr = 0x0,
	  p_filesz = 0x10000,
	  p_memsz = 0x10000,
	  p_align = 0x0

Can also see the kexec print:

	[   29.377990] backup region offset updated to 0x240b0000
	[   29.446360] loaded elf core header at 0x240c0000, bufsz=0x1000 memsz=0x80000

Looks good to me, just minor nit in subject above.

Reviewed-by: Aditya Gupta <adityag at linux.ibm.com>

Thanks,
- Aditya G



More information about the Linuxppc-dev mailing list