crash is unable to read a vmcore from the 2.6.21 kernel (SGI Altix IA64);
it fails as follows:

# ./crash-4.0-3.21 vmlinux vmcore

crash-4.0-3.21: read error: kernel virtual address: a0000001005dc6c8  type: 
"kernel_config_data"
WARNING: cannot read kernel_config_data
crash-4.0-3.21: read error: kernel virtual address: a000000100d39480  type: 
"xtime"

The read error occurs with the following stack trace because paddr (0x4d39480)
is incorrect:

#0  read_netdump (fd=-1, bufptr=0x60000000000738f0, cnt=16, 
addr=11529215050377303168, paddr=80974976) at netdump.c:337
#1  0x4000000000286720 in read_kdump (fd=-1, bufptr=0x60000000000738f0, cnt=16, 
addr=11529215050377303168, paddr=80974976) at netdump.c:1993
#2  0x4000000000098b00 in readmem (addr=11529215050377303168, memtype=1, 
buffer=0x60000000000738f0, size=16, type=0x4000000000719ac8 "xtime", 
error_handle=1) at memory.c:1634
#3  0x4000000000210510 in get_symbol_data (symbol=0x4000000000719ac8 "xtime", 
size=16, local=0x60000000000738f0) at symbols.c:3473
#4  0x4000000000162f90 in kernel_init () at kernel.c:123
#5  0x400000000005b340 in main_loop () at main.c:434

paddr is calculated incorrectly in the ia64_VTOP() KERNEL_VMALLOC_REGION
section because ms->phys_start is wrong.

ms->phys_start is determined in ia64_calc_phys_start() where it is set to
DEFAULT_PHYS_START because none of the PT_LOAD program headers read from the
vmcore file have a virtual address matching that of the kernel code region
(0xa000000100000000).

Looking at the Elf64_Phdr structures read, the first header has p_vaddr set to
0x9fffffd0ec000000 when it should be 0xa000000100000000.

                    ----------------------------------------

In kexec-tools-1.101/kexec/arch/ia64/crashdump-ia64.c,
prepare_crash_memory_elf64_headers() has the following:

  p_vaddr = mstart + LOAD_OFFSET

where

  LOAD_OFFSET = 0xa000000000000000UL + 0x100000000UL - kernel_code_start

and mstart <= kernel_code_start, with kernel_code_start assigned to the
physical address of the kernel code region as read from /proc/iomem.

                    ----------------------------------------

However, in kexec-tools-testing/kexec/arch/ia64/crashdump-ia64.c where
load_crashdump_segments() calls crash_create_elf64_headers(), p_vaddr is simply
set to LOAD_OFFSET.

I made the following change to kexec-tools-testing/kexec/crashdump-elf.c to get
past the read error:

161c161,168
<               phdr->p_vaddr   = info->kern_vaddr_start;
---
>               for (i = 0; i < ranges; i++) {
>                   unsigned long long mstart = range[i].start;
>                   unsigned long long mend = range[i].end;
>                   if (!mstart && !mend)
>                       continue;
>                   if (info->kern_paddr_start >= mstart &&
>                   info->kern_paddr_start < mend)
>                       phdr->p_vaddr = mstart + info->kern_vaddr_start;
>               }

Does this look right?

Jonathan Lim

P.S. The kexec-tools-1.101 I referenced has the following in Makefile:

  VERSION=1.101
  DATE=15 February 2005

and includes kexec-tools-1.101-ia64-kdump.patch, whereas kexec-tools-testing
has the following:

  VERSION=20070319-rc
  DATE=19th March 2007
_______________________________________________
fastboot mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/fastboot

Reply via email to