2007-01-08 07:58:12

by Vivek Goyal

[permalink] [raw]
Subject: [PATCH] Kdump documentation update for 2.6.20




o Kdump documentation update.
- Update details for using relocatable kernel.
- Start using kexec-tools-testing release as it is latest and old
kexec-tools can't load relocatable bzImage file.

Signed-off-by: Vivek Goyal <[email protected]>
---

Documentation/kdump/kdump.txt | 160 ++++++++++++++++++++++++++++++++++--------
1 file changed, 130 insertions(+), 30 deletions(-)

diff -puN Documentation/kdump/kdump.txt~kdump-documentation-update Documentation/kdump/kdump.txt
--- linux-2.6.20-rc2-mm1-reloc/Documentation/kdump/kdump.txt~kdump-documentation-update 2007-01-08 10:01:50.000000000 +0530
+++ linux-2.6.20-rc2-mm1-reloc-root/Documentation/kdump/kdump.txt 2007-01-08 11:51:49.000000000 +0530
@@ -54,56 +54,68 @@ memory," in two ways:
Setup and Installation
======================

-Install kexec-tools and the Kdump patch
----------------------------------------
+Install kexec-tools
+-------------------

1) Login as the root user.

2) Download the kexec-tools user-space package from the following URL:

- http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz
+http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20061214.tar.gz

-3) Unpack the tarball with the tar command, as follows:
-
- tar xvpzf kexec-tools-1.101.tar.gz
-
-4) Download the latest consolidated Kdump patch from the following URL:
-
- http://lse.sourceforge.net/kdump/
+Note: Latest kexec-tools-testing git tree is available at

- (This location is being used until all the user-space Kdump patches
- are integrated with the kexec-tools package.)
+git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git
+or
+http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary

-5) Change to the kexec-tools-1.101 directory, as follows:
+3) Unpack the tarball with the tar command, as follows:

- cd kexec-tools-1.101
+ tar xvpzf kexec-tools-testing-20061214.tar.gz

-6) Apply the consolidated patch to the kexec-tools-1.101 source tree
- with the patch command, as follows. (Modify the path to the downloaded
- patch as necessary.)
+4) Change to the kexec-tools-1.101 directory, as follows:

- patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch
+ cd kexec-tools-testing-20061214

-7) Configure the package, as follows:
+5) Configure the package, as follows:

./configure

-8) Compile the package, as follows:
+6) Compile the package, as follows:

make

-9) Install the package, as follows:
+7) Install the package, as follows:

make install


Download and build the system and dump-capture kernels
------------------------------------------------------
+There are two possible methods of using Kdump.
+
+ 1) Build a separate custom dump-capture kernel for capturing the
+ kernel core dump.
+
+ 2) Use system kernel itself as dump-capture kernel and there is
+ no need to build a separate dump-capture kernel. (Only for
+ i386 architecture kernel version 2.6.20 onwards)
+
+For i386, second method is recommended, as it takes away the need to build
+additional kernel.
+
+If you decide to use second option (Relocatable kernel), then directly jump to
+the section "Method 2".
+
+Method 1:
+--------

Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer)
-from http://www.kernel.org. Two kernels must be built: a system kernel
-and a dump-capture kernel. Use the following steps to configure these
-kernels with the necessary kexec and Kdump features:
+from http://www.kernel.org.
+
+Two kernels must be built: a system kernel and a dump-capture kernel.
+Use the following steps to configure these kernels with the necessary kexec
+and Kdump features:

System kernel
-------------
@@ -198,22 +210,110 @@ The dump-capture kernel
7) Make and install the kernel and its modules. DO NOT add this kernel
to the boot loader configuration files.

+Skip following section and directly jump to "Load the Dump-capture Kernel"
+section.
+
+Method 2:
+--------
+
+Build Relocatable bzImage for dump-capture kernel (i386 only)
+------------------------------------------------------------
+Kernel version 2.6.20 onwards, i386 kernel bzImage has become relocatable.
+That means, same kernel binary bzImage can be run from any physical address.
+This takes away the limitation of building a special dump-capture kernel
+compiled for a specific memory location for capturing the dump. Now one
+has the flexibility of using the system kernel itself as the dump capture
+kernel for i386.
+
+Download the mainline (vanilla) kernel source code (2.6.20-rc1 or newer)
+from http://www.kernel.org.
+
+1) Enable "kexec system call" in "Processor type and features."
+
+ CONFIG_KEXEC=y
+
+2) Enable "kernel crash dumps" support under "Processor type and
+ features"
+
+ CONFIG_CRASH_DUMP=y
+
+ Leave "Physical address where the kernel is loaded" unchanged. By
+ default it is set to 0x100000 (1MB).
+
+3) Enable "Build a relocatable kernel" support under "Processor type and
+ features"
+
+ CONFIG_RELOCATABLE=y
+
+4) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems".
+
+ CONFIG_PROC_VMCORE=y
+ (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
+
+5) On x86, enable high memory support under "Processor type and
+ features":
+
+ CONFIG_HIGHMEM64G=y
+ or
+ CONFIG_HIGHMEM4G
+
+6) Enable "Compile the kernel with debug info" in "Kernel hacking."
+
+ CONFIG_DEBUG_INFO=Y
+
+ This causes the kernel to be built with debug symbols. The dump
+ analysis tools require a vmlinux with debug symbols in order to read
+ and analyze a dump file.
+
+7) Enable "sysfs file system support" in "Filesystem" -> "Pseudo
+ filesystems." This is usually enabled by default.
+
+ CONFIG_SYSFS=y
+
+ Note that "sysfs file system support" might not appear in the "Pseudo
+ filesystems" menu if "Configure standard kernel features (for small
+ systems)" is not enabled in "General Setup." In this case, check the
+ .config file itself to ensure that sysfs is turned on, as follows:
+
+ grep 'CONFIG_SYSFS' .config
+
+8) Make and install the kernel and its modules. Update the boot loader
+ (such as grub, yaboot, or lilo) configuration files as necessary.
+
+9) Boot the system kernel with the boot parameter "crashkernel=Y@X",
+ where Y specifies how much memory to reserve for the dump-capture kernel
+ and X specifies the beginning of this reserved memory. For example,
+ "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
+ starting at physical address 0x01000000 for the dump-capture kernel.
+
+ On x86 and x86_64, use "crashkernel=64M@16M".

Load the Dump-capture Kernel
============================

-After booting to the system kernel, load the dump-capture kernel using
-the following command:
+After booting to the system kernel, dump-capture kernel needs to be
+loaded.

- kexec -p <dump-capture-kernel> \
+If you are using a separate dump capture kernel (method 1) then use
+following command to load dump-capture kernel.
+
+ kexec -p <dump-capture-kernel-vmlinux-image> \
--initrd=<initrd-for-dump-capture-kernel> --args-linux \
- --append="root=<root-dev> init 1 irqpoll"
+ --append="root=<root-dev> init 1 irqpoll maxcpus=1"
+
+If you are using a relocatable kernel (method 2), then use
+following command.

+ kexec -p <bzImage-of-relocatable-kernel> \
+ --initrd=<initrd-for-relocatable-kernel> \
+ --append="root=<root-dev> init 1 irqpoll maxcpus=1"

Notes on loading the dump-capture kernel:

-* <dump-capture-kernel> must be a vmlinux image (that is, an
- uncompressed ELF image). bzImage does not work at this time.
+* For method 1, <dump-capture-kernel> must be a vmlinux image.
+ (that is, an uncompressed ELF image). bzImage does not work at
+ this time. Using bzImage for dump capture kernel works only for
+ Relocatable kernel (method 2)

* By default, the ELF headers are stored in ELF64 format to support
systems with more than 4GB memory. The --elf32-core-headers option can
_


2007-01-09 01:19:32

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] Kdump documentation update for 2.6.20

On Mon, Jan 08, 2007 at 01:28:03PM +0530, Vivek Goyal wrote:
>
>
>
> o Kdump documentation update.
> - Update details for using relocatable kernel.
> - Start using kexec-tools-testing release as it is latest and old
> kexec-tools can't load relocatable bzImage file.
>
> Signed-off-by: Vivek Goyal <[email protected]>
> ---
>
> Documentation/kdump/kdump.txt | 160 ++++++++++++++++++++++++++++++++++--------
> 1 file changed, 130 insertions(+), 30 deletions(-)
>
> diff -puN Documentation/kdump/kdump.txt~kdump-documentation-update Documentation/kdump/kdump.txt
> --- linux-2.6.20-rc2-mm1-reloc/Documentation/kdump/kdump.txt~kdump-documentation-update 2007-01-08 10:01:50.000000000 +0530
> +++ linux-2.6.20-rc2-mm1-reloc-root/Documentation/kdump/kdump.txt 2007-01-08 11:51:49.000000000 +0530
> @@ -54,56 +54,68 @@ memory," in two ways:
> Setup and Installation
> ======================
>
> -Install kexec-tools and the Kdump patch
> ----------------------------------------
> +Install kexec-tools
> +-------------------
>
> 1) Login as the root user.
>
> 2) Download the kexec-tools user-space package from the following URL:
>
> - http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz
> +http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20061214.tar.gz
>
> -3) Unpack the tarball with the tar command, as follows:
> -
> - tar xvpzf kexec-tools-1.101.tar.gz
> -
> -4) Download the latest consolidated Kdump patch from the following URL:
> -
> - http://lse.sourceforge.net/kdump/
> +Note: Latest kexec-tools-testing git tree is available at
>
> - (This location is being used until all the user-space Kdump patches
> - are integrated with the kexec-tools package.)
> +git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git
> +or
> +http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary
>
> -5) Change to the kexec-tools-1.101 directory, as follows:
> +3) Unpack the tarball with the tar command, as follows:
>
> - cd kexec-tools-1.101
> + tar xvpzf kexec-tools-testing-20061214.tar.gz
>
> -6) Apply the consolidated patch to the kexec-tools-1.101 source tree
> - with the patch command, as follows. (Modify the path to the downloaded
> - patch as necessary.)
> +4) Change to the kexec-tools-1.101 directory, as follows:
>
> - patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch
> + cd kexec-tools-testing-20061214
>
> -7) Configure the package, as follows:
> +5) Configure the package, as follows:
>
> ./configure
>
> -8) Compile the package, as follows:
> +6) Compile the package, as follows:
>
> make
>
> -9) Install the package, as follows:
> +7) Install the package, as follows:
>
> make install
>
>
> Download and build the system and dump-capture kernels
> ------------------------------------------------------
> +There are two possible methods of using Kdump.
> +
> + 1) Build a separate custom dump-capture kernel for capturing the
> + kernel core dump.
> +
> + 2) Use system kernel itself as dump-capture kernel and there is
> + no need to build a separate dump-capture kernel. (Only for
> + i386 architecture kernel version 2.6.20 onwards)
> +
> +For i386, second method is recommended, as it takes away the need to build
> +additional kernel.

I think that the above description is a little misleading, and quite
i386 centric. The question is not weather or not you are using the
system kernel, but rather, what options are needed for the crash kernel.

In terms of a non-relocatable kernel, then the boot and crash kernels
need to be separate.

But in the case of a relocatable kernel, then the boot and crash kernels
may be the same, or they may be separate. Depending on just what
the end-user wants in each kernel.

On ia64 there is no CONFIG_RELOCATABLE option, but the kernel is always
relocatable anyway. That is, you can use the same kernel before and
after crash (though I am not sure that I have tested this).

I'm not sure about ppc64.

I think that the description of how to build the kernels also needs to
be reworked a little to reflect this. Perhaps you could divide the
methods based on vmlinuz/bzImage, rather than
non-relocatable/relocatable (or custom kernel/system kernel?). It seems
that it is the former, rather than the later that has impact on how
things work.

> +
> +If you decide to use second option (Relocatable kernel), then directly jump to
> +the section "Method 2".
> +
> +Method 1:
> +--------
>
> Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer)
> -from http://www.kernel.org. Two kernels must be built: a system kernel
> -and a dump-capture kernel. Use the following steps to configure these
> -kernels with the necessary kexec and Kdump features:
> +from http://www.kernel.org.
> +
> +Two kernels must be built: a system kernel and a dump-capture kernel.
> +Use the following steps to configure these kernels with the necessary kexec
> +and Kdump features:
>
> System kernel
> -------------
> @@ -198,22 +210,110 @@ The dump-capture kernel
> 7) Make and install the kernel and its modules. DO NOT add this kernel
> to the boot loader configuration files.
>
> +Skip following section and directly jump to "Load the Dump-capture Kernel"
> +section.
> +
> +Method 2:
> +--------
> +
> +Build Relocatable bzImage for dump-capture kernel (i386 only)
> +------------------------------------------------------------
> +Kernel version 2.6.20 onwards, i386 kernel bzImage has become relocatable.
> +That means, same kernel binary bzImage can be run from any physical address.
> +This takes away the limitation of building a special dump-capture kernel
> +compiled for a specific memory location for capturing the dump. Now one
> +has the flexibility of using the system kernel itself as the dump capture
> +kernel for i386.
> +
> +Download the mainline (vanilla) kernel source code (2.6.20-rc1 or newer)
> +from http://www.kernel.org.
> +
> +1) Enable "kexec system call" in "Processor type and features."
> +
> + CONFIG_KEXEC=y
> +
> +2) Enable "kernel crash dumps" support under "Processor type and
> + features"
> +
> + CONFIG_CRASH_DUMP=y
> +
> + Leave "Physical address where the kernel is loaded" unchanged. By
> + default it is set to 0x100000 (1MB).
> +
> +3) Enable "Build a relocatable kernel" support under "Processor type and
> + features"
> +
> + CONFIG_RELOCATABLE=y
> +
> +4) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems".
> +
> + CONFIG_PROC_VMCORE=y
> + (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
> +
> +5) On x86, enable high memory support under "Processor type and
> + features":
> +
> + CONFIG_HIGHMEM64G=y
> + or
> + CONFIG_HIGHMEM4G
> +
> +6) Enable "Compile the kernel with debug info" in "Kernel hacking."
> +
> + CONFIG_DEBUG_INFO=Y
> +
> + This causes the kernel to be built with debug symbols. The dump
> + analysis tools require a vmlinux with debug symbols in order to read
> + and analyze a dump file.
> +
> +7) Enable "sysfs file system support" in "Filesystem" -> "Pseudo
> + filesystems." This is usually enabled by default.
> +
> + CONFIG_SYSFS=y
> +
> + Note that "sysfs file system support" might not appear in the "Pseudo
> + filesystems" menu if "Configure standard kernel features (for small
> + systems)" is not enabled in "General Setup." In this case, check the
> + .config file itself to ensure that sysfs is turned on, as follows:
> +
> + grep 'CONFIG_SYSFS' .config
> +
> +8) Make and install the kernel and its modules. Update the boot loader
> + (such as grub, yaboot, or lilo) configuration files as necessary.
> +
> +9) Boot the system kernel with the boot parameter "crashkernel=Y@X",
> + where Y specifies how much memory to reserve for the dump-capture kernel
> + and X specifies the beginning of this reserved memory. For example,
> + "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
> + starting at physical address 0x01000000 for the dump-capture kernel.
> +
> + On x86 and x86_64, use "crashkernel=64M@16M".
>
> Load the Dump-capture Kernel
> ============================
>
> -After booting to the system kernel, load the dump-capture kernel using
> -the following command:
> +After booting to the system kernel, dump-capture kernel needs to be
> +loaded.
>
> - kexec -p <dump-capture-kernel> \
> +If you are using a separate dump capture kernel (method 1) then use
> +following command to load dump-capture kernel.
> +
> + kexec -p <dump-capture-kernel-vmlinux-image> \
> --initrd=<initrd-for-dump-capture-kernel> --args-linux \
> - --append="root=<root-dev> init 1 irqpoll"
> + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
> +
> +If you are using a relocatable kernel (method 2), then use
> +following command.
>
> + kexec -p <bzImage-of-relocatable-kernel> \
> + --initrd=<initrd-for-relocatable-kernel> \
> + --append="root=<root-dev> init 1 irqpoll maxcpus=1"

--args-linux is not needed on ia64, but its kernel is relocatable.
I think the important point is that if you are using a bzImage,
then you need --args-linux, and basically at this point that
means an i386 (or x86_64) relocatable bzImage.

Then again, I could be wrong, I'm not sure that I understand
--args-linux, I just know that I'm not using it :)

> Notes on loading the dump-capture kernel:
>
> -* <dump-capture-kernel> must be a vmlinux image (that is, an
> - uncompressed ELF image). bzImage does not work at this time.
> +* For method 1, <dump-capture-kernel> must be a vmlinux image.
> + (that is, an uncompressed ELF image). bzImage does not work at
> + this time. Using bzImage for dump capture kernel works only for
> + Relocatable kernel (method 2)
>
> * By default, the ELF headers are stored in ELF64 format to support
> systems with more than 4GB memory. The --elf32-core-headers option can
> _

--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/

2007-01-09 14:47:38

by Vivek Goyal

[permalink] [raw]
Subject: Re: [PATCH] Kdump documentation update for 2.6.20

On Tue, Jan 09, 2007 at 10:18:47AM +0900, Horms wrote:
> > Download and build the system and dump-capture kernels
> > ------------------------------------------------------
> > +There are two possible methods of using Kdump.
> > +
> > + 1) Build a separate custom dump-capture kernel for capturing the
> > + kernel core dump.
> > +
> > + 2) Use system kernel itself as dump-capture kernel and there is
> > + no need to build a separate dump-capture kernel. (Only for
> > + i386 architecture kernel version 2.6.20 onwards)
> > +
> > +For i386, second method is recommended, as it takes away the need to build
> > +additional kernel.
>
> I think that the above description is a little misleading, and quite
> i386 centric. The question is not weather or not you are using the
> system kernel, but rather, what options are needed for the crash kernel.
>
Hi Horms,

Thanks for going through the update. Actually I never knew that kdump
IA64 support is mainline now. I thought it is still in Tony's tree. And
we never had IA64 specific documentation in kdump.txt file and that's another
reason that discussion became more i386 centric when it came to relocatable
kernels.

> In terms of a non-relocatable kernel, then the boot and crash kernels
> need to be separate.
>
> But in the case of a relocatable kernel, then the boot and crash kernels
> may be the same, or they may be separate. Depending on just what
> the end-user wants in each kernel.
>
> On ia64 there is no CONFIG_RELOCATABLE option, but the kernel is always
> relocatable anyway. That is, you can use the same kernel before and
> after crash (though I am not sure that I have tested this).
>

I have tried to re-arrange the documentation based on some of your
recommendations. I have also left couple of sections empty which are
ia64 specific. I don't have an IA64 machine and I don't know how exactly
it is used on IA64. Can you please have a quick look at the patch and
also fill IA64 specific details where appropriate.

Hopefully, this time documentation is clearer.


Mohan, Can you please check the correctness of ppc64 specific details.

> > + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
> > +
> > +If you are using a relocatable kernel (method 2), then use
> > +following command.
> >
> > + kexec -p <bzImage-of-relocatable-kernel> \
> > + --initrd=<initrd-for-relocatable-kernel> \
> > + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
>
> --args-linux is not needed on ia64, but its kernel is relocatable.
> I think the important point is that if you are using a bzImage,
> then you need --args-linux, and basically at this point that
> means an i386 (or x86_64) relocatable bzImage.
>

I am hoping it --args-linux will be required while loading vmlinux on
IA64? Because this is ELF file specific option. And this interface should
be common across all the architectures.

> Then again, I could be wrong, I'm not sure that I understand
> --args-linux, I just know that I'm not using it :)


Thanks
Vivek


o Kdump documentation update.
- Update details for using relocatable kernel.
- Start using kexec-tools-testing release as it is latest and old
kexec-tools can't load relocatable bzImage file.
- Also add kdump on ia64 specific details.

Signed-off-by: Vivek Goyal <[email protected]>
---

Documentation/kdump/kdump.txt | 221 +++++++++++++++++++++++++++++-------------
1 file changed, 153 insertions(+), 68 deletions(-)

diff -puN Documentation/kdump/kdump.txt~kdump-documentation-update Documentation/kdump/kdump.txt
--- linux-2.6.20-rc2-mm1-reloc/Documentation/kdump/kdump.txt~kdump-documentation-update 2007-01-08 12:32:55.000000000 +0530
+++ linux-2.6.20-rc2-mm1-reloc-root/Documentation/kdump/kdump.txt 2007-01-09 19:57:06.000000000 +0530
@@ -17,7 +17,7 @@ You can use common Linux commands, such
memory image to a dump file on the local disk, or across the network to
a remote system.

-Kdump and kexec are currently supported on the x86, x86_64, and ppc64
+Kdump and kexec are currently supported on the x86, x86_64, ppc64 and IA64
architectures.

When the system kernel boots, it reserves a small section of memory for
@@ -54,59 +54,64 @@ memory," in two ways:
Setup and Installation
======================

-Install kexec-tools and the Kdump patch
----------------------------------------
+Install kexec-tools
+-------------------

1) Login as the root user.

2) Download the kexec-tools user-space package from the following URL:

- http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz
+http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20061214.tar.gz

-3) Unpack the tarball with the tar command, as follows:
-
- tar xvpzf kexec-tools-1.101.tar.gz
-
-4) Download the latest consolidated Kdump patch from the following URL:
+Note: Latest kexec-tools-testing git tree is available at

- http://lse.sourceforge.net/kdump/
+git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git
+or
+http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary

- (This location is being used until all the user-space Kdump patches
- are integrated with the kexec-tools package.)
-
-5) Change to the kexec-tools-1.101 directory, as follows:
+3) Unpack the tarball with the tar command, as follows:

- cd kexec-tools-1.101
+ tar xvpzf kexec-tools-testing-20061214.tar.gz

-6) Apply the consolidated patch to the kexec-tools-1.101 source tree
- with the patch command, as follows. (Modify the path to the downloaded
- patch as necessary.)
+4) Change to the kexec-tools-1.101 directory, as follows:

- patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch
+ cd kexec-tools-testing-20061214

-7) Configure the package, as follows:
+5) Configure the package, as follows:

./configure

-8) Compile the package, as follows:
+6) Compile the package, as follows:

make

-9) Install the package, as follows:
+7) Install the package, as follows:

make install


-Download and build the system and dump-capture kernels
-------------------------------------------------------
+Build the system and dump-capture kernels
+-----------------------------------------
+There are two possible methods of using Kdump.
+
+1) Build a separate custom dump-capture kernel for capturing the
+ kernel core dump.
+
+2) Or use the system kernel binary itself as dump-capture kernel and there is
+ no need to build a separate dump-capture kernel. This is possible
+ only with the architecutres which support a relocatable kernel. As
+ of today i386 and ia64 architectures support relocatable kernel.
+
+Building a relocatable kernel is advantageous from the point of view that
+one does not have to build a second kernel for capturing the dump. But
+at the same time one might want to build a custom dump capture kernel
+suitable to his needs.

-Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer)
-from http://www.kernel.org. Two kernels must be built: a system kernel
-and a dump-capture kernel. Use the following steps to configure these
-kernels with the necessary kexec and Kdump features:
+Following are the configuration setting required for system and
+dump-capture kernels for enabling kdump support.

-System kernel
--------------
+System kernel config options
+----------------------------

1) Enable "kexec system call" in "Processor type and features."

@@ -132,88 +137,169 @@ System kernel
analysis tools require a vmlinux with debug symbols in order to read
and analyze a dump file.

-4) Make and install the kernel and its modules. Update the boot loader
- (such as grub, yaboot, or lilo) configuration files as necessary.
+Dump-capture kernel config options (Arch Independent)
+-----------------------------------------------------

-5) Boot the system kernel with the boot parameter "crashkernel=Y@X",
- where Y specifies how much memory to reserve for the dump-capture kernel
- and X specifies the beginning of this reserved memory. For example,
- "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
- starting at physical address 0x01000000 for the dump-capture kernel.
+1) Enable "kernel crash dumps" support under "Processor type and
+ features":

- On x86 and x86_64, use "crashkernel=64M@16M".
+ CONFIG_CRASH_DUMP=y

- On ppc64, use "crashkernel=128M@32M".
+2) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems".
+
+ CONFIG_PROC_VMCORE=y
+ (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
+
+Dump-capture kernel config options (Arch Dependent, i386)
+--------------------------------------------------------
+1) On x86, enable high memory support under "Processor type and
+ features":

+ CONFIG_HIGHMEM64G=y
+ or
+ CONFIG_HIGHMEM4G

-The dump-capture kernel
------------------------
+2) On x86 and x86_64, disable symmetric multi-processing support
+ under "Processor type and features":

-1) Under "General setup," append "-kdump" to the current string in
- "Local version."
+ CONFIG_SMP=n

-2) On x86, enable high memory support under "Processor type and
+ (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
+ when loading the dump-capture kernel, see section "Load the Dump-capture
+ Kernel".)
+
+3) If one wants to build and use a relocatable kernel,
+ Enable "Build a relocatable kernel" support under "Processor type and
+ features"
+
+ CONFIG_RELOCATABLE=y
+
+4) Use a suitable value for "Physical address where the kernel is
+ loaded" (under "Processor type and features"). This only appears when
+ "kernel crash dumps" is enabled. A suitable value depends upon
+ whether kernel is relocatable or not.
+
+ If you are using a relocatable kernel use CONFIG_PHYSICAL_START=0x100000
+ This will compile the kernel for physical address 1MB, but given the fact
+ kernel is relocatable, it can be run from any physical address hence
+ kexec boot loader will load it in memory region reserved for dump-capture
+ kernel.
+
+ Otherwise it should be the start of memory region reserved for
+ second kernel using boot parameter "crashkernel=Y@X". Here X is
+ start of memory region reserved for dump-capture kernel.
+ Generally X is 16MB (0x1000000). So you can set
+ CONFIG_PHYSICAL_START=0x1000000
+
+5) Make and install the kernel and its modules. DO NOT add this kernel
+ to the boot loader configuration files.
+
+Dump-capture kernel config options (Arch Dependent, x86_64)
+----------------------------------------------------------
+1) On x86, enable high memory support under "Processor type and
features":

CONFIG_HIGHMEM64G=y
or
CONFIG_HIGHMEM4G

-3) On x86 and x86_64, disable symmetric multi-processing support
+2) On x86 and x86_64, disable symmetric multi-processing support
under "Processor type and features":

CONFIG_SMP=n
+
(If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
when loading the dump-capture kernel, see section "Load the Dump-capture
Kernel".)

-4) On ppc64, disable NUMA support and enable EMBEDDED support:
+3) Use a suitable value for "Physical address where the kernel is
+ loaded" (under "Processor type and features"). This only appears when
+ "kernel crash dumps" is enabled. By default this value is 0x1000000
+ (16MB). It should be the same as X in the "crashkernel=Y@X" boot
+ parameter.
+
+ For x86_64, normally "CONFIG_PHYSICAL_START=0x1000000".
+
+4) Make and install the kernel and its modules. DO NOT add this kernel
+ to the boot loader configuration files.
+
+Dump-capture kernel config options (Arch Dependent, ppc64)
+----------------------------------------------------------
+
+1) On ppc64, disable NUMA support and enable EMBEDDED support:

CONFIG_NUMA=n
CONFIG_EMBEDDED=y
CONFIG_EEH=N for the dump-capture kernel

-5) Enable "kernel crash dumps" support under "Processor type and
- features":
-
- CONFIG_CRASH_DUMP=y
-
-6) Use a suitable value for "Physical address where the kernel is
+2) Use a suitable value for "Physical address where the kernel is
loaded" (under "Processor type and features"). This only appears when
"kernel crash dumps" is enabled. By default this value is 0x1000000
(16MB). It should be the same as X in the "crashkernel=Y@X" boot
parameter discussed above.

- On x86 and x86_64, use "CONFIG_PHYSICAL_START=0x1000000".
-
On ppc64 the value is automatically set at 32MB when
CONFIG_CRASH_DUMP is set.

-6) Optionally enable "/proc/vmcore support" under "Filesystems" ->
- "Pseudo filesystems".
+3) Make and install the kernel and its modules. DO NOT add this kernel
+ to the boot loader configuration files.

- CONFIG_PROC_VMCORE=y
- (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
+Dump-capture kernel config options (Arch Dependent, ia64)
+----------------------------------------------------------
+(To be filled)

-7) Make and install the kernel and its modules. DO NOT add this kernel
- to the boot loader configuration files.

+Boot into System Kernel
+=======================
+
+1) Make and install the kernel and its modules. Update the boot loader
+ (such as grub, yaboot, or lilo) configuration files as necessary.
+
+2) Boot the system kernel with the boot parameter "crashkernel=Y@X",
+ where Y specifies how much memory to reserve for the dump-capture kernel
+ and X specifies the beginning of this reserved memory. For example,
+ "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
+ starting at physical address 0x01000000 (16MB) for the dump-capture kernel.
+
+ On x86 and x86_64, use "crashkernel=64M@16M".
+
+ On ppc64, use "crashkernel=128M@32M".

Load the Dump-capture Kernel
============================

-After booting to the system kernel, load the dump-capture kernel using
-the following command:
+After booting to the system kernel, dump-capture kernel needs to be
+loaded.
+
+Based on the architecture and type of image (relocatable or not), one
+can choose to load the uncompressed vmlinux or compressed bzImage/vmlinuz
+of dump-capture kernel. Following is the summary.
+
+For i386:
+ - Use vmlinux if kernel is not relocatable.
+ - Use bzImage/vmlinuz if kernel is relocatable.
+For x86_64:
+ - Use vmlinux
+For ppc64:
+ - Use vmlinux
+For ia64:
+ (To be filled)

- kexec -p <dump-capture-kernel> \
+If you are using a uncompressed vmlinux image then use following command
+to load dump-capture kernel.
+
+ kexec -p <dump-capture-kernel-vmlinux-image> \
--initrd=<initrd-for-dump-capture-kernel> --args-linux \
- --append="root=<root-dev> init 1 irqpoll"
+ --append="root=<root-dev> init 1 irqpoll maxcpus=1"

+If you are using a compressed bzImage/vmlinuz, then use following command
+to load dump-capture kernel.

-Notes on loading the dump-capture kernel:
+ kexec -p <dump-capture-kernel-bzImage> \
+ --initrd=<initrd-for-dump-capture-kernel> \
+ --append="root=<root-dev> init 1 irqpoll maxcpus=1"

-* <dump-capture-kernel> must be a vmlinux image (that is, an
- uncompressed ELF image). bzImage does not work at this time.
+Notes on loading the dump-capture kernel:

* By default, the ELF headers are stored in ELF64 format to support
systems with more than 4GB memory. The --elf32-core-headers option can
@@ -231,7 +317,6 @@ Notes on loading the dump-capture kernel
* "init 1" boots the dump-capture kernel into single-user mode without
networking. If you want networking, use "init 3."

-
Kernel Panic
============

_

2007-01-10 00:42:05

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] Kdump documentation update for 2.6.20

On Tue, Jan 09, 2007 at 08:17:08PM +0530, Vivek Goyal wrote:
> On Tue, Jan 09, 2007 at 10:18:47AM +0900, Horms wrote:
> > > Download and build the system and dump-capture kernels
> > > ------------------------------------------------------
> > > +There are two possible methods of using Kdump.
> > > +
> > > + 1) Build a separate custom dump-capture kernel for capturing the
> > > + kernel core dump.
> > > +
> > > + 2) Use system kernel itself as dump-capture kernel and there is
> > > + no need to build a separate dump-capture kernel. (Only for
> > > + i386 architecture kernel version 2.6.20 onwards)
> > > +
> > > +For i386, second method is recommended, as it takes away the need to build
> > > +additional kernel.
> >
> > I think that the above description is a little misleading, and quite
> > i386 centric. The question is not weather or not you are using the
> > system kernel, but rather, what options are needed for the crash kernel.
> >
> Hi Horms,
>
> Thanks for going through the update. Actually I never knew that kdump
> IA64 support is mainline now. I thought it is still in Tony's tree. And
> we never had IA64 specific documentation in kdump.txt file and that's another
> reason that discussion became more i386 centric when it came to relocatable
> kernels.

It wasn't that long ago it was merged, but its there now :)

> > In terms of a non-relocatable kernel, then the boot and crash kernels
> > need to be separate.
> >
> > But in the case of a relocatable kernel, then the boot and crash kernels
> > may be the same, or they may be separate. Depending on just what
> > the end-user wants in each kernel.
> >
> > On ia64 there is no CONFIG_RELOCATABLE option, but the kernel is always
> > relocatable anyway. That is, you can use the same kernel before and
> > after crash (though I am not sure that I have tested this).
> >
>
> I have tried to re-arrange the documentation based on some of your
> recommendations. I have also left couple of sections empty which are
> ia64 specific. I don't have an IA64 machine and I don't know how exactly
> it is used on IA64. Can you please have a quick look at the patch and
> also fill IA64 specific details where appropriate.

Sure, will do.

> Hopefully, this time documentation is clearer.
>
>
> Mohan, Can you please check the correctness of ppc64 specific details.
>
> > > + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
> > > +
> > > +If you are using a relocatable kernel (method 2), then use
> > > +following command.
> > >
> > > + kexec -p <bzImage-of-relocatable-kernel> \
> > > + --initrd=<initrd-for-relocatable-kernel> \
> > > + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
> >
> > --args-linux is not needed on ia64, but its kernel is relocatable.
> > I think the important point is that if you are using a bzImage,
> > then you need --args-linux, and basically at this point that
> > means an i386 (or x86_64) relocatable bzImage.
> >
>
> I am hoping it --args-linux will be required while loading vmlinux on
> IA64? Because this is ELF file specific option. And this interface should
> be common across all the architectures.
>
> > Then again, I could be wrong, I'm not sure that I understand
> > --args-linux, I just know that I'm not using it :)

I will take a look into this.

--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/

2007-01-10 01:36:08

by Zou, Nanhai

[permalink] [raw]
Subject: RE: [PATCH] Kdump documentation update for 2.6.20

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Horms
> Sent: 2007??1??10?? 8:31
> To: Vivek Goyal
> Cc: linux kernel mailing list; Fastboot mailing list; Morton Andrew Morton;
> Mohan Kumar M
> Subject: Re: [PATCH] Kdump documentation update for 2.6.20
>
> On Tue, Jan 09, 2007 at 08:17:08PM +0530, Vivek Goyal wrote:
> > On Tue, Jan 09, 2007 at 10:18:47AM +0900, Horms wrote:
> > > > Download and build the system and dump-capture kernels
> > > > ------------------------------------------------------
> > > > +There are two possible methods of using Kdump.
> > > > +
> > > > + 1) Build a separate custom dump-capture kernel for capturing the
> > > > + kernel core dump.
> > > > +
> > > > + 2) Use system kernel itself as dump-capture kernel and there is
> > > > + no need to build a separate dump-capture kernel. (Only for
> > > > + i386 architecture kernel version 2.6.20 onwards)
> > > > +
> > > > +For i386, second method is recommended, as it takes away the need to
> build
> > > > +additional kernel.
> > >
> > > I think that the above description is a little misleading, and quite
> > > i386 centric. The question is not weather or not you are using the
> > > system kernel, but rather, what options are needed for the crash kernel.
> > >
> > Hi Horms,
> >
> > Thanks for going through the update. Actually I never knew that kdump
> > IA64 support is mainline now. I thought it is still in Tony's tree. And
> > we never had IA64 specific documentation in kdump.txt file and that's another
> > reason that discussion became more i386 centric when it came to relocatable
> > kernels.
>
> It wasn't that long ago it was merged, but its there now :)
>
> > > In terms of a non-relocatable kernel, then the boot and crash kernels
> > > need to be separate.
> > >
> > > But in the case of a relocatable kernel, then the boot and crash kernels
> > > may be the same, or they may be separate. Depending on just what
> > > the end-user wants in each kernel.
> > >
> > > On ia64 there is no CONFIG_RELOCATABLE option, but the kernel is always
> > > relocatable anyway. That is, you can use the same kernel before and
> > > after crash (though I am not sure that I have tested this).
> > >
> >
> > I have tried to re-arrange the documentation based on some of your
> > recommendations. I have also left couple of sections empty which are
> > ia64 specific. I don't have an IA64 machine and I don't know how exactly
> > it is used on IA64. Can you please have a quick look at the patch and
> > also fill IA64 specific details where appropriate.
>
> Sure, will do.
>
> > Hopefully, this time documentation is clearer.
> >
> >
> > Mohan, Can you please check the correctness of ppc64 specific details.
> >
> > > > + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
> > > > +
> > > > +If you are using a relocatable kernel (method 2), then use
> > > > +following command.
> > > >
> > > > + kexec -p <bzImage-of-relocatable-kernel> \
> > > > + --initrd=<initrd-for-relocatable-kernel> \
> > > > + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
> > >
> > > --args-linux is not needed on ia64, but its kernel is relocatable.
> > > I think the important point is that if you are using a bzImage,
> > > then you need --args-linux, and basically at this point that
> > > means an i386 (or x86_64) relocatable bzImage.
> > >
> >
> > I am hoping it --args-linux will be required while loading vmlinux on
> > IA64? Because this is ELF file specific option. And this interface should
> > be common across all the architectures.
> >
> > > Then again, I could be wrong, I'm not sure that I understand
> > > --args-linux, I just know that I'm not using it :)
>
> I will take a look into this.
>
args-linux is not support by IA64 kdump.
To have common interface, maybe we should support it by ignore this arg like ppc does.

Zou Nan hai
> --

2007-01-10 01:53:51

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] Kdump documentation update for 2.6.20

On Wed, Jan 10, 2007 at 09:34:12AM +0800, Zou, Nanhai wrote:
> > >
> > > I am hoping it --args-linux will be required while loading vmlinux on
> > > IA64? Because this is ELF file specific option. And this interface should
> > > be common across all the architectures.
> > >
> > > > Then again, I could be wrong, I'm not sure that I understand
> > > > --args-linux, I just know that I'm not using it :)
> >
> > I will take a look into this.
> >
> args-linux is not support by IA64 kdump.
> To have common interface, maybe we should support it by ignore this
> arg like ppc does.

That sounds reasonable to me. Vivek, what do you think?

--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/

2007-01-10 04:43:21

by Vivek Goyal

[permalink] [raw]
Subject: Re: [PATCH] Kdump documentation update for 2.6.20

On Wed, Jan 10, 2007 at 10:53:34AM +0900, Horms wrote:
> On Wed, Jan 10, 2007 at 09:34:12AM +0800, Zou, Nanhai wrote:
> > > >
> > > > I am hoping it --args-linux will be required while loading vmlinux on
> > > > IA64? Because this is ELF file specific option. And this interface should
> > > > be common across all the architectures.
> > > >
> > > > > Then again, I could be wrong, I'm not sure that I understand
> > > > > --args-linux, I just know that I'm not using it :)
> > >
> > > I will take a look into this.
> > >
> > args-linux is not support by IA64 kdump.
> > To have common interface, maybe we should support it by ignore this
> > arg like ppc does.
>
> That sounds reasonable to me. Vivek, what do you think?
>

I think we should recognize --args-linux while loading elf image and
all the processing we do for loading linux elf vmlinux should be done
under that option (The way i386 does). This will help if down the line
kexec ia64 loader allows loading some other elf images where one needs
to prepare elf boot notes (--args-elf).

Eric is the best person to comment on this. He has got all the background
about these options.

Thanks
Vivek

2007-01-10 05:37:59

by M. Mohan Kumar

[permalink] [raw]
Subject: Re: [PATCH] Kdump documentation update for 2.6.20

On Tue, Jan 09, 2007 at 08:17:08PM +0530, Vivek Goyal wrote:
>
> Mohan, Can you please check the correctness of ppc64 specific details.
>

Vivek,

My inputs.

> > > + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
> > > +
> > > +If you are using a relocatable kernel (method 2), then use
> > > +following command.
> > >
> > > + kexec -p <bzImage-of-relocatable-kernel> \
> > > + --initrd=<initrd-for-relocatable-kernel> \
> > > + --append="root=<root-dev> init 1 irqpoll maxcpus=1"
> >
> > --args-linux is not needed on ia64, but its kernel is relocatable.
> > I think the important point is that if you are using a bzImage,
> > then you need --args-linux, and basically at this point that
> > means an i386 (or x86_64) relocatable bzImage.
> >
>
> I am hoping it --args-linux will be required while loading vmlinux on
> IA64? Because this is ELF file specific option. And this interface should
> be common across all the architectures.
>
> > Then again, I could be wrong, I'm not sure that I understand
> > --args-linux, I just know that I'm not using it :)
>
>
> Thanks
> Vivek
>
>
> o Kdump documentation update.
> - Update details for using relocatable kernel.
> - Start using kexec-tools-testing release as it is latest and old
> kexec-tools can't load relocatable bzImage file.
> - Also add kdump on ia64 specific details.
>
> Signed-off-by: Vivek Goyal <[email protected]>
> ---
>
> Documentation/kdump/kdump.txt | 221 +++++++++++++++++++++++++++++-------------
> 1 file changed, 153 insertions(+), 68 deletions(-)
>
> diff -puN Documentation/kdump/kdump.txt~kdump-documentation-update Documentation/kdump/kdump.txt
> --- linux-2.6.20-rc2-mm1-reloc/Documentation/kdump/kdump.txt~kdump-documentation-update 2007-01-08 12:32:55.000000000 +0530
> +++ linux-2.6.20-rc2-mm1-reloc-root/Documentation/kdump/kdump.txt 2007-01-09 19:57:06.000000000 +0530
> @@ -17,7 +17,7 @@ You can use common Linux commands, such
> memory image to a dump file on the local disk, or across the network to
> a remote system.
>
> -Kdump and kexec are currently supported on the x86, x86_64, and ppc64
> +Kdump and kexec are currently supported on the x86, x86_64, ppc64 and IA64
> architectures.
>
> When the system kernel boots, it reserves a small section of memory for
> @@ -54,59 +54,64 @@ memory," in two ways:
> Setup and Installation
> ======================
>
> -Install kexec-tools and the Kdump patch
> ----------------------------------------
> +Install kexec-tools
> +-------------------
>
> 1) Login as the root user.
>
> 2) Download the kexec-tools user-space package from the following URL:
>
> - http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz
> +http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20061214.tar.gz
>
> -3) Unpack the tarball with the tar command, as follows:
> -
> - tar xvpzf kexec-tools-1.101.tar.gz
> -
> -4) Download the latest consolidated Kdump patch from the following URL:
> +Note: Latest kexec-tools-testing git tree is available at
>
> - http://lse.sourceforge.net/kdump/
> +git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git
> +or
> +http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary
>
> - (This location is being used until all the user-space Kdump patches
> - are integrated with the kexec-tools package.)
> -
> -5) Change to the kexec-tools-1.101 directory, as follows:
> +3) Unpack the tarball with the tar command, as follows:
>
> - cd kexec-tools-1.101
> + tar xvpzf kexec-tools-testing-20061214.tar.gz
>
> -6) Apply the consolidated patch to the kexec-tools-1.101 source tree
> - with the patch command, as follows. (Modify the path to the downloaded
> - patch as necessary.)
> +4) Change to the kexec-tools-1.101 directory, as follows:
>
> - patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch
> + cd kexec-tools-testing-20061214
>
> -7) Configure the package, as follows:
> +5) Configure the package, as follows:
>
> ./configure
>
> -8) Compile the package, as follows:
> +6) Compile the package, as follows:
>
> make
>
> -9) Install the package, as follows:
> +7) Install the package, as follows:
>
> make install
>
>
> -Download and build the system and dump-capture kernels
> -------------------------------------------------------
> +Build the system and dump-capture kernels
> +-----------------------------------------
> +There are two possible methods of using Kdump.
> +
> +1) Build a separate custom dump-capture kernel for capturing the
> + kernel core dump.
> +
> +2) Or use the system kernel binary itself as dump-capture kernel and there is
> + no need to build a separate dump-capture kernel. This is possible
> + only with the architecutres which support a relocatable kernel. As
> + of today i386 and ia64 architectures support relocatable kernel.
> +
> +Building a relocatable kernel is advantageous from the point of view that
> +one does not have to build a second kernel for capturing the dump. But
> +at the same time one might want to build a custom dump capture kernel
> +suitable to his needs.
>
> -Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer)
> -from http://www.kernel.org. Two kernels must be built: a system kernel
> -and a dump-capture kernel. Use the following steps to configure these
> -kernels with the necessary kexec and Kdump features:
> +Following are the configuration setting required for system and
> +dump-capture kernels for enabling kdump support.
>
> -System kernel
> --------------
> +System kernel config options
> +----------------------------
>
> 1) Enable "kexec system call" in "Processor type and features."
>
> @@ -132,88 +137,169 @@ System kernel
> analysis tools require a vmlinux with debug symbols in order to read
> and analyze a dump file.
>
> -4) Make and install the kernel and its modules. Update the boot loader
> - (such as grub, yaboot, or lilo) configuration files as necessary.
> +Dump-capture kernel config options (Arch Independent)
> +-----------------------------------------------------
>
> -5) Boot the system kernel with the boot parameter "crashkernel=Y@X",
> - where Y specifies how much memory to reserve for the dump-capture kernel
> - and X specifies the beginning of this reserved memory. For example,
> - "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
> - starting at physical address 0x01000000 for the dump-capture kernel.
> +1) Enable "kernel crash dumps" support under "Processor type and
> + features":
>
> - On x86 and x86_64, use "crashkernel=64M@16M".
> + CONFIG_CRASH_DUMP=y
>
> - On ppc64, use "crashkernel=128M@32M".
> +2) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems".
> +
> + CONFIG_PROC_VMCORE=y
> + (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
> +
> +Dump-capture kernel config options (Arch Dependent, i386)
> +--------------------------------------------------------
> +1) On x86, enable high memory support under "Processor type and
> + features":
>
> + CONFIG_HIGHMEM64G=y
> + or
> + CONFIG_HIGHMEM4G
>
> -The dump-capture kernel
> ------------------------
> +2) On x86 and x86_64, disable symmetric multi-processing support
> + under "Processor type and features":
>
> -1) Under "General setup," append "-kdump" to the current string in
> - "Local version."
> + CONFIG_SMP=n
>
> -2) On x86, enable high memory support under "Processor type and
> + (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
> + when loading the dump-capture kernel, see section "Load the Dump-capture
> + Kernel".)
> +
> +3) If one wants to build and use a relocatable kernel,
> + Enable "Build a relocatable kernel" support under "Processor type and
> + features"
> +
> + CONFIG_RELOCATABLE=y
> +
> +4) Use a suitable value for "Physical address where the kernel is
> + loaded" (under "Processor type and features"). This only appears when
> + "kernel crash dumps" is enabled. A suitable value depends upon
> + whether kernel is relocatable or not.
> +
> + If you are using a relocatable kernel use CONFIG_PHYSICAL_START=0x100000
> + This will compile the kernel for physical address 1MB, but given the fact
> + kernel is relocatable, it can be run from any physical address hence
> + kexec boot loader will load it in memory region reserved for dump-capture
> + kernel.
> +
> + Otherwise it should be the start of memory region reserved for
> + second kernel using boot parameter "crashkernel=Y@X". Here X is
> + start of memory region reserved for dump-capture kernel.
> + Generally X is 16MB (0x1000000). So you can set
> + CONFIG_PHYSICAL_START=0x1000000
> +
> +5) Make and install the kernel and its modules. DO NOT add this kernel
> + to the boot loader configuration files.
> +
> +Dump-capture kernel config options (Arch Dependent, x86_64)
> +----------------------------------------------------------
> +1) On x86, enable high memory support under "Processor type and
> features":
>
> CONFIG_HIGHMEM64G=y
> or
> CONFIG_HIGHMEM4G
>
> -3) On x86 and x86_64, disable symmetric multi-processing support
> +2) On x86 and x86_64, disable symmetric multi-processing support
> under "Processor type and features":
>
> CONFIG_SMP=n
> +
> (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
> when loading the dump-capture kernel, see section "Load the Dump-capture
> Kernel".)
>
> -4) On ppc64, disable NUMA support and enable EMBEDDED support:
> +3) Use a suitable value for "Physical address where the kernel is
> + loaded" (under "Processor type and features"). This only appears when
> + "kernel crash dumps" is enabled. By default this value is 0x1000000
> + (16MB). It should be the same as X in the "crashkernel=Y@X" boot
> + parameter.
> +
> + For x86_64, normally "CONFIG_PHYSICAL_START=0x1000000".
> +
> +4) Make and install the kernel and its modules. DO NOT add this kernel
> + to the boot loader configuration files.
> +
> +Dump-capture kernel config options (Arch Dependent, ppc64)
> +----------------------------------------------------------
> +
> +1) On ppc64, disable NUMA support and enable EMBEDDED support:
>
It is not true, kdump on ppc64 works with NUMA and EEH enabled. So the
user need not disable NUMA and enable EMBEDDED support to make kdump
work on PPC64.

> CONFIG_NUMA=n
> CONFIG_EMBEDDED=y
> CONFIG_EEH=N for the dump-capture kernel
>
> -5) Enable "kernel crash dumps" support under "Processor type and
> - features":
> -
> - CONFIG_CRASH_DUMP=y
> -
> -6) Use a suitable value for "Physical address where the kernel is
> +2) Use a suitable value for "Physical address where the kernel is
> loaded" (under "Processor type and features"). This only appears when
> "kernel crash dumps" is enabled. By default this value is 0x1000000
> (16MB). It should be the same as X in the "crashkernel=Y@X" boot
> parameter discussed above.

Should we mention the above paragraph?
Why can not we specify by default PPC64 kdump kernel is loaded at 32MB?

Regards,
Mohan.

2007-01-10 09:15:51

by Vivek Goyal

[permalink] [raw]
Subject: Re: [PATCH] Kdump documentation update for 2.6.20

On Wed, Jan 10, 2007 at 11:07:05AM +0530, Mohan Kumar M wrote:
> On Tue, Jan 09, 2007 at 08:17:08PM +0530, Vivek Goyal wrote:
> >
> > Mohan, Can you please check the correctness of ppc64 specific details.
> >
>
> Vivek,
>
> My inputs.
>

Thanks Mohan. I have updated the document as per your feedback.

Please find attached the latest patch.

Thanks
Vivek


o Kdump documentation update.
- Update details for using relocatable kernel.
- Start using kexec-tools-testing release as it is latest and old
kexec-tools can't load relocatable bzImage file.
- Also add kdump on ia64 specific details.

Signed-off-by: Vivek Goyal <[email protected]>
---

Documentation/kdump/kdump.txt | 224 ++++++++++++++++++++++++++++--------------
1 file changed, 152 insertions(+), 72 deletions(-)

diff -puN Documentation/kdump/kdump.txt~kdump-documentation-update Documentation/kdump/kdump.txt
--- linux-2.6.20-rc2-mm1-reloc/Documentation/kdump/kdump.txt~kdump-documentation-update 2007-01-08 12:32:55.000000000 +0530
+++ linux-2.6.20-rc2-mm1-reloc-root/Documentation/kdump/kdump.txt 2007-01-10 14:38:58.000000000 +0530
@@ -17,7 +17,7 @@ You can use common Linux commands, such
memory image to a dump file on the local disk, or across the network to
a remote system.

-Kdump and kexec are currently supported on the x86, x86_64, and ppc64
+Kdump and kexec are currently supported on the x86, x86_64, ppc64 and IA64
architectures.

When the system kernel boots, it reserves a small section of memory for
@@ -54,59 +54,64 @@ memory," in two ways:
Setup and Installation
======================

-Install kexec-tools and the Kdump patch
----------------------------------------
+Install kexec-tools
+-------------------

1) Login as the root user.

2) Download the kexec-tools user-space package from the following URL:

- http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz
+http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20061214.tar.gz

-3) Unpack the tarball with the tar command, as follows:
-
- tar xvpzf kexec-tools-1.101.tar.gz
-
-4) Download the latest consolidated Kdump patch from the following URL:
-
- http://lse.sourceforge.net/kdump/
+Note: Latest kexec-tools-testing git tree is available at

- (This location is being used until all the user-space Kdump patches
- are integrated with the kexec-tools package.)
+git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git
+or
+http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary

-5) Change to the kexec-tools-1.101 directory, as follows:
+3) Unpack the tarball with the tar command, as follows:

- cd kexec-tools-1.101
+ tar xvpzf kexec-tools-testing-20061214.tar.gz

-6) Apply the consolidated patch to the kexec-tools-1.101 source tree
- with the patch command, as follows. (Modify the path to the downloaded
- patch as necessary.)
+4) Change to the kexec-tools-1.101 directory, as follows:

- patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch
+ cd kexec-tools-testing-20061214

-7) Configure the package, as follows:
+5) Configure the package, as follows:

./configure

-8) Compile the package, as follows:
+6) Compile the package, as follows:

make

-9) Install the package, as follows:
+7) Install the package, as follows:

make install


-Download and build the system and dump-capture kernels
-------------------------------------------------------
+Build the system and dump-capture kernels
+-----------------------------------------
+There are two possible methods of using Kdump.
+
+1) Build a separate custom dump-capture kernel for capturing the
+ kernel core dump.
+
+2) Or use the system kernel binary itself as dump-capture kernel and there is
+ no need to build a separate dump-capture kernel. This is possible
+ only with the architecutres which support a relocatable kernel. As
+ of today i386 and ia64 architectures support relocatable kernel.
+
+Building a relocatable kernel is advantageous from the point of view that
+one does not have to build a second kernel for capturing the dump. But
+at the same time one might want to build a custom dump capture kernel
+suitable to his needs.

-Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer)
-from http://www.kernel.org. Two kernels must be built: a system kernel
-and a dump-capture kernel. Use the following steps to configure these
-kernels with the necessary kexec and Kdump features:
+Following are the configuration setting required for system and
+dump-capture kernels for enabling kdump support.

-System kernel
--------------
+System kernel config options
+----------------------------

1) Enable "kexec system call" in "Processor type and features."

@@ -132,88 +137,160 @@ System kernel
analysis tools require a vmlinux with debug symbols in order to read
and analyze a dump file.

-4) Make and install the kernel and its modules. Update the boot loader
- (such as grub, yaboot, or lilo) configuration files as necessary.
+Dump-capture kernel config options (Arch Independent)
+-----------------------------------------------------

-5) Boot the system kernel with the boot parameter "crashkernel=Y@X",
- where Y specifies how much memory to reserve for the dump-capture kernel
- and X specifies the beginning of this reserved memory. For example,
- "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
- starting at physical address 0x01000000 for the dump-capture kernel.
-
- On x86 and x86_64, use "crashkernel=64M@16M".
-
- On ppc64, use "crashkernel=128M@32M".
+1) Enable "kernel crash dumps" support under "Processor type and
+ features":

+ CONFIG_CRASH_DUMP=y

-The dump-capture kernel
------------------------
+2) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems".

-1) Under "General setup," append "-kdump" to the current string in
- "Local version."
+ CONFIG_PROC_VMCORE=y
+ (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)

-2) On x86, enable high memory support under "Processor type and
+Dump-capture kernel config options (Arch Dependent, i386)
+--------------------------------------------------------
+1) On x86, enable high memory support under "Processor type and
features":

CONFIG_HIGHMEM64G=y
or
CONFIG_HIGHMEM4G

-3) On x86 and x86_64, disable symmetric multi-processing support
+2) On x86 and x86_64, disable symmetric multi-processing support
under "Processor type and features":

CONFIG_SMP=n
+
(If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
when loading the dump-capture kernel, see section "Load the Dump-capture
Kernel".)

-4) On ppc64, disable NUMA support and enable EMBEDDED support:
+3) If one wants to build and use a relocatable kernel,
+ Enable "Build a relocatable kernel" support under "Processor type and
+ features"

- CONFIG_NUMA=n
- CONFIG_EMBEDDED=y
- CONFIG_EEH=N for the dump-capture kernel
+ CONFIG_RELOCATABLE=y

-5) Enable "kernel crash dumps" support under "Processor type and
- features":
+4) Use a suitable value for "Physical address where the kernel is
+ loaded" (under "Processor type and features"). This only appears when
+ "kernel crash dumps" is enabled. A suitable value depends upon
+ whether kernel is relocatable or not.

- CONFIG_CRASH_DUMP=y
+ If you are using a relocatable kernel use CONFIG_PHYSICAL_START=0x100000
+ This will compile the kernel for physical address 1MB, but given the fact
+ kernel is relocatable, it can be run from any physical address hence
+ kexec boot loader will load it in memory region reserved for dump-capture
+ kernel.
+
+ Otherwise it should be the start of memory region reserved for
+ second kernel using boot parameter "crashkernel=Y@X". Here X is
+ start of memory region reserved for dump-capture kernel.
+ Generally X is 16MB (0x1000000). So you can set
+ CONFIG_PHYSICAL_START=0x1000000
+
+5) Make and install the kernel and its modules. DO NOT add this kernel
+ to the boot loader configuration files.
+
+Dump-capture kernel config options (Arch Dependent, x86_64)
+----------------------------------------------------------
+1) On x86 and x86_64, disable symmetric multi-processing support
+ under "Processor type and features":
+
+ CONFIG_SMP=n

-6) Use a suitable value for "Physical address where the kernel is
+ (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
+ when loading the dump-capture kernel, see section "Load the Dump-capture
+ Kernel".)
+
+2) Use a suitable value for "Physical address where the kernel is
loaded" (under "Processor type and features"). This only appears when
"kernel crash dumps" is enabled. By default this value is 0x1000000
(16MB). It should be the same as X in the "crashkernel=Y@X" boot
- parameter discussed above.
+ parameter.

- On x86 and x86_64, use "CONFIG_PHYSICAL_START=0x1000000".
+ For x86_64, normally "CONFIG_PHYSICAL_START=0x1000000".

- On ppc64 the value is automatically set at 32MB when
- CONFIG_CRASH_DUMP is set.
+3) Make and install the kernel and its modules. DO NOT add this kernel
+ to the boot loader configuration files.

-6) Optionally enable "/proc/vmcore support" under "Filesystems" ->
- "Pseudo filesystems".
+Dump-capture kernel config options (Arch Dependent, ppc64)
+----------------------------------------------------------

- CONFIG_PROC_VMCORE=y
- (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
-
-7) Make and install the kernel and its modules. DO NOT add this kernel
+- Make and install the kernel and its modules. DO NOT add this kernel
to the boot loader configuration files.

+Dump-capture kernel config options (Arch Dependent, ia64)
+----------------------------------------------------------
+(To be filled)
+
+
+Boot into System Kernel
+=======================
+
+1) Make and install the kernel and its modules. Update the boot loader
+ (such as grub, yaboot, or lilo) configuration files as necessary.
+
+2) Boot the system kernel with the boot parameter "crashkernel=Y@X",
+ where Y specifies how much memory to reserve for the dump-capture kernel
+ and X specifies the beginning of this reserved memory. For example,
+ "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
+ starting at physical address 0x01000000 (16MB) for the dump-capture kernel.
+
+ On x86 and x86_64, use "crashkernel=64M@16M".
+
+ On ppc64, use "crashkernel=128M@32M".

Load the Dump-capture Kernel
============================

-After booting to the system kernel, load the dump-capture kernel using
-the following command:
+After booting to the system kernel, dump-capture kernel needs to be
+loaded.
+
+Based on the architecture and type of image (relocatable or not), one
+can choose to load the uncompressed vmlinux or compressed bzImage/vmlinuz
+of dump-capture kernel. Following is the summary.
+
+For i386:
+ - Use vmlinux if kernel is not relocatable.
+ - Use bzImage/vmlinuz if kernel is relocatable.
+For x86_64:
+ - Use vmlinux
+For ppc64:
+ - Use vmlinux
+For ia64:
+ (To be filled)
+
+If you are using a uncompressed vmlinux image then use following command
+to load dump-capture kernel.

- kexec -p <dump-capture-kernel> \
+ kexec -p <dump-capture-kernel-vmlinux-image> \
--initrd=<initrd-for-dump-capture-kernel> --args-linux \
- --append="root=<root-dev> init 1 irqpoll"
+ --append="root=<root-dev> <arch-specific-options>"

+If you are using a compressed bzImage/vmlinuz, then use following command
+to load dump-capture kernel.

-Notes on loading the dump-capture kernel:
+ kexec -p <dump-capture-kernel-bzImage> \
+ --initrd=<initrd-for-dump-capture-kernel> \
+ --append="root=<root-dev> <arch-specific-options>"
+
+Following are the arch specific command line options to be used while
+loading dump-capture kernel.
+
+For i386 and x86_64:
+ "init 1 irqpoll maxcpus=1"
+
+For ppc64:
+ "init 1 maxcpus=1 noirqdistrib"

-* <dump-capture-kernel> must be a vmlinux image (that is, an
- uncompressed ELF image). bzImage does not work at this time.
+For IA64
+ (To be filled)
+
+
+Notes on loading the dump-capture kernel:

* By default, the ELF headers are stored in ELF64 format to support
systems with more than 4GB memory. The --elf32-core-headers option can
@@ -231,6 +308,9 @@ Notes on loading the dump-capture kernel
* "init 1" boots the dump-capture kernel into single-user mode without
networking. If you want networking, use "init 3."

+* We generally don' have to bring up a SMP kernel just to capture the
+ dump. Hence generally it is useful either to build a UP dump-capture
+ kernel or specify maxcpus=1 option while loading dump-capture kernel.

Kernel Panic
============
_

2007-01-11 08:13:21

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] Kdump documentation update for 2.6.20

On Wed, Jan 10, 2007 at 02:45:15PM +0530, Vivek Goyal wrote:
> On Wed, Jan 10, 2007 at 11:07:05AM +0530, Mohan Kumar M wrote:
> > On Tue, Jan 09, 2007 at 08:17:08PM +0530, Vivek Goyal wrote:
> > >
> > > Mohan, Can you please check the correctness of ppc64 specific details.
> > >
> >
> > Vivek,
> >
> > My inputs.
> >
>
> Thanks Mohan. I have updated the document as per your feedback.
>
> Please find attached the latest patch.
>
> Thanks
> Vivek
>
>
> o Kdump documentation update.
> - Update details for using relocatable kernel.
> - Start using kexec-tools-testing release as it is latest and old
> kexec-tools can't load relocatable bzImage file.
> - Also add kdump on ia64 specific details.
>
> Signed-off-by: Vivek Goyal <[email protected]>

This seems like a great improvement on the existing document.
Lets get this in the tree and make any further changes from there.
I'll send a patch to add the ia64 details shortly.

Signed-off-by: Simon Horman <[email protected]>

> ---
>
> Documentation/kdump/kdump.txt | 224 ++++++++++++++++++++++++++++--------------
> 1 file changed, 152 insertions(+), 72 deletions(-)
>
> diff -puN Documentation/kdump/kdump.txt~kdump-documentation-update Documentation/kdump/kdump.txt
> --- linux-2.6.20-rc2-mm1-reloc/Documentation/kdump/kdump.txt~kdump-documentation-update 2007-01-08 12:32:55.000000000 +0530
> +++ linux-2.6.20-rc2-mm1-reloc-root/Documentation/kdump/kdump.txt 2007-01-10 14:38:58.000000000 +0530
> @@ -17,7 +17,7 @@ You can use common Linux commands, such
> memory image to a dump file on the local disk, or across the network to
> a remote system.
>
> -Kdump and kexec are currently supported on the x86, x86_64, and ppc64
> +Kdump and kexec are currently supported on the x86, x86_64, ppc64 and IA64
> architectures.
>
> When the system kernel boots, it reserves a small section of memory for
> @@ -54,59 +54,64 @@ memory," in two ways:
> Setup and Installation
> ======================
>
> -Install kexec-tools and the Kdump patch
> ----------------------------------------
> +Install kexec-tools
> +-------------------
>
> 1) Login as the root user.
>
> 2) Download the kexec-tools user-space package from the following URL:
>
> - http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz
> +http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20061214.tar.gz
>
> -3) Unpack the tarball with the tar command, as follows:
> -
> - tar xvpzf kexec-tools-1.101.tar.gz
> -
> -4) Download the latest consolidated Kdump patch from the following URL:
> -
> - http://lse.sourceforge.net/kdump/
> +Note: Latest kexec-tools-testing git tree is available at
>
> - (This location is being used until all the user-space Kdump patches
> - are integrated with the kexec-tools package.)
> +git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git
> +or
> +http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary
>
> -5) Change to the kexec-tools-1.101 directory, as follows:
> +3) Unpack the tarball with the tar command, as follows:
>
> - cd kexec-tools-1.101
> + tar xvpzf kexec-tools-testing-20061214.tar.gz
>
> -6) Apply the consolidated patch to the kexec-tools-1.101 source tree
> - with the patch command, as follows. (Modify the path to the downloaded
> - patch as necessary.)
> +4) Change to the kexec-tools-1.101 directory, as follows:
>
> - patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch
> + cd kexec-tools-testing-20061214
>
> -7) Configure the package, as follows:
> +5) Configure the package, as follows:
>
> ./configure
>
> -8) Compile the package, as follows:
> +6) Compile the package, as follows:
>
> make
>
> -9) Install the package, as follows:
> +7) Install the package, as follows:
>
> make install
>
>
> -Download and build the system and dump-capture kernels
> -------------------------------------------------------
> +Build the system and dump-capture kernels
> +-----------------------------------------
> +There are two possible methods of using Kdump.
> +
> +1) Build a separate custom dump-capture kernel for capturing the
> + kernel core dump.
> +
> +2) Or use the system kernel binary itself as dump-capture kernel and there is
> + no need to build a separate dump-capture kernel. This is possible
> + only with the architecutres which support a relocatable kernel. As
> + of today i386 and ia64 architectures support relocatable kernel.
> +
> +Building a relocatable kernel is advantageous from the point of view that
> +one does not have to build a second kernel for capturing the dump. But
> +at the same time one might want to build a custom dump capture kernel
> +suitable to his needs.
>
> -Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer)
> -from http://www.kernel.org. Two kernels must be built: a system kernel
> -and a dump-capture kernel. Use the following steps to configure these
> -kernels with the necessary kexec and Kdump features:
> +Following are the configuration setting required for system and
> +dump-capture kernels for enabling kdump support.
>
> -System kernel
> --------------
> +System kernel config options
> +----------------------------
>
> 1) Enable "kexec system call" in "Processor type and features."
>
> @@ -132,88 +137,160 @@ System kernel
> analysis tools require a vmlinux with debug symbols in order to read
> and analyze a dump file.
>
> -4) Make and install the kernel and its modules. Update the boot loader
> - (such as grub, yaboot, or lilo) configuration files as necessary.
> +Dump-capture kernel config options (Arch Independent)
> +-----------------------------------------------------
>
> -5) Boot the system kernel with the boot parameter "crashkernel=Y@X",
> - where Y specifies how much memory to reserve for the dump-capture kernel
> - and X specifies the beginning of this reserved memory. For example,
> - "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
> - starting at physical address 0x01000000 for the dump-capture kernel.
> -
> - On x86 and x86_64, use "crashkernel=64M@16M".
> -
> - On ppc64, use "crashkernel=128M@32M".
> +1) Enable "kernel crash dumps" support under "Processor type and
> + features":
>
> + CONFIG_CRASH_DUMP=y
>
> -The dump-capture kernel
> ------------------------
> +2) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems".
>
> -1) Under "General setup," append "-kdump" to the current string in
> - "Local version."
> + CONFIG_PROC_VMCORE=y
> + (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
>
> -2) On x86, enable high memory support under "Processor type and
> +Dump-capture kernel config options (Arch Dependent, i386)
> +--------------------------------------------------------
> +1) On x86, enable high memory support under "Processor type and
> features":
>
> CONFIG_HIGHMEM64G=y
> or
> CONFIG_HIGHMEM4G
>
> -3) On x86 and x86_64, disable symmetric multi-processing support
> +2) On x86 and x86_64, disable symmetric multi-processing support
> under "Processor type and features":
>
> CONFIG_SMP=n
> +
> (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
> when loading the dump-capture kernel, see section "Load the Dump-capture
> Kernel".)
>
> -4) On ppc64, disable NUMA support and enable EMBEDDED support:
> +3) If one wants to build and use a relocatable kernel,
> + Enable "Build a relocatable kernel" support under "Processor type and
> + features"
>
> - CONFIG_NUMA=n
> - CONFIG_EMBEDDED=y
> - CONFIG_EEH=N for the dump-capture kernel
> + CONFIG_RELOCATABLE=y
>
> -5) Enable "kernel crash dumps" support under "Processor type and
> - features":
> +4) Use a suitable value for "Physical address where the kernel is
> + loaded" (under "Processor type and features"). This only appears when
> + "kernel crash dumps" is enabled. A suitable value depends upon
> + whether kernel is relocatable or not.
>
> - CONFIG_CRASH_DUMP=y
> + If you are using a relocatable kernel use CONFIG_PHYSICAL_START=0x100000
> + This will compile the kernel for physical address 1MB, but given the fact
> + kernel is relocatable, it can be run from any physical address hence
> + kexec boot loader will load it in memory region reserved for dump-capture
> + kernel.
> +
> + Otherwise it should be the start of memory region reserved for
> + second kernel using boot parameter "crashkernel=Y@X". Here X is
> + start of memory region reserved for dump-capture kernel.
> + Generally X is 16MB (0x1000000). So you can set
> + CONFIG_PHYSICAL_START=0x1000000
> +
> +5) Make and install the kernel and its modules. DO NOT add this kernel
> + to the boot loader configuration files.
> +
> +Dump-capture kernel config options (Arch Dependent, x86_64)
> +----------------------------------------------------------
> +1) On x86 and x86_64, disable symmetric multi-processing support
> + under "Processor type and features":
> +
> + CONFIG_SMP=n
>
> -6) Use a suitable value for "Physical address where the kernel is
> + (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
> + when loading the dump-capture kernel, see section "Load the Dump-capture
> + Kernel".)
> +
> +2) Use a suitable value for "Physical address where the kernel is
> loaded" (under "Processor type and features"). This only appears when
> "kernel crash dumps" is enabled. By default this value is 0x1000000
> (16MB). It should be the same as X in the "crashkernel=Y@X" boot
> - parameter discussed above.
> + parameter.
>
> - On x86 and x86_64, use "CONFIG_PHYSICAL_START=0x1000000".
> + For x86_64, normally "CONFIG_PHYSICAL_START=0x1000000".
>
> - On ppc64 the value is automatically set at 32MB when
> - CONFIG_CRASH_DUMP is set.
> +3) Make and install the kernel and its modules. DO NOT add this kernel
> + to the boot loader configuration files.
>
> -6) Optionally enable "/proc/vmcore support" under "Filesystems" ->
> - "Pseudo filesystems".
> +Dump-capture kernel config options (Arch Dependent, ppc64)
> +----------------------------------------------------------
>
> - CONFIG_PROC_VMCORE=y
> - (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.)
> -
> -7) Make and install the kernel and its modules. DO NOT add this kernel
> +- Make and install the kernel and its modules. DO NOT add this kernel
> to the boot loader configuration files.
>
> +Dump-capture kernel config options (Arch Dependent, ia64)
> +----------------------------------------------------------
> +(To be filled)
> +
> +
> +Boot into System Kernel
> +=======================
> +
> +1) Make and install the kernel and its modules. Update the boot loader
> + (such as grub, yaboot, or lilo) configuration files as necessary.
> +
> +2) Boot the system kernel with the boot parameter "crashkernel=Y@X",
> + where Y specifies how much memory to reserve for the dump-capture kernel
> + and X specifies the beginning of this reserved memory. For example,
> + "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
> + starting at physical address 0x01000000 (16MB) for the dump-capture kernel.
> +
> + On x86 and x86_64, use "crashkernel=64M@16M".
> +
> + On ppc64, use "crashkernel=128M@32M".
>
> Load the Dump-capture Kernel
> ============================
>
> -After booting to the system kernel, load the dump-capture kernel using
> -the following command:
> +After booting to the system kernel, dump-capture kernel needs to be
> +loaded.
> +
> +Based on the architecture and type of image (relocatable or not), one
> +can choose to load the uncompressed vmlinux or compressed bzImage/vmlinuz
> +of dump-capture kernel. Following is the summary.
> +
> +For i386:
> + - Use vmlinux if kernel is not relocatable.
> + - Use bzImage/vmlinuz if kernel is relocatable.
> +For x86_64:
> + - Use vmlinux
> +For ppc64:
> + - Use vmlinux
> +For ia64:
> + (To be filled)
> +
> +If you are using a uncompressed vmlinux image then use following command
> +to load dump-capture kernel.
>
> - kexec -p <dump-capture-kernel> \
> + kexec -p <dump-capture-kernel-vmlinux-image> \
> --initrd=<initrd-for-dump-capture-kernel> --args-linux \
> - --append="root=<root-dev> init 1 irqpoll"
> + --append="root=<root-dev> <arch-specific-options>"
>
> +If you are using a compressed bzImage/vmlinuz, then use following command
> +to load dump-capture kernel.
>
> -Notes on loading the dump-capture kernel:
> + kexec -p <dump-capture-kernel-bzImage> \
> + --initrd=<initrd-for-dump-capture-kernel> \
> + --append="root=<root-dev> <arch-specific-options>"
> +
> +Following are the arch specific command line options to be used while
> +loading dump-capture kernel.
> +
> +For i386 and x86_64:
> + "init 1 irqpoll maxcpus=1"
> +
> +For ppc64:
> + "init 1 maxcpus=1 noirqdistrib"
>
> -* <dump-capture-kernel> must be a vmlinux image (that is, an
> - uncompressed ELF image). bzImage does not work at this time.
> +For IA64
> + (To be filled)
> +
> +
> +Notes on loading the dump-capture kernel:
>
> * By default, the ELF headers are stored in ELF64 format to support
> systems with more than 4GB memory. The --elf32-core-headers option can
> @@ -231,6 +308,9 @@ Notes on loading the dump-capture kernel
> * "init 1" boots the dump-capture kernel into single-user mode without
> networking. If you want networking, use "init 3."
>
> +* We generally don' have to bring up a SMP kernel just to capture the
> + dump. Hence generally it is useful either to build a UP dump-capture
> + kernel or specify maxcpus=1 option while loading dump-capture kernel.
>
> Kernel Panic
> ============
> _

--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/