Commit fd59d231 authored by Ken'ichi Ohmichi's avatar Ken'ichi Ohmichi Committed by Linus Torvalds
Browse files

Add vmcoreinfo

This patch set frees the restriction that makedumpfile users should install a
vmlinux file (including the debugging information) into each system.

makedumpfile command is the dump filtering feature for kdump.  It creates a
small dumpfile by filtering unnecessary pages for the analysis.  To
distinguish unnecessary pages, it needs a vmlinux file including the debugging
information.  These days, the debugging package becomes a huge file, and it is
hard to install it into each system.

To solve the problem, kdump developers discussed it at lkml and kexec-ml.  As
the result, we reached the conclusion that necessary information for dump
filtering (called "vmcoreinfo") should be embedded into the first kernel file
and it should be accessed through /proc/vmcore during the second kernel.
(http://www.uwsg.iu.edu/hypermail/linux/kernel/0707.0/1806.html)

Dan Aloni created the patch set for the above implementation.
(http://www.uwsg.iu.edu/hypermail/linux/kernel/0707.1/1053.html)

And I updated it for multi architectures and memory models.
(http://lists.infradead.org/pipermail/kexec/2007-August/000479.html

)

Signed-off-by: default avatarDan Aloni <da-x@monatomic.org>
Signed-off-by: default avatarKen'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: default avatarBernhard Walle <bwalle@suse.de>
Signed-off-by: default avatarDaisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0e647c04
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
#include <linux/cpu.h>
#include <linux/irq.h>
#include <linux/efi.h>
#include <linux/numa.h>
#include <linux/mmzone.h>
#include <asm/mmu_context.h>
#include <asm/setup.h>
#include <asm/delay.h>
@@ -121,3 +123,31 @@ void machine_kexec(struct kimage *image)
	unw_init_running(ia64_machine_kexec, image);
	for(;;);
}

void arch_crash_save_vmcoreinfo(void)
{
#ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE
	SYMBOL(pgdat_list);
	LENGTH(pgdat_list, MAX_NUMNODES);

	SYMBOL(node_memblk);
	LENGTH(node_memblk, NR_NODE_MEMBLKS);
	SIZE(node_memblk_s);
	OFFSET(node_memblk_s, start_paddr);
	OFFSET(node_memblk_s, size);
#endif
#ifdef CONFIG_PGTABLE_3
	CONFIG(PGTABLE_3);
#elif  CONFIG_PGTABLE_4
	CONFIG(PGTABLE_4);
#endif
}

unsigned long paddr_vmcoreinfo_note(void)
{
	unsigned long vaddr, paddr;
	vaddr = (unsigned long)(char *)&vmcoreinfo_note;
	asm volatile ("tpa %0 = %1" : "=r"(paddr) : "r"(vaddr) : "memory");
	return paddr;
}
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ struct early_node_data {
static struct early_node_data mem_data[MAX_NUMNODES] __initdata;
static nodemask_t memory_less_mask __initdata;

static pg_data_t *pgdat_list[MAX_NUMNODES];
pg_data_t *pgdat_list[MAX_NUMNODES];

/*
 * To prevent cache aliasing effects, align per-node structures so that they
+13 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <linux/kexec.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/numa.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
@@ -169,3 +170,15 @@ static int __init parse_crashkernel(char *arg)
	return 0;
}
early_param("crashkernel", parse_crashkernel);

void arch_crash_save_vmcoreinfo(void)
{
#ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE
	SYMBOL(node_data);
	LENGTH(node_data, MAX_NUMNODES);
#endif
#ifdef CONFIG_X86_PAE
	CONFIG(X86_PAE);
#endif
}
+9 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <linux/kexec.h>
#include <linux/string.h>
#include <linux/reboot.h>
#include <linux/numa.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include <asm/mmu_context.h>
@@ -257,3 +258,11 @@ static int __init setup_crashkernel(char *arg)
}
early_param("crashkernel", setup_crashkernel);

void arch_crash_save_vmcoreinfo(void)
{
#ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE
	SYMBOL(node_data);
	LENGTH(node_data, MAX_NUMNODES);
#endif
}
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

extern u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
extern pg_data_t *pgdat_list[MAX_NUMNODES];

/* Stuff below this line could be architecture independent */

Loading