linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 3/3] powerpc/kexec: Add support for FSL-BookE
Date: Fri, 7 May 2010 09:24:51 +0200	[thread overview]
Message-ID: <20100507072451.GA28507@Chamillionaire.breakpoint.cc> (raw)
In-Reply-To: <42CE8E3E-E536-402C-970B-C4BBC036BEB9@kernel.crashing.org>

* Kumar Gala | 2010-05-07 01:50:29 [-0500]:

>Can you explain this a bit more.  Mostly would like to have a brief description of the sequence of events as part of the commit message.
>
>Something like:
>
>* Running kernel calls machine_kexec()
>* machine_kexec_32()
>* jump to relocate code
>* relocate clears out TLBs and sets up 2g mapping
>...
>
>what I have above might not be quite right.
That is correct:
- kexec -l loads the kernel, dtb, ... in userland. It sets up the kimage
  struct including buffers with the new kernel and a copy list which
  looks like src, dst, bytes.
  KEXEC_*_MEMORY_LIMIT is limiting the memory which it might allocate.
- kexec -e start the kexec, that is
  * syscall reboot - kernel/sys.c
  * kernel_kexec() kernel/kexec.c
  * machine_kexec()  arch/powerpc/kernel/machine_kexec.c
  * default_machine_kexec() arch/powerpc/kernel/machine_kexec_32.c
- copy relocate_new_kernel() into a buffer which was allocated during
  kexec -l. That buffer is somewhere between 0..2GiB and will not be
  overwritten.
- jump there.
  Here we clear the tlbs and setup a 1:1 mapping. Then we copy the
  data from somewhere in 0..2GiB to its final position according to the
  list. Data means new kernel, device tree and purgatory code.
- After that, the code ends in
    mtlr    r5
    blrl
  r5 has the address of purgatory_start(), purgatory/arch/ppc/v2wrap.S
  in kexec userland [0].
- here we setup stack, jump to purgatory(). We have no console and still
  the 2GiB 1:1 mapping
- the code performs a sha256 check to make sure the kernel is correct.
- then we get back from purgatory(), load r3 - r9 and the blr at the
  bottom shoots us finally to new kernel.
- now we boot the kernel.

>- k

[0] git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools.git

Sebastian

  reply	other threads:[~2010-05-07  8:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-04 20:19 Kexec on FSL-Book-E, v4 Sebastian Andrzej Siewior
2010-04-04 20:19 ` [PATCH 1/3] powerpc/head fsl: fix the case where we are not in the first page Sebastian Andrzej Siewior
2010-05-24 19:01   ` Kumar Gala
2010-04-04 20:19 ` [PATCH 2/3] powerpc/fsl head: move the entry setup code into a seperate file Sebastian Andrzej Siewior
2010-05-24 19:01   ` Kumar Gala
2010-04-04 20:19 ` [PATCH 3/3] powerpc/kexec: Add support for FSL-BookE Sebastian Andrzej Siewior
2010-05-07  6:50   ` Kumar Gala
2010-05-07  7:24     ` Sebastian Andrzej Siewior [this message]
2010-05-07 11:35       ` wilbur.chan
2010-05-07 12:16         ` Josh Boyer
2010-05-07 12:50           ` Kumar Gala
2010-05-24 19:01   ` Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100507072451.GA28507@Chamillionaire.breakpoint.cc \
    --to=sebastian@breakpoint.cc \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).