kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo
@ 2024-02-23 19:03 Aditya Gupta
  2024-02-24  4:34 ` Sachin Sant
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Aditya Gupta @ 2024-02-23 19:03 UTC (permalink / raw)
  To: kexec; +Cc: Mahesh J Salgaonkar, Hari Bathini, Sourabh Jain, Sachin Sant

Below error was noticed when running makedumpfile on linux-next kernel
crash (linux-next tag next-20240121):

    ...
    Checking for memory holes : [100.0 %] | readpage_elf: Attempt to read non-existent page at 0xc000000000000.
    [ 17.551718] kdump.sh[404]: readmem: type_addr: 0, addr:c00c000000000000, size:16384
    [ 17.551793] kdump.sh[404]: __exclude_unnecessary_pages: Can't read the buffer of struct page.
    [ 17.551864] kdump.sh[404]: create_2nd_bitmap: Can't exclude unnecessary pages.
    [ 17.562632] kdump.sh[404]: The kernel version is not supported.
    [ 17.562708] kdump.sh[404]: The makedumpfile operation may be incomplete.
    [ 17.562773] kdump.sh[404]: makedumpfile Failed.
    [ 17.564335] kdump[406]: saving vmcore failed, _exitcode:1

Above error was due to 'vmap_area_list' and 'vmlist' symbols missing
from the vmcore.

'vmap_area_list' was removed in the linux kernel with below commit:

    commit 378eb24a0658dd922b29524e0ce35c6c43f56cba
         mm/vmalloc: remove vmap_area_list

Subsequently the commit also introduced 'VMALLOC_START' in vmcoreinfo to
get base address of vmalloc area, instead of depending on 'vmap_area_list'

Hence if 'VMALLOC_START' symbol is there in vmcoreinfo:
  1. Set vmalloc_start based on 'VMALLOC_START'
  2. Don't error if vmap_area_list/vmlist are not defined

Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
 arch/ppc64.c   | 19 +++++++++++++------
 makedumpfile.c |  3 ++-
 makedumpfile.h |  6 +++---
 3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/arch/ppc64.c b/arch/ppc64.c
index 96c357cb0335..bb62e2cd199a 100644
--- a/arch/ppc64.c
+++ b/arch/ppc64.c
@@ -568,7 +568,9 @@ get_machdep_info_ppc64(void)
 	/*
 	 * Get vmalloc_start value from either vmap_area_list or vmlist.
 	 */
-	if ((SYMBOL(vmap_area_list) != NOT_FOUND_SYMBOL)
+	if (NUMBER(vmalloc_start) != NOT_FOUND_SYMBOL) {
+		vmalloc_start = NUMBER(vmalloc_start);
+	} else 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),
@@ -684,11 +686,16 @@ vaddr_to_paddr_ppc64(unsigned long vaddr)
 	if ((SYMBOL(vmap_area_list) == NOT_FOUND_SYMBOL)
 	    || (OFFSET(vmap_area.va_start) == NOT_FOUND_STRUCTURE)
 	    || (OFFSET(vmap_area.list) == NOT_FOUND_STRUCTURE)) {
-		if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
-		    || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
-			ERRMSG("Can't get info for vmalloc translation.\n");
-			return NOT_PADDR;
-		}
+		/*
+		 * Don't depend on vmap_area_list/vmlist if vmalloc_start is set in
+		 * vmcoreinfo, in that case proceed without error
+		 */
+		if (NUMBER(vmalloc_start) == NOT_FOUND_NUMBER)
+			if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
+				|| (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
+				ERRMSG("Can't get info for vmalloc translation.\n");
+				return NOT_PADDR;
+			}
 	}
 
 	return ppc64_vtop_level4(vaddr);
diff --git a/makedumpfile.c b/makedumpfile.c
index b004b93fecb7..b6c63fad15f3 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2978,6 +2978,8 @@ read_vmcoreinfo(void)
 	READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", PAGE_OFFLINE_MAPCOUNT_VALUE);
 	READ_NUMBER("phys_base", phys_base);
 	READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE);
+
+	READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
 #ifdef __aarch64__
 	READ_NUMBER("VA_BITS", VA_BITS);
 	READ_NUMBER("TCR_EL1_T1SZ", TCR_EL1_T1SZ);
@@ -2989,7 +2991,6 @@ read_vmcoreinfo(void)
 	READ_NUMBER("VA_BITS", va_bits);
 	READ_NUMBER_UNSIGNED("phys_ram_base", phys_ram_base);
 	READ_NUMBER_UNSIGNED("PAGE_OFFSET", page_offset);
-	READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
 	READ_NUMBER_UNSIGNED("VMALLOC_END", vmalloc_end);
 	READ_NUMBER_UNSIGNED("VMEMMAP_START", vmemmap_start);
 	READ_NUMBER_UNSIGNED("VMEMMAP_END", vmemmap_end);
diff --git a/makedumpfile.h b/makedumpfile.h
index 59c83e1d9df3..4021c5af2a34 100644
--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -541,8 +541,6 @@ do { \
  * The value of dependence on machine
  */
 #define PAGE_OFFSET		(info->page_offset)
-#define VMALLOC_START		(info->vmalloc_start)
-#define VMALLOC_END		(info->vmalloc_end)
 #define VMEMMAP_START		(info->vmemmap_start)
 #define VMEMMAP_END		(info->vmemmap_end)
 #define PMASK			(0x7ffffffffffff000UL)
@@ -2262,6 +2260,9 @@ struct number_table {
 	long    HUGETLB_PAGE_DTOR;
 	long	phys_base;
 	long	KERNEL_IMAGE_SIZE;
+
+	unsigned long vmalloc_start;
+
 #ifdef __aarch64__
 	long 	VA_BITS;
 	long	TCR_EL1_T1SZ;
@@ -2272,7 +2273,6 @@ struct number_table {
 	long va_bits;
 	unsigned long phys_ram_base;
 	unsigned long page_offset;
-	unsigned long vmalloc_start;
 	unsigned long vmalloc_end;
 	unsigned long vmemmap_start;
 	unsigned long vmemmap_end;
-- 
2.43.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo
  2024-02-23 19:03 [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo Aditya Gupta
@ 2024-02-24  4:34 ` Sachin Sant
  2024-02-28  4:51 ` HAGIO KAZUHITO(萩尾 一仁)
  2024-03-18  8:26 ` Aditya Gupta
  2 siblings, 0 replies; 7+ messages in thread
From: Sachin Sant @ 2024-02-24  4:34 UTC (permalink / raw)
  To: Aditya Gupta; +Cc: kexec, Mahesh J Salgaonkar, Hari Bathini, Sourabh Jain



> On 24-Feb-2024, at 12:33 AM, Aditya Gupta <adityag@linux.ibm.com> wrote:
> 
> Below error was noticed when running makedumpfile on linux-next kernel
> crash (linux-next tag next-20240121):
> 
>    ...
>    Checking for memory holes : [100.0 %] | readpage_elf: Attempt to read non-existent page at 0xc000000000000.
>    [ 17.551718] kdump.sh[404]: readmem: type_addr: 0, addr:c00c000000000000, size:16384
>    [ 17.551793] kdump.sh[404]: __exclude_unnecessary_pages: Can't read the buffer of struct page.
>    [ 17.551864] kdump.sh[404]: create_2nd_bitmap: Can't exclude unnecessary pages.
>    [ 17.562632] kdump.sh[404]: The kernel version is not supported.
>    [ 17.562708] kdump.sh[404]: The makedumpfile operation may be incomplete.
>    [ 17.562773] kdump.sh[404]: makedumpfile Failed.
>    [ 17.564335] kdump[406]: saving vmcore failed, _exitcode:1
> 
> Above error was due to 'vmap_area_list' and 'vmlist' symbols missing
> from the vmcore.
> 
> 'vmap_area_list' was removed in the linux kernel with below commit:
> 
>    commit 378eb24a0658dd922b29524e0ce35c6c43f56cba
>         mm/vmalloc: remove vmap_area_list
> 
> Subsequently the commit also introduced 'VMALLOC_START' in vmcoreinfo to
> get base address of vmalloc area, instead of depending on 'vmap_area_list'
> 
> Hence if 'VMALLOC_START' symbol is there in vmcoreinfo:
>  1. Set vmalloc_start based on 'VMALLOC_START'
>  2. Don't error if vmap_area_list/vmlist are not defined
> 
> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
> ---

Thanks Aditya for the fix. With this fix applied makedumpfile is able to
save vmcore during kdump.

Tested-by: Sachin Sant <sachinp@linux.ibm.com>

- Sachin
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo
  2024-02-23 19:03 [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo Aditya Gupta
  2024-02-24  4:34 ` Sachin Sant
@ 2024-02-28  4:51 ` HAGIO KAZUHITO(萩尾 一仁)
  2024-02-28  9:36   ` Aditya Gupta
  2024-03-18  8:26 ` Aditya Gupta
  2 siblings, 1 reply; 7+ messages in thread
From: HAGIO KAZUHITO(萩尾 一仁) @ 2024-02-28  4:51 UTC (permalink / raw)
  To: Aditya Gupta, kexec
  Cc: Mahesh J Salgaonkar, Hari Bathini, Sourabh Jain, Sachin Sant

Hi Aditya,

thanks for the patch.

On 2024/02/24 4:03, Aditya Gupta wrote:
> Below error was noticed when running makedumpfile on linux-next kernel
> crash (linux-next tag next-20240121):
> 
>      ...
>      Checking for memory holes : [100.0 %] | readpage_elf: Attempt to read non-existent page at 0xc000000000000.
>      [ 17.551718] kdump.sh[404]: readmem: type_addr: 0, addr:c00c000000000000, size:16384
>      [ 17.551793] kdump.sh[404]: __exclude_unnecessary_pages: Can't read the buffer of struct page.
>      [ 17.551864] kdump.sh[404]: create_2nd_bitmap: Can't exclude unnecessary pages.
>      [ 17.562632] kdump.sh[404]: The kernel version is not supported.
>      [ 17.562708] kdump.sh[404]: The makedumpfile operation may be incomplete.
>      [ 17.562773] kdump.sh[404]: makedumpfile Failed.
>      [ 17.564335] kdump[406]: saving vmcore failed, _exitcode:1
> 
> Above error was due to 'vmap_area_list' and 'vmlist' symbols missing
> from the vmcore.
> 
> 'vmap_area_list' was removed in the linux kernel with below commit:
> 
>      commit 378eb24a0658dd922b29524e0ce35c6c43f56cba
>           mm/vmalloc: remove vmap_area_list
> 
> Subsequently the commit also introduced 'VMALLOC_START' in vmcoreinfo to
> get base address of vmalloc area, instead of depending on 'vmap_area_list'
> 
> Hence if 'VMALLOC_START' symbol is there in vmcoreinfo:
>    1. Set vmalloc_start based on 'VMALLOC_START'
>    2. Don't error if vmap_area_list/vmlist are not defined
> 
> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
> ---
>   arch/ppc64.c   | 19 +++++++++++++------
>   makedumpfile.c |  3 ++-
>   makedumpfile.h |  6 +++---
>   3 files changed, 18 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/ppc64.c b/arch/ppc64.c
> index 96c357cb0335..bb62e2cd199a 100644
> --- a/arch/ppc64.c
> +++ b/arch/ppc64.c
> @@ -568,7 +568,9 @@ get_machdep_info_ppc64(void)
>   	/*
>   	 * Get vmalloc_start value from either vmap_area_list or vmlist.
>   	 */
> -	if ((SYMBOL(vmap_area_list) != NOT_FOUND_SYMBOL)
> +	if (NUMBER(vmalloc_start) != NOT_FOUND_SYMBOL) {

I will fix this NOT_FOUND_SYMBOL to NOT_FOUND_NUMBER when applying, 
otherwise makedumpfile will fail for a dumpfile without the 
corresponding kernel patch, correct?

The patch looks good to me except for it.  I will apply this with the 
kernel version in the commit log after the kernel patch gets merged.

Thanks,
Kazu


> +		vmalloc_start = NUMBER(vmalloc_start);
> +	} else 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),
> @@ -684,11 +686,16 @@ vaddr_to_paddr_ppc64(unsigned long vaddr)
>   	if ((SYMBOL(vmap_area_list) == NOT_FOUND_SYMBOL)
>   	    || (OFFSET(vmap_area.va_start) == NOT_FOUND_STRUCTURE)
>   	    || (OFFSET(vmap_area.list) == NOT_FOUND_STRUCTURE)) {
> -		if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
> -		    || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
> -			ERRMSG("Can't get info for vmalloc translation.\n");
> -			return NOT_PADDR;
> -		}
> +		/*
> +		 * Don't depend on vmap_area_list/vmlist if vmalloc_start is set in
> +		 * vmcoreinfo, in that case proceed without error
> +		 */
> +		if (NUMBER(vmalloc_start) == NOT_FOUND_NUMBER)
> +			if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
> +				|| (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
> +				ERRMSG("Can't get info for vmalloc translation.\n");
> +				return NOT_PADDR;
> +			}
>   	}
>   
>   	return ppc64_vtop_level4(vaddr);
> diff --git a/makedumpfile.c b/makedumpfile.c
> index b004b93fecb7..b6c63fad15f3 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -2978,6 +2978,8 @@ read_vmcoreinfo(void)
>   	READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", PAGE_OFFLINE_MAPCOUNT_VALUE);
>   	READ_NUMBER("phys_base", phys_base);
>   	READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE);
> +
> +	READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
>   #ifdef __aarch64__
>   	READ_NUMBER("VA_BITS", VA_BITS);
>   	READ_NUMBER("TCR_EL1_T1SZ", TCR_EL1_T1SZ);
> @@ -2989,7 +2991,6 @@ read_vmcoreinfo(void)
>   	READ_NUMBER("VA_BITS", va_bits);
>   	READ_NUMBER_UNSIGNED("phys_ram_base", phys_ram_base);
>   	READ_NUMBER_UNSIGNED("PAGE_OFFSET", page_offset);
> -	READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
>   	READ_NUMBER_UNSIGNED("VMALLOC_END", vmalloc_end);
>   	READ_NUMBER_UNSIGNED("VMEMMAP_START", vmemmap_start);
>   	READ_NUMBER_UNSIGNED("VMEMMAP_END", vmemmap_end);
> diff --git a/makedumpfile.h b/makedumpfile.h
> index 59c83e1d9df3..4021c5af2a34 100644
> --- a/makedumpfile.h
> +++ b/makedumpfile.h
> @@ -541,8 +541,6 @@ do { \
>    * The value of dependence on machine
>    */
>   #define PAGE_OFFSET		(info->page_offset)
> -#define VMALLOC_START		(info->vmalloc_start)
> -#define VMALLOC_END		(info->vmalloc_end)
>   #define VMEMMAP_START		(info->vmemmap_start)
>   #define VMEMMAP_END		(info->vmemmap_end)
>   #define PMASK			(0x7ffffffffffff000UL)
> @@ -2262,6 +2260,9 @@ struct number_table {
>   	long    HUGETLB_PAGE_DTOR;
>   	long	phys_base;
>   	long	KERNEL_IMAGE_SIZE;
> +
> +	unsigned long vmalloc_start;
> +
>   #ifdef __aarch64__
>   	long 	VA_BITS;
>   	long	TCR_EL1_T1SZ;
> @@ -2272,7 +2273,6 @@ struct number_table {
>   	long va_bits;
>   	unsigned long phys_ram_base;
>   	unsigned long page_offset;
> -	unsigned long vmalloc_start;
>   	unsigned long vmalloc_end;
>   	unsigned long vmemmap_start;
>   	unsigned long vmemmap_end;
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo
  2024-02-28  4:51 ` HAGIO KAZUHITO(萩尾 一仁)
@ 2024-02-28  9:36   ` Aditya Gupta
  0 siblings, 0 replies; 7+ messages in thread
From: Aditya Gupta @ 2024-02-28  9:36 UTC (permalink / raw)
  To: HAGIO KAZUHITO(萩尾 一仁)
  Cc: kexec, Mahesh J Salgaonkar, Hari Bathini, Sourabh Jain, Sachin Sant

Hi Kazu,

On Wed, Feb 28, 2024 at 04:51:28AM +0000, HAGIO KAZUHITO(萩尾 一仁) wrote:
> Hi Aditya,
> 
> thanks for the patch.
> 
> On 2024/02/24 4:03, Aditya Gupta wrote:
> > Below error was noticed when running makedumpfile on linux-next kernel
> > crash (linux-next tag next-20240121):
> > 
> >      ...
> >      Checking for memory holes : [100.0 %] | readpage_elf: Attempt to read non-existent page at 0xc000000000000.
> >      [ 17.551718] kdump.sh[404]: readmem: type_addr: 0, addr:c00c000000000000, size:16384
> >      [ 17.551793] kdump.sh[404]: __exclude_unnecessary_pages: Can't read the buffer of struct page.
> >      [ 17.551864] kdump.sh[404]: create_2nd_bitmap: Can't exclude unnecessary pages.
> >      [ 17.562632] kdump.sh[404]: The kernel version is not supported.
> >      [ 17.562708] kdump.sh[404]: The makedumpfile operation may be incomplete.
> >      [ 17.562773] kdump.sh[404]: makedumpfile Failed.
> >      [ 17.564335] kdump[406]: saving vmcore failed, _exitcode:1
> > 
> > Above error was due to 'vmap_area_list' and 'vmlist' symbols missing
> > from the vmcore.
> > 
> > 'vmap_area_list' was removed in the linux kernel with below commit:
> > 
> >      commit 378eb24a0658dd922b29524e0ce35c6c43f56cba
> >           mm/vmalloc: remove vmap_area_list
> > 
> > Subsequently the commit also introduced 'VMALLOC_START' in vmcoreinfo to
> > get base address of vmalloc area, instead of depending on 'vmap_area_list'
> > 
> > Hence if 'VMALLOC_START' symbol is there in vmcoreinfo:
> >    1. Set vmalloc_start based on 'VMALLOC_START'
> >    2. Don't error if vmap_area_list/vmlist are not defined
> > 
> > Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> > Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
> > ---
> >   arch/ppc64.c   | 19 +++++++++++++------
> >   makedumpfile.c |  3 ++-
> >   makedumpfile.h |  6 +++---
> >   3 files changed, 18 insertions(+), 10 deletions(-)
> > 
> > diff --git a/arch/ppc64.c b/arch/ppc64.c
> > index 96c357cb0335..bb62e2cd199a 100644
> > --- a/arch/ppc64.c
> > +++ b/arch/ppc64.c
> > @@ -568,7 +568,9 @@ get_machdep_info_ppc64(void)
> >   	/*
> >   	 * Get vmalloc_start value from either vmap_area_list or vmlist.
> >   	 */
> > -	if ((SYMBOL(vmap_area_list) != NOT_FOUND_SYMBOL)
> > +	if (NUMBER(vmalloc_start) != NOT_FOUND_SYMBOL) {
> 
> I will fix this NOT_FOUND_SYMBOL to NOT_FOUND_NUMBER when applying, 
> otherwise makedumpfile will fail for a dumpfile without the 
> corresponding kernel patch, correct?
> 
> The patch looks good to me except for it.  I will apply this with the 
> kernel version in the commit log after the kernel patch gets merged.

Sure, thanks Kazu. I just ran it on an older version, it succeeds
collecting dump on 6.5.0 kernel somehow, though I agree with your
suggestion, it should have been NOT_FOUND_NUMBER. I will be more careful
about these things later.

Thanks,
Aditya Gupta

> 
> Thanks,
> Kazu
> 
> 
> > +		vmalloc_start = NUMBER(vmalloc_start);
> > +	} else 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),
> > @@ -684,11 +686,16 @@ vaddr_to_paddr_ppc64(unsigned long vaddr)
> >   	if ((SYMBOL(vmap_area_list) == NOT_FOUND_SYMBOL)
> >   	    || (OFFSET(vmap_area.va_start) == NOT_FOUND_STRUCTURE)
> >   	    || (OFFSET(vmap_area.list) == NOT_FOUND_STRUCTURE)) {
> > -		if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
> > -		    || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
> > -			ERRMSG("Can't get info for vmalloc translation.\n");
> > -			return NOT_PADDR;
> > -		}
> > +		/*
> > +		 * Don't depend on vmap_area_list/vmlist if vmalloc_start is set in
> > +		 * vmcoreinfo, in that case proceed without error
> > +		 */
> > +		if (NUMBER(vmalloc_start) == NOT_FOUND_NUMBER)
> > +			if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
> > +				|| (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
> > +				ERRMSG("Can't get info for vmalloc translation.\n");
> > +				return NOT_PADDR;
> > +			}
> >   	}
> >   
> >   	return ppc64_vtop_level4(vaddr);
> > diff --git a/makedumpfile.c b/makedumpfile.c
> > index b004b93fecb7..b6c63fad15f3 100644
> > --- a/makedumpfile.c
> > +++ b/makedumpfile.c
> > @@ -2978,6 +2978,8 @@ read_vmcoreinfo(void)
> >   	READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", PAGE_OFFLINE_MAPCOUNT_VALUE);
> >   	READ_NUMBER("phys_base", phys_base);
> >   	READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE);
> > +
> > +	READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
> >   #ifdef __aarch64__
> >   	READ_NUMBER("VA_BITS", VA_BITS);
> >   	READ_NUMBER("TCR_EL1_T1SZ", TCR_EL1_T1SZ);
> > @@ -2989,7 +2991,6 @@ read_vmcoreinfo(void)
> >   	READ_NUMBER("VA_BITS", va_bits);
> >   	READ_NUMBER_UNSIGNED("phys_ram_base", phys_ram_base);
> >   	READ_NUMBER_UNSIGNED("PAGE_OFFSET", page_offset);
> > -	READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
> >   	READ_NUMBER_UNSIGNED("VMALLOC_END", vmalloc_end);
> >   	READ_NUMBER_UNSIGNED("VMEMMAP_START", vmemmap_start);
> >   	READ_NUMBER_UNSIGNED("VMEMMAP_END", vmemmap_end);
> > diff --git a/makedumpfile.h b/makedumpfile.h
> > index 59c83e1d9df3..4021c5af2a34 100644
> > --- a/makedumpfile.h
> > +++ b/makedumpfile.h
> > @@ -541,8 +541,6 @@ do { \
> >    * The value of dependence on machine
> >    */
> >   #define PAGE_OFFSET		(info->page_offset)
> > -#define VMALLOC_START		(info->vmalloc_start)
> > -#define VMALLOC_END		(info->vmalloc_end)
> >   #define VMEMMAP_START		(info->vmemmap_start)
> >   #define VMEMMAP_END		(info->vmemmap_end)
> >   #define PMASK			(0x7ffffffffffff000UL)
> > @@ -2262,6 +2260,9 @@ struct number_table {
> >   	long    HUGETLB_PAGE_DTOR;
> >   	long	phys_base;
> >   	long	KERNEL_IMAGE_SIZE;
> > +
> > +	unsigned long vmalloc_start;
> > +
> >   #ifdef __aarch64__
> >   	long 	VA_BITS;
> >   	long	TCR_EL1_T1SZ;
> > @@ -2272,7 +2273,6 @@ struct number_table {
> >   	long va_bits;
> >   	unsigned long phys_ram_base;
> >   	unsigned long page_offset;
> > -	unsigned long vmalloc_start;
> >   	unsigned long vmalloc_end;
> >   	unsigned long vmemmap_start;
> >   	unsigned long vmemmap_end;

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo
  2024-02-23 19:03 [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo Aditya Gupta
  2024-02-24  4:34 ` Sachin Sant
  2024-02-28  4:51 ` HAGIO KAZUHITO(萩尾 一仁)
@ 2024-03-18  8:26 ` Aditya Gupta
  2024-03-18  8:48   ` HAGIO KAZUHITO(萩尾 一仁)
  2 siblings, 1 reply; 7+ messages in thread
From: Aditya Gupta @ 2024-03-18  8:26 UTC (permalink / raw)
  To: kexec, HAGIO KAZUHITO(萩尾 一仁)
  Cc: Hari Bathini, Sachin Sant

Hi,
The commit removing 'vmap_area_list' is now merged in Linux mainline tree.
     commit:     55c49fee57af99f3c663e69dedc5b85e691bbe50
     mm/vmalloc: remove vmap_area_list

Any comments on this patch ?

Thanks,

Aditya Gupta

On 24/02/24 00:33, Aditya Gupta wrote:
> Below error was noticed when running makedumpfile on linux-next kernel
> crash (linux-next tag next-20240121):
>
>      ...
>      Checking for memory holes : [100.0 %] | readpage_elf: Attempt to read non-existent page at 0xc000000000000.
>      [ 17.551718] kdump.sh[404]: readmem: type_addr: 0, addr:c00c000000000000, size:16384
>      [ 17.551793] kdump.sh[404]: __exclude_unnecessary_pages: Can't read the buffer of struct page.
>      [ 17.551864] kdump.sh[404]: create_2nd_bitmap: Can't exclude unnecessary pages.
>      [ 17.562632] kdump.sh[404]: The kernel version is not supported.
>      [ 17.562708] kdump.sh[404]: The makedumpfile operation may be incomplete.
>      [ 17.562773] kdump.sh[404]: makedumpfile Failed.
>      [ 17.564335] kdump[406]: saving vmcore failed, _exitcode:1
>
> Above error was due to 'vmap_area_list' and 'vmlist' symbols missing
> from the vmcore.
>
> 'vmap_area_list' was removed in the linux kernel with below commit:
>
>      commit 378eb24a0658dd922b29524e0ce35c6c43f56cba
>           mm/vmalloc: remove vmap_area_list
>
> Subsequently the commit also introduced 'VMALLOC_START' in vmcoreinfo to
> get base address of vmalloc area, instead of depending on 'vmap_area_list'
>
> Hence if 'VMALLOC_START' symbol is there in vmcoreinfo:
>    1. Set vmalloc_start based on 'VMALLOC_START'
>    2. Don't error if vmap_area_list/vmlist are not defined
>
> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
> ---
>   arch/ppc64.c   | 19 +++++++++++++------
>   makedumpfile.c |  3 ++-
>   makedumpfile.h |  6 +++---
>   3 files changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/arch/ppc64.c b/arch/ppc64.c
> index 96c357cb0335..bb62e2cd199a 100644
> --- a/arch/ppc64.c
> +++ b/arch/ppc64.c
> @@ -568,7 +568,9 @@ get_machdep_info_ppc64(void)
>   	/*
>   	 * Get vmalloc_start value from either vmap_area_list or vmlist.
>   	 */
> -	if ((SYMBOL(vmap_area_list) != NOT_FOUND_SYMBOL)
> +	if (NUMBER(vmalloc_start) != NOT_FOUND_SYMBOL) {
> +		vmalloc_start = NUMBER(vmalloc_start);
> +	} else 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),
> @@ -684,11 +686,16 @@ vaddr_to_paddr_ppc64(unsigned long vaddr)
>   	if ((SYMBOL(vmap_area_list) == NOT_FOUND_SYMBOL)
>   	    || (OFFSET(vmap_area.va_start) == NOT_FOUND_STRUCTURE)
>   	    || (OFFSET(vmap_area.list) == NOT_FOUND_STRUCTURE)) {
> -		if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
> -		    || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
> -			ERRMSG("Can't get info for vmalloc translation.\n");
> -			return NOT_PADDR;
> -		}
> +		/*
> +		 * Don't depend on vmap_area_list/vmlist if vmalloc_start is set in
> +		 * vmcoreinfo, in that case proceed without error
> +		 */
> +		if (NUMBER(vmalloc_start) == NOT_FOUND_NUMBER)
> +			if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
> +				|| (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
> +				ERRMSG("Can't get info for vmalloc translation.\n");
> +				return NOT_PADDR;
> +			}
>   	}
>   
>   	return ppc64_vtop_level4(vaddr);
> diff --git a/makedumpfile.c b/makedumpfile.c
> index b004b93fecb7..b6c63fad15f3 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -2978,6 +2978,8 @@ read_vmcoreinfo(void)
>   	READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", PAGE_OFFLINE_MAPCOUNT_VALUE);
>   	READ_NUMBER("phys_base", phys_base);
>   	READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE);
> +
> +	READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
>   #ifdef __aarch64__
>   	READ_NUMBER("VA_BITS", VA_BITS);
>   	READ_NUMBER("TCR_EL1_T1SZ", TCR_EL1_T1SZ);
> @@ -2989,7 +2991,6 @@ read_vmcoreinfo(void)
>   	READ_NUMBER("VA_BITS", va_bits);
>   	READ_NUMBER_UNSIGNED("phys_ram_base", phys_ram_base);
>   	READ_NUMBER_UNSIGNED("PAGE_OFFSET", page_offset);
> -	READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
>   	READ_NUMBER_UNSIGNED("VMALLOC_END", vmalloc_end);
>   	READ_NUMBER_UNSIGNED("VMEMMAP_START", vmemmap_start);
>   	READ_NUMBER_UNSIGNED("VMEMMAP_END", vmemmap_end);
> diff --git a/makedumpfile.h b/makedumpfile.h
> index 59c83e1d9df3..4021c5af2a34 100644
> --- a/makedumpfile.h
> +++ b/makedumpfile.h
> @@ -541,8 +541,6 @@ do { \
>    * The value of dependence on machine
>    */
>   #define PAGE_OFFSET		(info->page_offset)
> -#define VMALLOC_START		(info->vmalloc_start)
> -#define VMALLOC_END		(info->vmalloc_end)
>   #define VMEMMAP_START		(info->vmemmap_start)
>   #define VMEMMAP_END		(info->vmemmap_end)
>   #define PMASK			(0x7ffffffffffff000UL)
> @@ -2262,6 +2260,9 @@ struct number_table {
>   	long    HUGETLB_PAGE_DTOR;
>   	long	phys_base;
>   	long	KERNEL_IMAGE_SIZE;
> +
> +	unsigned long vmalloc_start;
> +
>   #ifdef __aarch64__
>   	long 	VA_BITS;
>   	long	TCR_EL1_T1SZ;
> @@ -2272,7 +2273,6 @@ struct number_table {
>   	long va_bits;
>   	unsigned long phys_ram_base;
>   	unsigned long page_offset;
> -	unsigned long vmalloc_start;
>   	unsigned long vmalloc_end;
>   	unsigned long vmemmap_start;
>   	unsigned long vmemmap_end;

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo
  2024-03-18  8:26 ` Aditya Gupta
@ 2024-03-18  8:48   ` HAGIO KAZUHITO(萩尾 一仁)
  2024-03-18  9:00     ` Aditya Gupta
  0 siblings, 1 reply; 7+ messages in thread
From: HAGIO KAZUHITO(萩尾 一仁) @ 2024-03-18  8:48 UTC (permalink / raw)
  To: Aditya Gupta, kexec; +Cc: Hari Bathini, Sachin Sant

On 2024/03/18 17:26, Aditya Gupta wrote:
> Hi,
> The commit removing 'vmap_area_list' is now merged in Linux mainline tree.
>      commit:     55c49fee57af99f3c663e69dedc5b85e691bbe50
>      mm/vmalloc: remove vmap_area_list

Applied with this commit id and the fix.
https://github.com/makedumpfile/makedumpfile/commit/94241fd2feed059227a243618f2acc6aabf366e8

Thanks,
Kazu

> 
> Any comments on this patch ?
> 
> Thanks,
> 
> Aditya Gupta
> 
> On 24/02/24 00:33, Aditya Gupta wrote:
>> Below error was noticed when running makedumpfile on linux-next kernel
>> crash (linux-next tag next-20240121):
>>
>>      ...
>>      Checking for memory holes : [100.0 %] | readpage_elf: Attempt to 
>> read non-existent page at 0xc000000000000.
>>      [ 17.551718] kdump.sh[404]: readmem: type_addr: 0, 
>> addr:c00c000000000000, size:16384
>>      [ 17.551793] kdump.sh[404]: __exclude_unnecessary_pages: Can't 
>> read the buffer of struct page.
>>      [ 17.551864] kdump.sh[404]: create_2nd_bitmap: Can't exclude 
>> unnecessary pages.
>>      [ 17.562632] kdump.sh[404]: The kernel version is not supported.
>>      [ 17.562708] kdump.sh[404]: The makedumpfile operation may be 
>> incomplete.
>>      [ 17.562773] kdump.sh[404]: makedumpfile Failed.
>>      [ 17.564335] kdump[406]: saving vmcore failed, _exitcode:1
>>
>> Above error was due to 'vmap_area_list' and 'vmlist' symbols missing
>> from the vmcore.
>>
>> 'vmap_area_list' was removed in the linux kernel with below commit:
>>
>>      commit 378eb24a0658dd922b29524e0ce35c6c43f56cba
>>           mm/vmalloc: remove vmap_area_list
>>
>> Subsequently the commit also introduced 'VMALLOC_START' in vmcoreinfo to
>> get base address of vmalloc area, instead of depending on 
>> 'vmap_area_list'
>>
>> Hence if 'VMALLOC_START' symbol is there in vmcoreinfo:
>>    1. Set vmalloc_start based on 'VMALLOC_START'
>>    2. Don't error if vmap_area_list/vmlist are not defined
>>
>> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
>> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
>> ---
>>   arch/ppc64.c   | 19 +++++++++++++------
>>   makedumpfile.c |  3 ++-
>>   makedumpfile.h |  6 +++---
>>   3 files changed, 18 insertions(+), 10 deletions(-)
>>
>> diff --git a/arch/ppc64.c b/arch/ppc64.c
>> index 96c357cb0335..bb62e2cd199a 100644
>> --- a/arch/ppc64.c
>> +++ b/arch/ppc64.c
>> @@ -568,7 +568,9 @@ get_machdep_info_ppc64(void)
>>       /*
>>        * Get vmalloc_start value from either vmap_area_list or vmlist.
>>        */
>> -    if ((SYMBOL(vmap_area_list) != NOT_FOUND_SYMBOL)
>> +    if (NUMBER(vmalloc_start) != NOT_FOUND_SYMBOL) {
>> +        vmalloc_start = NUMBER(vmalloc_start);
>> +    } else 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),
>> @@ -684,11 +686,16 @@ vaddr_to_paddr_ppc64(unsigned long vaddr)
>>       if ((SYMBOL(vmap_area_list) == NOT_FOUND_SYMBOL)
>>           || (OFFSET(vmap_area.va_start) == NOT_FOUND_STRUCTURE)
>>           || (OFFSET(vmap_area.list) == NOT_FOUND_STRUCTURE)) {
>> -        if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
>> -            || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
>> -            ERRMSG("Can't get info for vmalloc translation.\n");
>> -            return NOT_PADDR;
>> -        }
>> +        /*
>> +         * Don't depend on vmap_area_list/vmlist if vmalloc_start is 
>> set in
>> +         * vmcoreinfo, in that case proceed without error
>> +         */
>> +        if (NUMBER(vmalloc_start) == NOT_FOUND_NUMBER)
>> +            if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
>> +                || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
>> +                ERRMSG("Can't get info for vmalloc translation.\n");
>> +                return NOT_PADDR;
>> +            }
>>       }
>>       return ppc64_vtop_level4(vaddr);
>> diff --git a/makedumpfile.c b/makedumpfile.c
>> index b004b93fecb7..b6c63fad15f3 100644
>> --- a/makedumpfile.c
>> +++ b/makedumpfile.c
>> @@ -2978,6 +2978,8 @@ read_vmcoreinfo(void)
>>       READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", 
>> PAGE_OFFLINE_MAPCOUNT_VALUE);
>>       READ_NUMBER("phys_base", phys_base);
>>       READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE);
>> +
>> +    READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
>>   #ifdef __aarch64__
>>       READ_NUMBER("VA_BITS", VA_BITS);
>>       READ_NUMBER("TCR_EL1_T1SZ", TCR_EL1_T1SZ);
>> @@ -2989,7 +2991,6 @@ read_vmcoreinfo(void)
>>       READ_NUMBER("VA_BITS", va_bits);
>>       READ_NUMBER_UNSIGNED("phys_ram_base", phys_ram_base);
>>       READ_NUMBER_UNSIGNED("PAGE_OFFSET", page_offset);
>> -    READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
>>       READ_NUMBER_UNSIGNED("VMALLOC_END", vmalloc_end);
>>       READ_NUMBER_UNSIGNED("VMEMMAP_START", vmemmap_start);
>>       READ_NUMBER_UNSIGNED("VMEMMAP_END", vmemmap_end);
>> diff --git a/makedumpfile.h b/makedumpfile.h
>> index 59c83e1d9df3..4021c5af2a34 100644
>> --- a/makedumpfile.h
>> +++ b/makedumpfile.h
>> @@ -541,8 +541,6 @@ do { \
>>    * The value of dependence on machine
>>    */
>>   #define PAGE_OFFSET        (info->page_offset)
>> -#define VMALLOC_START        (info->vmalloc_start)
>> -#define VMALLOC_END        (info->vmalloc_end)
>>   #define VMEMMAP_START        (info->vmemmap_start)
>>   #define VMEMMAP_END        (info->vmemmap_end)
>>   #define PMASK            (0x7ffffffffffff000UL)
>> @@ -2262,6 +2260,9 @@ struct number_table {
>>       long    HUGETLB_PAGE_DTOR;
>>       long    phys_base;
>>       long    KERNEL_IMAGE_SIZE;
>> +
>> +    unsigned long vmalloc_start;
>> +
>>   #ifdef __aarch64__
>>       long     VA_BITS;
>>       long    TCR_EL1_T1SZ;
>> @@ -2272,7 +2273,6 @@ struct number_table {
>>       long va_bits;
>>       unsigned long phys_ram_base;
>>       unsigned long page_offset;
>> -    unsigned long vmalloc_start;
>>       unsigned long vmalloc_end;
>>       unsigned long vmemmap_start;
>>       unsigned long vmemmap_end;
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo
  2024-03-18  8:48   ` HAGIO KAZUHITO(萩尾 一仁)
@ 2024-03-18  9:00     ` Aditya Gupta
  0 siblings, 0 replies; 7+ messages in thread
From: Aditya Gupta @ 2024-03-18  9:00 UTC (permalink / raw)
  To: HAGIO KAZUHITO(萩尾 一仁), kexec


On 18/03/24 14:18, HAGIO KAZUHITO(萩尾 一仁) wrote:
> On 2024/03/18 17:26, Aditya Gupta wrote:
>> Hi,
>> The commit removing 'vmap_area_list' is now merged in Linux mainline tree.
>>       commit:     55c49fee57af99f3c663e69dedc5b85e691bbe50
>>       mm/vmalloc: remove vmap_area_list
> Applied with this commit id and the fix.
> https://github.com/makedumpfile/makedumpfile/commit/94241fd2feed059227a243618f2acc6aabf366e8

Thanks Kazu.


- Aditya Gupta


> Thanks,
> Kazu
>
>> Any comments on this patch ?
>>
>> Thanks,
>>
>> Aditya Gupta
>>
>> On 24/02/24 00:33, Aditya Gupta wrote:
>>> Below error was noticed when running makedumpfile on linux-next kernel
>>> crash (linux-next tag next-20240121):
>>>
>>>       ...
>>>       Checking for memory holes : [100.0 %] | readpage_elf: Attempt to
>>> read non-existent page at 0xc000000000000.
>>>       [ 17.551718] kdump.sh[404]: readmem: type_addr: 0,
>>> addr:c00c000000000000, size:16384
>>>       [ 17.551793] kdump.sh[404]: __exclude_unnecessary_pages: Can't
>>> read the buffer of struct page.
>>>       [ 17.551864] kdump.sh[404]: create_2nd_bitmap: Can't exclude
>>> unnecessary pages.
>>>       [ 17.562632] kdump.sh[404]: The kernel version is not supported.
>>>       [ 17.562708] kdump.sh[404]: The makedumpfile operation may be
>>> incomplete.
>>>       [ 17.562773] kdump.sh[404]: makedumpfile Failed.
>>>       [ 17.564335] kdump[406]: saving vmcore failed, _exitcode:1
>>>
>>> Above error was due to 'vmap_area_list' and 'vmlist' symbols missing
>>> from the vmcore.
>>>
>>> 'vmap_area_list' was removed in the linux kernel with below commit:
>>>
>>>       commit 378eb24a0658dd922b29524e0ce35c6c43f56cba
>>>            mm/vmalloc: remove vmap_area_list
>>>
>>> Subsequently the commit also introduced 'VMALLOC_START' in vmcoreinfo to
>>> get base address of vmalloc area, instead of depending on
>>> 'vmap_area_list'
>>>
>>> Hence if 'VMALLOC_START' symbol is there in vmcoreinfo:
>>>     1. Set vmalloc_start based on 'VMALLOC_START'
>>>     2. Don't error if vmap_area_list/vmlist are not defined
>>>
>>> Reported-by: Sachin Sant <sachinp@linux.ibm.com>
>>> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
>>> ---
>>>    arch/ppc64.c   | 19 +++++++++++++------
>>>    makedumpfile.c |  3 ++-
>>>    makedumpfile.h |  6 +++---
>>>    3 files changed, 18 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/arch/ppc64.c b/arch/ppc64.c
>>> index 96c357cb0335..bb62e2cd199a 100644
>>> --- a/arch/ppc64.c
>>> +++ b/arch/ppc64.c
>>> @@ -568,7 +568,9 @@ get_machdep_info_ppc64(void)
>>>        /*
>>>         * Get vmalloc_start value from either vmap_area_list or vmlist.
>>>         */
>>> -    if ((SYMBOL(vmap_area_list) != NOT_FOUND_SYMBOL)
>>> +    if (NUMBER(vmalloc_start) != NOT_FOUND_SYMBOL) {
>>> +        vmalloc_start = NUMBER(vmalloc_start);
>>> +    } else 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),
>>> @@ -684,11 +686,16 @@ vaddr_to_paddr_ppc64(unsigned long vaddr)
>>>        if ((SYMBOL(vmap_area_list) == NOT_FOUND_SYMBOL)
>>>            || (OFFSET(vmap_area.va_start) == NOT_FOUND_STRUCTURE)
>>>            || (OFFSET(vmap_area.list) == NOT_FOUND_STRUCTURE)) {
>>> -        if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
>>> -            || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
>>> -            ERRMSG("Can't get info for vmalloc translation.\n");
>>> -            return NOT_PADDR;
>>> -        }
>>> +        /*
>>> +         * Don't depend on vmap_area_list/vmlist if vmalloc_start is
>>> set in
>>> +         * vmcoreinfo, in that case proceed without error
>>> +         */
>>> +        if (NUMBER(vmalloc_start) == NOT_FOUND_NUMBER)
>>> +            if ((SYMBOL(vmlist) == NOT_FOUND_SYMBOL)
>>> +                || (OFFSET(vm_struct.addr) == NOT_FOUND_STRUCTURE)) {
>>> +                ERRMSG("Can't get info for vmalloc translation.\n");
>>> +                return NOT_PADDR;
>>> +            }
>>>        }
>>>        return ppc64_vtop_level4(vaddr);
>>> diff --git a/makedumpfile.c b/makedumpfile.c
>>> index b004b93fecb7..b6c63fad15f3 100644
>>> --- a/makedumpfile.c
>>> +++ b/makedumpfile.c
>>> @@ -2978,6 +2978,8 @@ read_vmcoreinfo(void)
>>>        READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE",
>>> PAGE_OFFLINE_MAPCOUNT_VALUE);
>>>        READ_NUMBER("phys_base", phys_base);
>>>        READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE);
>>> +
>>> +    READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
>>>    #ifdef __aarch64__
>>>        READ_NUMBER("VA_BITS", VA_BITS);
>>>        READ_NUMBER("TCR_EL1_T1SZ", TCR_EL1_T1SZ);
>>> @@ -2989,7 +2991,6 @@ read_vmcoreinfo(void)
>>>        READ_NUMBER("VA_BITS", va_bits);
>>>        READ_NUMBER_UNSIGNED("phys_ram_base", phys_ram_base);
>>>        READ_NUMBER_UNSIGNED("PAGE_OFFSET", page_offset);
>>> -    READ_NUMBER_UNSIGNED("VMALLOC_START", vmalloc_start);
>>>        READ_NUMBER_UNSIGNED("VMALLOC_END", vmalloc_end);
>>>        READ_NUMBER_UNSIGNED("VMEMMAP_START", vmemmap_start);
>>>        READ_NUMBER_UNSIGNED("VMEMMAP_END", vmemmap_end);
>>> diff --git a/makedumpfile.h b/makedumpfile.h
>>> index 59c83e1d9df3..4021c5af2a34 100644
>>> --- a/makedumpfile.h
>>> +++ b/makedumpfile.h
>>> @@ -541,8 +541,6 @@ do { \
>>>     * The value of dependence on machine
>>>     */
>>>    #define PAGE_OFFSET        (info->page_offset)
>>> -#define VMALLOC_START        (info->vmalloc_start)
>>> -#define VMALLOC_END        (info->vmalloc_end)
>>>    #define VMEMMAP_START        (info->vmemmap_start)
>>>    #define VMEMMAP_END        (info->vmemmap_end)
>>>    #define PMASK            (0x7ffffffffffff000UL)
>>> @@ -2262,6 +2260,9 @@ struct number_table {
>>>        long    HUGETLB_PAGE_DTOR;
>>>        long    phys_base;
>>>        long    KERNEL_IMAGE_SIZE;
>>> +
>>> +    unsigned long vmalloc_start;
>>> +
>>>    #ifdef __aarch64__
>>>        long     VA_BITS;
>>>        long    TCR_EL1_T1SZ;
>>> @@ -2272,7 +2273,6 @@ struct number_table {
>>>        long va_bits;
>>>        unsigned long phys_ram_base;
>>>        unsigned long page_offset;
>>> -    unsigned long vmalloc_start;
>>>        unsigned long vmalloc_end;
>>>        unsigned long vmemmap_start;
>>>        unsigned long vmemmap_end;

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-18  9:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-23 19:03 [PATCH] makedumpfile: ppc64: get vmalloc start address from vmcoreinfo Aditya Gupta
2024-02-24  4:34 ` Sachin Sant
2024-02-28  4:51 ` HAGIO KAZUHITO(萩尾 一仁)
2024-02-28  9:36   ` Aditya Gupta
2024-03-18  8:26 ` Aditya Gupta
2024-03-18  8:48   ` HAGIO KAZUHITO(萩尾 一仁)
2024-03-18  9:00     ` Aditya Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).