On Tue, Jan 23, 2007 at 10:31:37AM -0500, Mohan Kumar M wrote:
> On Tue, Jan 23, 2007 at 08:12:33PM +0530, Sachin P. Sant wrote:
> > kexec-tools-testing git tree is currently broken for ppc64 arch.
> > cp operation on /proc/vmcore fails with error "Invalid argument".
> > 
> > The problem is because of the filesz calculation.
> > 
> > On ppc64 memory ranges in device-tree is denoted as start and size.
> > While in case of other architectures like i386 it is represented as
> > start and end. Because of this when loading the memory ranges in
> > crashdump-elf.c the filesz calculation using start and end values
> > of memory range goes for a toss.
> > 
> > phdr->p_filesz  = phdr->p_memsz = mend - mstart + 1;
> >
> 
> Sachin,
> 
> Then why we have not seen this problem earlier?
>  

Mohan,

This problem got introduced when the patch for taking common and
redundant code for creating elf (32 & 64 bit) headers was taken out of 
the arch dependent sections and placed in arch independent file 
(kexe/crashdump-elf.c).

Thanks
Maneesh

> > Because of the +1 in above statement the generated vmcore is not a
> > valid dump file.
> > 
> > There are different ways in which this problem can be fixed.
> > A. Add a ifdef in crashdump-elf.c for elf machine type.
> > if EM_PPC64 then
> >   filesz = end - start;
> > else
> >   filesz = end - start + 1;
> > fi
> > B. Change the ppc64 specific code so as to follow the i386 convention
> > when it comes to representing memory ranges.
> > C. Create a PPC64 specific function to populate crash ranges and not
> > use the generic function from crashdump-elf.c
> > 
> > Of all these solutions B is the smallest and works well. Here is a patch
> > to implement the same.
> > 
> > Signed-off-by : Sachin Sant <[EMAIL PROTECTED]>
> > ---
> > 
> > Thanks
> > -Sachin
> > 
> 
> 
> > _______________________________________________
> > fastboot mailing list
> > [email protected]
> > https://lists.osdl.org/mailman/listinfo/fastboot
> 
> _______________________________________________
> fastboot mailing list
> [email protected]
> https://lists.osdl.org/mailman/listinfo/fastboot
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to