linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PPC64: Adding symbols in vmcoreinfo to facilitate dump filtering
@ 2013-11-15 17:31 Hari Bathini
  2013-11-15 18:27 ` Mahesh Jagannath Salgaonkar
  2013-11-22  2:54 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Hari Bathini @ 2013-11-15 17:31 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev; +Cc: Mahesh J Salgaonkar

When CONFIG_SPARSEMEM_VMEMMAP option is used in kernel, makedumpfile fails
to filter vmcore dump as it fails to do vmemmap translations. So far
dump filtering on ppc64 never had to deal with vmemmap addresses seperately
as vmemmap regions where mapped in zone normal. But with the inclusion of
CONFIG_SPARSEMEM_VMEMMAP config option in kernel, this vmemmap address
translation support becomes necessary for dump filtering. For vmemmap adress
translation, few kernel symbols are needed by dump filtering tool. This patch
adds those symbols to vmcoreinfo, which a dump filtering tool can use for
filtering the kernel dump. Tested this changes successfully with makedumpfile
tool that supports vmemmap to physical address translation outside zone normal.

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/pgalloc-64.h |    4 ++++
 arch/powerpc/kernel/machine_kexec.c   |   12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
index f65e27b..33e507a 100644
--- a/arch/powerpc/include/asm/pgalloc-64.h
+++ b/arch/powerpc/include/asm/pgalloc-64.h
@@ -17,6 +17,10 @@ struct vmemmap_backing {
 	unsigned long virt_addr;
 };
 
+#ifdef CONFIG_SPARSEMEM_VMEMMAP
+extern struct vmemmap_backing *vmemmap_list;
+#endif /* CONFIG_SPARSEMEM_VMEMMAP */
+
 /*
  * Functions that deal with pagetables that could be at any level of
  * the table need to be passed an "index_size" so they know how to
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index e1ec57e..88a7fb4 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -18,6 +18,7 @@
 #include <linux/ftrace.h>
 
 #include <asm/machdep.h>
+#include <asm/pgalloc.h>
 #include <asm/prom.h>
 #include <asm/sections.h>
 
@@ -75,6 +76,17 @@ void arch_crash_save_vmcoreinfo(void)
 #ifndef CONFIG_NEED_MULTIPLE_NODES
 	VMCOREINFO_SYMBOL(contig_page_data);
 #endif
+#if defined(CONFIG_PPC64) && defined(CONFIG_SPARSEMEM_VMEMMAP)
+	VMCOREINFO_SYMBOL(vmemmap_list);
+	VMCOREINFO_SYMBOL(mmu_vmemmap_psize);
+	VMCOREINFO_SYMBOL(mmu_psize_defs);
+	VMCOREINFO_STRUCT_SIZE(vmemmap_backing);
+	VMCOREINFO_OFFSET(vmemmap_backing, list);
+	VMCOREINFO_OFFSET(vmemmap_backing, phys);
+	VMCOREINFO_OFFSET(vmemmap_backing, virt_addr);
+	VMCOREINFO_STRUCT_SIZE(mmu_psize_def);
+	VMCOREINFO_OFFSET(mmu_psize_def, shift);
+#endif
 }
 
 /*

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

* Re: [PATCH] PPC64: Adding symbols in vmcoreinfo to facilitate dump filtering
  2013-11-15 17:31 [PATCH] PPC64: Adding symbols in vmcoreinfo to facilitate dump filtering Hari Bathini
@ 2013-11-15 18:27 ` Mahesh Jagannath Salgaonkar
  2013-11-22  2:54 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Mahesh Jagannath Salgaonkar @ 2013-11-15 18:27 UTC (permalink / raw)
  To: Hari Bathini, linuxppc-dev

On 11/15/2013 11:01 PM, Hari Bathini wrote:
> When CONFIG_SPARSEMEM_VMEMMAP option is used in kernel, makedumpfile fails
> to filter vmcore dump as it fails to do vmemmap translations. So far
> dump filtering on ppc64 never had to deal with vmemmap addresses seperately
> as vmemmap regions where mapped in zone normal. But with the inclusion of
> CONFIG_SPARSEMEM_VMEMMAP config option in kernel, this vmemmap address
> translation support becomes necessary for dump filtering. For vmemmap adress
> translation, few kernel symbols are needed by dump filtering tool. This patch
> adds those symbols to vmcoreinfo, which a dump filtering tool can use for
> filtering the kernel dump. Tested this changes successfully with makedumpfile
> tool that supports vmemmap to physical address translation outside zone normal.
> 
> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
> ---

Acked-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

>  arch/powerpc/include/asm/pgalloc-64.h |    4 ++++
>  arch/powerpc/kernel/machine_kexec.c   |   12 ++++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
> index f65e27b..33e507a 100644
> --- a/arch/powerpc/include/asm/pgalloc-64.h
> +++ b/arch/powerpc/include/asm/pgalloc-64.h
> @@ -17,6 +17,10 @@ struct vmemmap_backing {
>  	unsigned long virt_addr;
>  };
> 
> +#ifdef CONFIG_SPARSEMEM_VMEMMAP
> +extern struct vmemmap_backing *vmemmap_list;
> +#endif /* CONFIG_SPARSEMEM_VMEMMAP */
> +
>  /*
>   * Functions that deal with pagetables that could be at any level of
>   * the table need to be passed an "index_size" so they know how to
> diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
> index e1ec57e..88a7fb4 100644
> --- a/arch/powerpc/kernel/machine_kexec.c
> +++ b/arch/powerpc/kernel/machine_kexec.c
> @@ -18,6 +18,7 @@
>  #include <linux/ftrace.h>
> 
>  #include <asm/machdep.h>
> +#include <asm/pgalloc.h>
>  #include <asm/prom.h>
>  #include <asm/sections.h>
> 
> @@ -75,6 +76,17 @@ void arch_crash_save_vmcoreinfo(void)
>  #ifndef CONFIG_NEED_MULTIPLE_NODES
>  	VMCOREINFO_SYMBOL(contig_page_data);
>  #endif
> +#if defined(CONFIG_PPC64) && defined(CONFIG_SPARSEMEM_VMEMMAP)
> +	VMCOREINFO_SYMBOL(vmemmap_list);
> +	VMCOREINFO_SYMBOL(mmu_vmemmap_psize);
> +	VMCOREINFO_SYMBOL(mmu_psize_defs);
> +	VMCOREINFO_STRUCT_SIZE(vmemmap_backing);
> +	VMCOREINFO_OFFSET(vmemmap_backing, list);
> +	VMCOREINFO_OFFSET(vmemmap_backing, phys);
> +	VMCOREINFO_OFFSET(vmemmap_backing, virt_addr);
> +	VMCOREINFO_STRUCT_SIZE(mmu_psize_def);
> +	VMCOREINFO_OFFSET(mmu_psize_def, shift);
> +#endif
>  }
> 
>  /*
> 

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

* Re: [PATCH] PPC64: Adding symbols in vmcoreinfo to facilitate dump filtering
  2013-11-15 17:31 [PATCH] PPC64: Adding symbols in vmcoreinfo to facilitate dump filtering Hari Bathini
  2013-11-15 18:27 ` Mahesh Jagannath Salgaonkar
@ 2013-11-22  2:54 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2013-11-22  2:54 UTC (permalink / raw)
  To: Hari Bathini; +Cc: Mahesh J Salgaonkar, linuxppc-dev

On Fri, 2013-11-15 at 23:01 +0530, Hari Bathini wrote:
> When CONFIG_SPARSEMEM_VMEMMAP option is used in kernel, makedumpfile fails
> to filter vmcore dump as it fails to do vmemmap translations. So far
> dump filtering on ppc64 never had to deal with vmemmap addresses seperately
> as vmemmap regions where mapped in zone normal. But with the inclusion of
> CONFIG_SPARSEMEM_VMEMMAP config option in kernel, this vmemmap address
> translation support becomes necessary for dump filtering. For vmemmap adress
> translation, few kernel symbols are needed by dump filtering tool. This patch
> adds those symbols to vmcoreinfo, which a dump filtering tool can use for
> filtering the kernel dump. Tested this changes successfully with makedumpfile
> tool that supports vmemmap to physical address translation outside zone normal.
> 
> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/pgalloc-64.h |    4 ++++
>  arch/powerpc/kernel/machine_kexec.c   |   12 ++++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h
> index f65e27b..33e507a 100644
> --- a/arch/powerpc/include/asm/pgalloc-64.h
> +++ b/arch/powerpc/include/asm/pgalloc-64.h
> @@ -17,6 +17,10 @@ struct vmemmap_backing {
>  	unsigned long virt_addr;
>  };
>  
> +#ifdef CONFIG_SPARSEMEM_VMEMMAP
> +extern struct vmemmap_backing *vmemmap_list;
> +#endif /* CONFIG_SPARSEMEM_VMEMMAP */

In general you don't need #ifdefs around externs, they just add noise. The
exception is when the type you're using isn't defined, but that isn't the case
here AFAICS.

cheers

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

end of thread, other threads:[~2013-11-22  2:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-15 17:31 [PATCH] PPC64: Adding symbols in vmcoreinfo to facilitate dump filtering Hari Bathini
2013-11-15 18:27 ` Mahesh Jagannath Salgaonkar
2013-11-22  2:54 ` Michael Ellerman

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).