All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: kexec@lists.infradead.org
Subject: Re: Kexec: where does the kernel image get relocated?
Date: Wed, 13 Jun 2012 02:21:34 +0000 (UTC)	[thread overview]
Message-ID: <jr8tfd$enn$1@dough.gmane.org> (raw)
In-Reply-To: 9A3DED9B-FB11-49CC-A51E-40ED03E24999@vt.edu

On Thu, 07 Jun 2012 at 22:47 GMT, Ben Shelton <beshelto@vt.edu> wrote:
> Hi all,
>
> I'm working on a distributed-computing project where we'd like to boot multiple instances of the Linux kernel on the same machine.  We'd like to leverage kexec to decompress each guest kernel and copy it to an area within the physical address space.
>
> From following through the code and using GDB/QEMU, it seems like the steps to reboot with kexec look like this:
>
> - Decompress the kernel somewhere (not necessarily contiguous)
> - In relocate_kernel_64.S, copy the kernel to a contiguous space and jump/return to purgatory
> - In purgatory, reinitialize the hardware if necessary, then jump to the start of the kernel
>
> My issue is that I can't seem to find where the address to which the kernel is copied in step 2 is defined.  Can anyone give me a brief description of how this works?
>

The kernel relocates itself, you can check the code under
#ifdef CONFIG_RELOCATABLE in arch/x86/boot/compressed/head_64.S and
arch/x86/boot/compressed/misc.c.

Thanks.


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

  reply	other threads:[~2012-06-13  2:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 22:47 Kexec: where does the kernel image get relocated? Ben Shelton
2012-06-13  2:21 ` Cong Wang [this message]
2012-06-13 16:54 ` Eric W. Biederman

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='jr8tfd$enn$1@dough.gmane.org' \
    --to=xiyou.wangcong@gmail.com \
    --cc=kexec@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.