lkml.org 
[lkml]   [2004]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH][3/4] kexec based dump: Minor bug fixes
This patch fixes a problem where the kernel compilation was 
failing upon disabling PROC_FS. It also ensures the
reboot-on-panic kernel is pointed to by a different
variable, thereby separating the normal use of kexec from
the crashdump situation.

Regards, Hari

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Hariprasad Nellitheertha <hari@in.ibm.com>
---

linux-2.6.9-rc4-hari/Documentation/kdump.txt | 24 ++++++++----------------
linux-2.6.9-rc4-hari/include/linux/crash_dump.h | 11 ++++++++---
linux-2.6.9-rc4-hari/kernel/crash.c | 5 ++++-
3 files changed, 20 insertions(+), 20 deletions(-)

diff -puN Documentation/kdump.txt~kd-misc-changes Documentation/kdump.txt
--- linux-2.6.9-rc4/Documentation/kdump.txt~kd-misc-changes 2004-10-21 15:10:58.000000000 +0530
+++ linux-2.6.9-rc4-hari/Documentation/kdump.txt 2004-10-21 15:10:58.000000000 +0530
@@ -27,19 +27,11 @@ SETUP
1) Obtain the appropriate -mm tree patch and apply it on to the vanilla
kernel tree.

-2) In order to enable the kernel to boot from a non-default location, the
- following patches (by Eric Biederman) needs to be applied.
-
- http://www.xmission.com/~ebiederm/files/kexec/2.6.8.1-kexec3/
- broken-out/highbzImage.i386.patch
- http://www.xmission.com/~ebiederm/files/kexec/2.6.8.1-kexec3/
- broken-out/vmlinux-lds.i386.patch
-
-3) Two kernels need to be built in order to get this feature working.
+2) Two kernels need to be built in order to get this feature working.

For the first kernel, choose the default values for the following options.

- a) Physical address where the kernel expects to be loaded
+ a) Physical address where the kernel is loaded
b) kexec system call
c) kernel crash dumps

@@ -51,28 +43,28 @@ SETUP

Also ensure you have CONFIG_HIGHMEM on.

-4) Boot into the first kernel. You are now ready to try out kexec based crash
+3) Boot into the first kernel. You are now ready to try out kexec based crash
dumps.

-5) Load the second kernel to be booted using
+4) Load the second kernel to be booted using

- kexec -l <second-kernel> --args-linux --append="root=<root-dev> dump
+ kexec -p <second-kernel> --args-linux --append="root=<root-dev> dump
init 1 memmap=exactmap memmap=640k@0 memmap=32M@16M"

Note that <second-kernel> has to be a vmlinux image. bzImage will not
work, as of now.

-6) Enable kexec based dumping by
+5) Enable kexec based dumping by

echo 1 > /proc/kexec-dump

If this is not set, the system will not do a kexec reboot in the event
of a panic.

-7) System reboots into the second kernel when a panic occurs.
+6) System reboots into the second kernel when a panic occurs.
You could write a module to call panic, for testing purposes.

-8) Write out the dump file using
+7) Write out the dump file using

cp /proc/vmcore <dump-file>

diff -puN include/linux/crash_dump.h~kd-misc-changes include/linux/crash_dump.h
--- linux-2.6.9-rc4/include/linux/crash_dump.h~kd-misc-changes 2004-10-21 15:10:58.000000000 +0530
+++ linux-2.6.9-rc4-hari/include/linux/crash_dump.h 2004-10-21 15:10:58.000000000 +0530
@@ -15,15 +15,20 @@ extern void elf_kcore_store_hdr(char *,
#ifdef CONFIG_CRASH_DUMP
extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, int);
extern void __crash_machine_kexec(void);
-extern void crash_enable_by_proc(void);
-extern void crash_create_proc_entry(void);
extern int crash_dump_on;
static inline void crash_machine_kexec(void)
{
__crash_machine_kexec();
}
#else
+#define crash_machine_kexec() do { } while(0)
+#endif
+
+
+#if defined(CONFIG_CRASH_DUMP) && defined(CONFIG_PROC_FS)
+extern void crash_enable_by_proc(void);
+extern void crash_create_proc_entry(void);
+#else
#define crash_enable_by_proc() do { } while(0)
#define crash_create_proc_entry() do { } while(0)
-#define crash_machine_kexec() do { } while(0)
#endif
diff -puN kernel/crash.c~kd-misc-changes kernel/crash.c
--- linux-2.6.9-rc4/kernel/crash.c~kd-misc-changes 2004-10-21 15:10:58.000000000 +0530
+++ linux-2.6.9-rc4-hari/kernel/crash.c 2004-10-21 15:10:58.000000000 +0530
@@ -16,6 +16,7 @@
#include <asm/io.h>
#include <asm/uaccess.h>

+#ifdef CONFIG_PROC_FS
/*
* Enable kexec reboot upon panic; for dumping
*/
@@ -57,6 +58,8 @@ void crash_create_proc_entry(void)
}
}

+#endif /* CONFIG_PROC_FS */
+
void __crash_machine_kexec(void)
{
struct kimage *image;
@@ -64,7 +67,7 @@ void __crash_machine_kexec(void)
if ((!crash_dump_on) || (crashed))
return;

- image = xchg(&kexec_image, 0);
+ image = xchg(&kexec_crash_image, 0);
if (image) {
crashed = 1;
printk(KERN_EMERG "kexec: opening parachute\n");
_
\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.053 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site