Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* kexec: reuse 1st kernel as kexec/kdump kernel?
@ 2014-01-07  2:34 Dave Young
  2014-01-07 14:37 ` Vivek Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Young @ 2014-01-07  2:34 UTC (permalink / raw)
  To: kexec, linux-kernel; +Cc: ebiederm, vgoyal, hpa

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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kexec: reuse 1st kernel as kexec/kdump kernel?
  2014-01-07  2:34 kexec: reuse 1st kernel as kexec/kdump kernel? Dave Young
@ 2014-01-07 14:37 ` Vivek Goyal
  2014-01-08  1:24   ` Dave Young
  0 siblings, 1 reply; 4+ messages in thread
From: Vivek Goyal @ 2014-01-07 14:37 UTC (permalink / raw)
  To: Dave Young; +Cc: hpa, kexec, linux-kernel, ebiederm

On Tue, Jan 07, 2014 at 10:34:06AM +0800, Dave Young wrote:
> 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?

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

Thanks
Vivek

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kexec: reuse 1st kernel as kexec/kdump kernel?
  2014-01-07 14:37 ` Vivek Goyal
@ 2014-01-08  1:24   ` Dave Young
  2014-01-08 14:41     ` Vivek Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Young @ 2014-01-08  1:24 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: hpa, kexec, linux-kernel, ebiederm

On 01/07/14 at 09:37am, Vivek Goyal wrote:
> On Tue, Jan 07, 2014 at 10:34:06AM +0800, Dave Young wrote:
> > 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?
> 
> 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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kexec: reuse 1st kernel as kexec/kdump kernel?
  2014-01-08  1:24   ` Dave Young
@ 2014-01-08 14:41     ` Vivek Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Vivek Goyal @ 2014-01-08 14:41 UTC (permalink / raw)
  To: Dave Young; +Cc: hpa, kexec, linux-kernel, ebiederm

On Wed, Jan 08, 2014 at 09:24:22AM +0800, Dave Young wrote:
> On 01/07/14 at 09:37am, Vivek Goyal wrote:
> > On Tue, Jan 07, 2014 at 10:34:06AM +0800, Dave Young wrote:
> > > 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?
> > 
> > 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.

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
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-08 14:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-07  2:34 kexec: reuse 1st kernel as kexec/kdump kernel? Dave Young
2014-01-07 14:37 ` Vivek Goyal
2014-01-08  1:24   ` Dave Young
2014-01-08 14:41     ` Vivek Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox