[email protected], [email protected], [email protected],
[email protected], [email protected]
Bcc: [email protected]
Subject: Re: [PATCH v2 1/2] powerpc/crash: fix backup region offset update to
eflcorehdr
Message-ID: <[email protected]>
Reply-To:
In-Reply-To: <[email protected]>
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 <[email protected]>
Thanks,
- Aditya G