From: Sourabh Jain <sourabhjain@linux.ibm.com>
To: Aditya Gupta <adityag@linux.ibm.com>
Cc: hbathini@linux.ibm.com, linuxppc-dev@lists.ozlabs.org,
maddy@linux.ibm.com, mahesh@linux.ibm.com, mpe@ellerman.id.au,
ritesh.list@gmail.com, shivangu@linux.ibm.com
Subject: Re: [PATCH v2 1/2] powerpc/crash: fix backup region offset update to eflcorehdr
Date: Mon, 9 Mar 2026 18:55:29 +0530 [thread overview]
Message-ID: <b5594cc0-1747-4f6f-ae19-272f3fde1ed4@linux.ibm.com> (raw)
In-Reply-To: <aayEIBhSLxjcaDVv@li-3c92a0cc-27cf-11b2-a85c-b804d9ca68fa.ibm.com>
On 08/03/26 01:33, Aditya Gupta wrote:
> Sorry for the multiple mails, some mess up with my mail client.
>
> On 26/03/07 10:50AM, Sourabh Jain wrote:
>> <...snip...>
>>
>> arch/powerpc/kexec/file_load_64.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
> Minor nit in subject: s/eflcorehdr/elfcorehdr
I will update it in next version.
>> diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c
>> index e7ef8b2a2554..e631cf2eda2c 100644
>> --- 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@linux.ibm.com>
Thank you for the review Aditya.
- Sourabh Jain
next prev parent reply other threads:[~2026-03-09 13:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 5:20 [PATCH v2 0/2] powerpc/crash: backup region offset update to eflcorehdr Sourabh Jain
2026-03-07 5:20 ` [PATCH v2 1/2] powerpc/crash: fix " Sourabh Jain
2026-03-07 20:03 ` Aditya Gupta
2026-03-09 13:25 ` Sourabh Jain [this message]
2026-03-07 5:20 ` [PATCH v2 2/2] powerpc/crash: Update backup region offset in elfcorehdr on memory hotplug Sourabh Jain
2026-03-07 20:13 ` Aditya Gupta
2026-03-09 13:36 ` Sourabh Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b5594cc0-1747-4f6f-ae19-272f3fde1ed4@linux.ibm.com \
--to=sourabhjain@linux.ibm.com \
--cc=adityag@linux.ibm.com \
--cc=hbathini@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=ritesh.list@gmail.com \
--cc=shivangu@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox