how to use kexec to jump back to the original kernel

Bhupesh SHARMA bhupesh.linux at gmail.com
Sun Feb 11 22:56:12 PST 2018


Hello,

On Fri, Feb 9, 2018 at 7:24 PM, Gioh Kim <gurugio at gmail.com> wrote:
> Hello,
>
> "echo c > /proc/sysrq-trigger" generates the kernel dump but it
> reboots the system.
> I'd like to generate kernel dump without system reboot.
>
> I think it is possible to jump to the kdump kernel and generate kernel
> dump, and come back to the operating kernel with kexec.
> I know I can jump to the kdump kernel with "kexec -e" but I cannot
> figure out how to come back to the operating kernel.
>
> For example, I tried following sequences after reading kexec manual page.
>
> 0. rebuild kernel with CONFIG_KEXEC_JUMP option
> 1. kexec --load=/boot/vmlinuz --initrd=/boot/initrd --reuse-cmdline

Instead you should be using something like:
# kexec -l /boot/vmlinuz-`uname -r` --initrd=/boot/initramfs-`uname
-r`.img --reuse-cmdline  --load-preserve-context --mem-min=addr
--mem-max=addr

to let the kernel know that the primary kernel context should be
retained so that we can return to the same once we do a 'kexec -e'
from the secondary kernel.

Can you please try the same. Also can you please share the details of
the hardware you are using this one, AFAIK only x86 and sh
architectures support CONFIG_KEXEC_JUMP in upstream linux.

Regards,
Bhupesh

> 2. kexec -e
> 3. now kdump kernel is running
> 4. kexec --load-jump-back-helper --entry=<ADDRESS>
> 5. kexec -e
>
> I can jump to the kdump kernel with step 1 and step 2.
> kexec manual says I need an entry address.
> I don't know what address I should use.
> I found a email thread about jump_back_entry= but there is no
> parameter like jump_back_entry in kernel booting parameters of
> v4.4~v4.14.
>
> Does anybody know how to use kexec to jump between kdump kernel and
> operating kernel?
>
>
> --
>
> Best regards,
> Gioh Kim
>
> _______________________________________________
> kexec mailing list
> kexec at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec



More information about the kexec mailing list