diff options
author | Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp> | 2013-03-15 19:34:30 +0900 |
---|---|---|
committer | Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp> | 2013-04-09 10:48:28 +0900 |
commit | e203095f8958cb0991916b336bb4422c4642179a (patch) | |
tree | 2d73f813a5c790431f98d01939b5c1ac6a8ae4ea /arch | |
parent | 8145e413ab1a2f240fd16df1fb74f543fed6debf (diff) |
[PATCH 4/4] Use vmap_area_list to get vmalloc_start for ppc64.
Try to get vmalloc_start value from vmap_area_list first for
newer ppc64 kernels.
Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc64.c | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/arch/ppc64.c b/arch/ppc64.c index afbaf55..c229ede 100644 --- a/arch/ppc64.c +++ b/arch/ppc64.c @@ -66,22 +66,40 @@ get_machdep_info_ppc64(void) DEBUG_MSG("kernel_start : %lx\n", info->kernel_start); /* - * For the compatibility, makedumpfile should run without the symbol - * vmlist and the offset of vm_struct.addr if they are not necessary. + * Get vmalloc_start value from either vmap_area_list or vmlist. */ - if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL) - || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) { + if ((SYMBOL(vmap_area_list) != NOT_FOUND_SYMBOL) + && (OFFSET(vmap_area.va_start) != NOT_FOUND_STRUCTURE) + && (OFFSET(vmap_area.list) != NOT_FOUND_STRUCTURE)) { + if (!readmem(VADDR, SYMBOL(vmap_area_list) + OFFSET(list_head.next), + &vmap_area_list, sizeof(vmap_area_list))) { + ERRMSG("Can't get vmap_area_list.\n"); + return FALSE; + } + if (!readmem(VADDR, vmap_area_list - OFFSET(vmap_area.list) + + OFFSET(vmap_area.va_start), &vmalloc_start, + sizeof(vmalloc_start))) { + ERRMSG("Can't get vmalloc_start.\n"); + return FALSE; + } + } else if ((SYMBOL(vmlist) != NOT_FOUND_SYMBOL) + && (OFFSET(vm_struct.addr) != NOT_FOUND_STRUCTURE)) { + if (!readmem(VADDR, SYMBOL(vmlist), &vmlist, sizeof(vmlist))) { + ERRMSG("Can't get vmlist.\n"); + return FALSE; + } + if (!readmem(VADDR, vmlist + OFFSET(vm_struct.addr), &vmalloc_start, + sizeof(vmalloc_start))) { + ERRMSG("Can't get vmalloc_start.\n"); + return FALSE; + } + } else { + /* + * For the compatibility, makedumpfile should run without the symbol + * vmlist and the offset of vm_struct.addr if they are not necessary. + */ return TRUE; } - if (!readmem(VADDR, SYMBOL(vmlist), &vmlist, sizeof(vmlist))) { - ERRMSG("Can't get vmlist.\n"); - return FALSE; - } - if (!readmem(VADDR, vmlist + OFFSET(vm_struct.addr), &vmalloc_start, - sizeof(vmalloc_start))) { - ERRMSG("Can't get vmalloc_start.\n"); - return FALSE; - } info->vmalloc_start = vmalloc_start; DEBUG_MSG("vmalloc_start: %lx\n", vmalloc_start); |