Wind River Support Network

HomeDefectsLIN6-8527
Fixed

LIN6-8527 : [cav-octeon3] README confused on kexec kdump parts

Created: Oct 11, 2014    Updated: Dec 3, 2018
Resolved Date: Oct 12, 2014
Found In Version: 6.0
Fix Version: 6.0.0.13
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: BSP - Async

Description

README confused on kexec kdump parts.
1) Needn't direct the network as mgmt0, cn78xx don't have it.
2) Needn't explain how to get second kernel image, maybe user can tftp download or copy from host to disk.
3) Kdump support, command-line need add mount point 'root=/dev/sda1'.

--------
4.1 Kexec/Kdump Notes
---------------------

Kexec can be used to either perform a fast reboot into a second kernel or
handle a kernel crash and obtain a core dump of the kernel.

4.1.1 Kernel KEXEC support
--------------------------

kexec, kernel execution, is a mechanism to launch a new kernel over currently
running linux kernel image. kexec skips the bootloader stage
(hardware initialization phase by the firmware or BIOS) and directly loads the
new kernel into memory, where it starts executing immediately. This is to avoid
long time associated with a full reboot and can help systems to meet
high-availability requirements by minimizing downtime.

To use kexec feature, need to enable the following kernel configurations

    make menuconfig
      Kernel Type --->
        [*] Kexec system call
      File System --->
        Pseudo filesystems --->
           [*] /proc file system support
           [*] /proc/kcore support

Create 2 named blocks in UBOOT, one for first kernel and another for kexec kernel.
Boot the kernel from a named block. Create a named block at bootloader prompt

Free the memory and create a named block 'ddblock0' and 'ddblock1'.

Octeon evb7000_sff# namedfree __tmp_load
Octeon evb7000_sff# namedfree __tmp_reserved_linux
Octeon evb7000_sff# namedalloc ddblock0 0x0c000000 0x00100000
Octeon evb7000_sff# namedalloc ddblock1 0x10000000 0x20000000

Now load the kernel and use the memory that was allocated.

    tftp ${loadaddr} vmlinux
    bootoctlinux $(loadaddr) namedblock=ddblock0 endbootargs mem=block:ddblock0,ddblock1 root=/dev/sda2

namedblock=ddblock0: the bootoctlinux will locate the kernel image in ddblock0
named block instead of allocating anonymous memory.

mem=block:ddblock0,ddblock1: kernel gets memory only from these named blocks.

After kernel boots up, get the kernel to boot using kexec command.
    ~ # dhclient mgmt0

    // get the kernel image
    # tftp -g -r vmlinux 192.168.162.57

    // Inform kexec about the kernel to start.
    # kexec --command-line='mem=block:ddblock0,ddblock1 root=/dev/sda2 rw' -l vmlinux

    // Start the kernel
    ~ # kexec -e


4.1.2 Kernel KDUMP support
--------------------------

To collect crashed kernel statistics, need to build two linux kernel images, use
the previous kexec kernel as the first kernel. Rename this image as vmlinux-1.

Enable the following kernel configurations for building the second kernel:

    make menuconfig
      Kernel Type --->
        [ ] Multi-Processing support
        [*] Kexec system call
        [*] kernel crash dumps
        (0xffffffff85000000) Physical address where the kernel is loaded (NEW)
      File System --->
        Pseudo filesystems --->
           [*] /proc file system support
           [*] /proc/kcore support

Rename linux kernel image as vmlinux-2.

Create 4 named blocks, ddblock0 and ddblock1 are for first kernel.
lkdump and lkdump1 are for second kernel. Boot the kernel from a named block.
Create the named block at bootloader prompt.

Octeon evb7000_sff# namedfree __tmp_load
Octeon evb7000_sff# namedfree __tmp_reserved_linux
Octeon evb7000_sff# namedalloc ddblock1 0x30000000 0x20000000
Octeon evb7000_sff# namedalloc ddblock0 0x4eff000 0x100000
Octeon evb7000_sff# namedalloc lkdump 0x0a000000 0x05000000
Octeon evb7000_sff# namedalloc lkdump1 0x20000000 0x50000000

Load the first kernel with crashkernel parameter that takes the size of
the kernel, followed by starting address, these should match the lkdump
named block created above.
According to lkdump named block, crashkernel size will be
160 Mbytes(0x0a000000) and craskernel address will be 80 Mbytes (0x05000000).

    tftp ${loadaddr} vmlinux-1
    bootoctlinux $(loadaddr) namedblock=ddblock0 endbootargs mem=block:ddblock0,ddblock1,lkdump crashkernel=160M@80M

After the first kernel boots up, load the second kernel to capture panic status.

    ~ # dhclient mgmt0

    // get the kernel image
    ~ # tftp -g -r vmlinux-2 192.168.162.57

    // Load second kernel by passing '-p' option to kexec, to be booted in
    // case of crash
    ~ # kexec -p vmlinux-2 --command-line='mem=block:lkdump,lkdump1'

    // simulate crash on current kernel
    ~ # echo 'c' > /proc/sysrq-trigger

If using kexec to handle a crash, the following parameters have been tested:
        - ip configuration both static and via dhcp
        - kexec from SMP to SMP
        - kexec from SMP to non-SMP (maxcpus=1 on the command line)
        - kdump from SMP to non-SMP (maxcpus=1 on the command line)

Other Downloads


Live chat
Online