All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Ben Shelton <beshelto@vt.edu>
Cc: Antonio Barbalace <antoniob@vt.edu>,
	kexec@lists.infradead.org, Cong Wang <xiyou.wangcong@gmail.com>
Subject: Re: Kexec: where does the kernel image get relocated?
Date: Wed, 13 Jun 2012 09:54:04 -0700	[thread overview]
Message-ID: <87ipevp2z7.fsf@xmission.com> (raw)
In-Reply-To: <9A3DED9B-FB11-49CC-A51E-40ED03E24999@vt.edu> (Ben Shelton's message of "Thu, 7 Jun 2012 18:47:35 -0400")

Ben Shelton <beshelto@vt.edu> writes:

> 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 addresses are specified in the kexec_load system call.

If the kernel doesn't like those addresses it might move itself as Cong
Wang mentioned.

/sbin/kexec looks at the headers of the kernel image and either use
where the kernel is required to be loaded by the boot protocol or if the
image is relocatable an available extent of memory that is supported by
the boot protocol is picked.

Eric

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

      parent reply	other threads:[~2012-06-13 16:54 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
2012-06-13 16:54 ` Eric W. Biederman [this message]

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=87ipevp2z7.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=antoniob@vt.edu \
    --cc=beshelto@vt.edu \
    --cc=kexec@lists.infradead.org \
    --cc=xiyou.wangcong@gmail.com \
    /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.