makedumpfile: s390x: Obtain the vmalloc_start value from high_memory for s390x arch.
Subsystems (2)
PATCH 1/1 makedumpfile: s390x: Obtain the vmalloc_start value from high_memory for s390x arch.
From: Mahesh Salgaonkar <[email protected]>
Currently the vmalloc_start address for s390x is obtained by using vmlist.addr symbol, which is not correct. The correct vmalloc_start address can be obtained using 'high_memory' symbol. Even crash utility is depend on high_memory symbol to get vmalloc_start address for s390x arch.
Without this patch makedumpfile fails to translate some virtual addresses to to physical addresses on s390x.
[root@h4245043 makedumpfile]# ./makedumpfile -d 16 -x /root/dump.makedumpfile_problem/vmlinux /root/dump.makedumpfile_problem/vmcore /tmp/out.dump The kernel version is not supported.
The created dumpfile may be incomplete.
Checking for memory holes : [100 %] readmem: Can't convert a physical address(3d2805c1830) to offset.
readmem: type_addr: 0, addr:3d2805c1830, size:8reset_bitmap_of_free_pages: Can't get prev list_head.
makedumpfile Failed.
[root@h4245043 makedumpfile]#
--- arch/s390x.c | 19 ++++++------------- makedumpfile.c | 3 +++ makedumpfile.h | 5 +++++ 3 files changed, 14 insertions(+), 13 deletions(-)
arch/s390x.c +6 -13
@@ -62,7 +62,7 @@int get_machdep_info_s390x (void ) { -unsigned long vmlist, vmalloc_start; +unsigned long vmalloc_start;char *term_str =getenv ("TERM" );if (term_str &&strcmp (term_str,"dumb" ) ==0 )
@@ -81,19 +81,13 @@ get_machdep_info_s390x(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. +* Obtain the vmalloc_start address from high_memory symbol. */ -if ((SYMBOL (vmlist) ==NOT_FOUND_SYMBOL ) - || (OFFSET (vm_struct.addr) ==NOT_FOUND_STRUCTURE )) { +if (SYMBOL (high_memory) ==NOT_FOUND_SYMBOL ) {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))) { +if (!readmem (VADDR ,SYMBOL (high_memory), &vmalloc_start, +sizeof (vmalloc_start))) {ERRMSG ("Can't get vmalloc_start.\n" );return FALSE; }
@@ -265,8 +259,7 @@ vaddr_to_paddr_s390x(unsigned long vaddr)if (paddr !=NOT_PADDR )return paddr; -if ((SYMBOL (vmlist) ==NOT_FOUND_SYMBOL ) - || (OFFSET (vm_struct.addr) ==NOT_FOUND_STRUCTURE )) { +if (SYMBOL (high_memory) ==NOT_FOUND_SYMBOL ) {ERRMSG ("Can't get necessary information for vmalloc " "translation.\n" );return NOT_PADDR ;
makedumpfile.c +3 -0
@@ -797,6 +797,7 @@ get_symbol_info(void)SYMBOL_INIT (log_end,"log_end" );SYMBOL_INIT (max_pfn,"max_pfn" );SYMBOL_INIT (modules,"modules" ); +SYMBOL_INIT (high_memory,"high_memory" );if (SYMBOL (node_data) !=NOT_FOUND_SYMBOL )SYMBOL_ARRAY_TYPE_INIT (node_data,"node_data" );
@@ -1108,6 +1109,7 @@ generate_vmcoreinfo(void)WRITE_SYMBOL ("log_buf_len" , log_buf_len);WRITE_SYMBOL ("log_end" , log_end);WRITE_SYMBOL ("max_pfn" , max_pfn); +WRITE_SYMBOL ("high_memory" , high_memory);/* * write the structure size of 1st kernel
@@ -1366,6 +1368,7 @@ read_vmcoreinfo(void)READ_SYMBOL ("log_buf_len" , log_buf_len);READ_SYMBOL ("log_end" , log_end);READ_SYMBOL ("max_pfn" , max_pfn); +READ_SYMBOL ("high_memory" , high_memory);READ_STRUCTURE_SIZE ("page" , page);READ_STRUCTURE_SIZE ("mem_section" , mem_section);
makedumpfile.h +5 -0
@@ -974,6 +974,11 @@ struct symbol_table {*/ unsigned long long modules; + +/* +* vmalloc_start address on s390x arch +*/ +unsigned long long high_memory; };struct size_table {
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Re: [PATCH] makedumpfile: s390x: Obtain the vmalloc_start value fromhigh_memory for s390x arch.
Hi Mahesh,
Thank you for the patch.
I will check and merge it into the next makedumpfile.
Thanks
tachibana
Quoted 11 lines · Mahesh J Salgaonkar
From: Mahesh Salgaonkar <[email protected]>
Currently the
vmalloc_startaddress for s390x is obtained by using vmlist.addr symbol, which is not correct. The correctvmalloc_startaddress can be obtained using 'high_memory' symbol. Even crash utility is depend onhigh_memorysymbol to getvmalloc_startaddress for s390x arch.Without this patch makedumpfile fails to translate some virtual addresses to to physical addresses on s390x.
[root@h4245043 makedumpfile]# ./makedumpfile -d 16 -x
/root/dump.makedumpfile_problem/vmlinux/root/dump.makedumpfile_
problem/vmcore /tmp/out.dump
Quoted 98 lines
The kernel version is not supported.
The created dumpfile may be incomplete.
Checking for memory holes : [100 %] readmem: Can't convert a physical address(3d2805c1830) to offset.
readmem:type_addr: 0, addr:3d2805c1830, size:8reset_bitmap_of_free_pages: Can't get prevlist_head.makedumpfile Failed.
[root@h4245043 makedumpfile]#Signed-off-by Mahesh Salgaonkar <[email protected]>--- arch/s390x.c | 19 ++++++------------- makedumpfile.c | 3 +++ makedumpfile.h | 5 +++++ 3 files changed, 14 insertions(+), 13 deletions(-)arch/s390x.c +6
-13@@ -62,7 +62,7 @@int get_machdep_info_s390x (void ) { -unsigned long vmlist, vmalloc_start; +unsigned long vmalloc_start;char *term_str =getenv ("TERM" );if (term_str &&strcmp (term_str,"dumb" ) ==0 )@@ -81,19 +81,13 @@ get_machdep_info_s390x(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. +* Obtain the vmalloc_start address from high_memory symbol. */ -if ((SYMBOL (vmlist) ==NOT_FOUND_SYMBOL ) - || (OFFSET (vm_struct.addr) ==NOT_FOUND_STRUCTURE )) { +if (SYMBOL (high_memory) ==NOT_FOUND_SYMBOL ) {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))) { +if (!readmem (VADDR ,SYMBOL (high_memory), &vmalloc_start, +sizeof (vmalloc_start))) {ERRMSG ("Can't get vmalloc_start.\n" );return FALSE; }@@ -265,8 +259,7 @@ vaddr_to_paddr_s390x(unsigned long vaddr)if (paddr !=NOT_PADDR )return paddr; -if ((SYMBOL (vmlist) ==NOT_FOUND_SYMBOL ) - || (OFFSET (vm_struct.addr) ==NOT_FOUND_STRUCTURE )) { +if (SYMBOL (high_memory) ==NOT_FOUND_SYMBOL ) {ERRMSG ("Can't get necessary information for vmalloc " "translation.\n" );return NOT_PADDR ;makedumpfile.c +3
-0@@ -797,6 +797,7 @@ get_symbol_info(void)SYMBOL_INIT (log_end,"log_end" );SYMBOL_INIT (max_pfn,"max_pfn" );SYMBOL_INIT (modules,"modules" ); +SYMBOL_INIT (high_memory,"high_memory" );if (SYMBOL (node_data) !=NOT_FOUND_SYMBOL )SYMBOL_ARRAY_TYPE_INIT (node_data,"node_data" );@@ -1108,6 +1109,7 @@ generate_vmcoreinfo(void)WRITE_SYMBOL ("log_buf_len" , log_buf_len);WRITE_SYMBOL ("log_end" , log_end);WRITE_SYMBOL ("max_pfn" , max_pfn); +WRITE_SYMBOL ("high_memory" , high_memory);/* * write the structure size of 1st kernel @@ -1366,6 +1368,7 @@ read_vmcoreinfo(void)READ_SYMBOL ("log_buf_len" , log_buf_len);READ_SYMBOL ("log_end" , log_end);READ_SYMBOL ("max_pfn" , max_pfn); +READ_SYMBOL ("high_memory" , high_memory);READ_STRUCTURE_SIZE ("page" , page);READ_STRUCTURE_SIZE ("mem_section" , mem_section);makedumpfile.h +0
-0@@ -974,6 +974,11 @@ struct symbol_table {*/
makedumpfile.h struct symbol_table { · line 984
Quoted 10 lines
makedumpfile.h +5
-0unsigned long long modules; + +/* +* vmalloc_start address on s390x arch +*/ +unsigned long long high_memory; };struct size_table {
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec