Skip to contentSkip to conversation

kexec: reuse 1st kernel as kexec/kdump kernel?

DISCUSSION Dave Young 2 participants 4 messages Jan 7, 2014 – Jan 8, 2014

Subsystems (2)
lore
Share & tools
lore

Dave Young

author
#0 lore raw

Hi, all

I have a question in mind: can we copy and prepare kexec kernel while normal booting?

Just like below wild idea:

Kernel uncompress itself (assume kernel is relocatable) -> copy the kernel image somewhere for backup
-> reserver crashkernel memory

    -> copy the backuped kernel image/initrd image to reserved memory
      -> copy the purgatory which can be embedded in elf section?
        -> prepare the e820 memory ranges which is for kdump kernel

So userspace only need to call kexec reboot, kexec_load is not necessary. The initrd for kdump should be different, but we can add some different logic which will be only for kdump and it can be skipped in normal boot.

Is it doable?

Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 14 lines · Dave Young

Hi, all

I have a question in mind: can we copy and prepare kexec kernel while normal booting?

Just like below wild idea:

Kernel uncompress itself (assume kernel is relocatable) -> copy the kernel image somewhere for backup
-> reserver crashkernel memory

    -> copy the backuped kernel image/initrd image to reserved memory
      -> copy the purgatory which can be embedded in elf section?
        -> prepare the e820 memory ranges which is for kdump kernel
Quoted 5 lines

So userspace only need to call kexec reboot, kexec_load is not necessary. The initrd for kdump should be different, but we can add some different logic which will be only for kdump and it can be skipped in normal boot.

Is it doable?

What's the advantage of doing all this? Why are you trying to skip load step.

Thanks
Vivek

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

author
#2 lore raw
Quoted 15 lines · Vivek Goyal
Quoted 14 lines · Dave Young

Hi, all

I have a question in mind: can we copy and prepare kexec kernel while normal booting?

Just like below wild idea:

Kernel uncompress itself (assume kernel is relocatable) -> copy the kernel image somewhere for backup
-> reserver crashkernel memory

    -> copy the backuped kernel image/initrd image to reserved memory
      -> copy the purgatory which can be embedded in elf section?
        -> prepare the e820 memory ranges which is for kdump kernel
Quoted 8 lines
Quoted 5 lines

So userspace only need to call kexec reboot, kexec_load is not necessary. The initrd for kdump should be different, but we can add some different logic which will be only for kdump and it can be skipped in normal boot.

Is it doable?

What's the advantage of doing all this? Why are you trying to skip load step.

Hi, Vivek

It's just a thought that kernel already have all the information for kexecing so we can save user space works. Rethinking about it it benefits more to kexec than kdump. For kexec user he can reboot with kexec without any user space actions. For kdump there's no much advantage though.

Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
Quoted 25 lines · Dave Young
Quoted 15 lines · Vivek Goyal
Quoted 14 lines · Dave Young

Hi, all

I have a question in mind: can we copy and prepare kexec kernel while normal booting?

Just like below wild idea:

Kernel uncompress itself (assume kernel is relocatable) -> copy the kernel image somewhere for backup
-> reserver crashkernel memory

    -> copy the backuped kernel image/initrd image to reserved memory
      -> copy the purgatory which can be embedded in elf section?
        -> prepare the e820 memory ranges which is for kdump kernel
Quoted 8 lines
Quoted 5 lines

So userspace only need to call kexec reboot, kexec_load is not necessary. The initrd for kdump should be different, but we can add some different logic which will be only for kdump and it can be skipped in normal boot.

Is it doable?

What's the advantage of doing all this? Why are you trying to skip load step.

Quoted 6 lines

Hi, Vivek

It's just a thought that kernel already have all the information for kexecing so we can save user space works. Rethinking about it it benefits more to kexec than kdump. For kexec user he can reboot with kexec without any user space actions. For kdump there's no much advantage though.

We should rather have a kexec service which starts and loads the kernel at startup and reboot will simply use kexec boot to boot into that kernel. We don't need to do anything at kernel level.

Thanks
Vivek

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec