From: Vivek Goyal <vgoyal@redhat.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Machek <pavel@ucw.cz>,
nigel@nigel.suspend2.net, "Rafael J. Wysocki" <rjw@sisk.pl>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
linux-pm@lists.linux-foundation.org,
Kexec Mailing List <kexec@lists.infradead.org>
Subject: Re: [PATCH -mm] kexec jump -v9
Date: Fri, 21 Mar 2008 15:12:26 -0400 [thread overview]
Message-ID: <20080321191226.GA12609@redhat.com> (raw)
In-Reply-To: <1205481808.867.0.camel@caritas-dev.intel.com>
On Fri, Mar 14, 2008 at 04:03:28PM +0800, Huang, Ying wrote:
> On Wed, 2008-03-12 at 15:37 -0400, Vivek Goyal wrote:
> > On Tue, Mar 11, 2008 at 08:17:45PM -0600, Eric W. Biederman wrote:
> > > "Huang, Ying" <ying.huang@intel.com> writes:
> > >
> > > > Yes. The entry point should be saved in dump.elf itself, this can be
> > > > done via a user-space tool such as "makedumpfile". Because
> > > > "makedumpfile" is also used to exclude free pages from disk image, it
> > > > needs a communication method between two kernels (to get backup pages
> > > > map or something like that from kernel A). We have talked about this
> > > > before.
> > > >
> > > > - Your opinion is to communicate via the purgatory. (But I don't know
> > > > how to communicate between kernel A and purgatory).
> > >
> > > How about the return address on the stack?
> > >
> >
> > I think he needs to pass on much more data than just return address.
> >
> > IIUC, he needs to pass backup pages map to new kernel, so that any
> > user space tool can use backup pages map to reconstruct/rearrange the
> > first kernel's memory core and tools like makedumpfile can do filtering
> > before hibernated images is saved.
> >
> > This brings me to a random thought. Can we break the process of loading
> > a hibernation kernel in two steps.
> >
> > - In first step just do the memory reservation for running second kernel.
> > (kexec -l <dummpy-file-for-reserving-memory>)
> >
> > - This memory map of reserved pages is exported to user space.
> >
> > - Use this memory map and regenerate the hibernation kernel initrd
> > (rootfs.gz) and put the memory map there. This memory map can be used
> > by makedumpfile in second kernel for filtering.
> >
> > This way it will user space to user space communication of information
> > which gets fixed at kernel loading time.
>
> Doing kexec load in two steps is a possible solution. Although this is a
> little complex, we can wrap the two steps into one /sbin/kexec invoking.
> That is, When do /sbin/kexec --load-preserve-context
> <kernel-image>, /sbin/kexec first call sys_kexec_load() to load the
> kernel image and reserving memory, then amend the memory image of loaded
> kernel (B) according to the new information available such as return
> address and backup pages map. For this solution, something still need to
> be solved is how to pass some information back from kernel B
> (hibernating kernel) to kernel A (original kernel) and how to pass some
> information from kernel C (resuming kernel) to kernel A (original
> kernel).
>
Hi Huang,
I am kind of ok with both the methods.
- Communicate information between two kernels using an ELF NOTE
prepared by kernel.
- Communicate information between user space tools using initrd.
But which method to use will depend on what information we want to
exchange between two kernels.
For example, re-entry points can be on stack or in ELF NOTE.
Backup page map probably can be communicated using initrd as only user
space need to access that (ELF Core headers can be put in a memory area
which is not swapped during transition from kernel A to B. This way
kernel B never needs to know that kernel A had done some swapping of
pages?).
So far I have understood only following.
1. We need to pass around entry/re-entry points between kernels.
2. We need to pass backup pages map from kernel A to kernel B, so that user
space tool can do filtering.
3. We need to pass address of ELF core headers from kernel A to kernel B so
that a valid vmcore of kernel A can be exported.
- For first time boot of kernel B, address of ELF core header is
passed through command line.
- For re-entry into B, ELF core header address can be passed
using some register, or on stack or using kernel ELF NOTE.
What else? What information do we need to communicate from kernel B to
kernel A or from kernel C to kernel A?
I am sure that you have told it in the past. Just that I don't recollect
it.
Thanks
Vivek
next prev parent reply other threads:[~2008-03-21 19:13 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 3:13 [PATCH -mm] kexec jump -v9 Huang, Ying
2008-03-11 21:10 ` Vivek Goyal
2008-03-11 21:59 ` Nigel Cunningham
2008-03-11 23:55 ` Eric W. Biederman
2008-03-12 0:09 ` david
2008-03-12 2:14 ` Huang, Ying
2008-03-12 18:53 ` Vivek Goyal
2008-03-13 0:01 ` Eric W. Biederman
2008-03-11 22:18 ` Rafael J. Wysocki
2008-03-12 2:02 ` Eric W. Biederman
2008-03-12 2:26 ` Huang, Ying
2008-03-11 23:24 ` Pavel Machek
2008-03-11 23:49 ` Rafael J. Wysocki
2008-03-12 1:55 ` Huang, Ying
2008-03-12 15:01 ` [linux-pm] " Alan Stern
2008-03-12 21:53 ` Rafael J. Wysocki
2008-03-13 0:33 ` Eric W. Biederman
2008-03-13 17:03 ` Rafael J. Wysocki
2008-03-13 23:07 ` Eric W. Biederman
2008-03-14 1:31 ` Rafael J. Wysocki
[not found] ` <m1prtsug2e.fsf@ebiederm.dsl.xmission.com>
2008-03-18 23:52 ` Pavel Machek
2008-03-19 0:08 ` Rafael J. Wysocki
2008-03-19 2:33 ` Alan Stern
[not found] ` <m1ve3jtmxk.fsf@ebiederm.dsl.xmission.com>
2008-03-19 15:01 ` Alan Stern
2008-03-19 19:28 ` Rafael J. Wysocki
2008-03-20 10:40 ` Pavel Machek
2008-03-20 22:45 ` Rafael J. Wysocki
2008-03-20 23:01 ` Alan Stern
2008-03-20 23:22 ` Pavel Machek
2008-03-20 23:40 ` Rafael J. Wysocki
2008-03-21 0:36 ` Rafael J. Wysocki
2008-03-21 0:52 ` Alan Stern
2008-03-21 22:05 ` Nigel Cunningham
2008-03-22 16:21 ` Pavel Machek
2008-03-22 17:45 ` Rafael J. Wysocki
2008-03-22 20:49 ` Alan Stern
2008-03-22 21:29 ` Rafael J. Wysocki
2008-05-14 22:38 ` Eric W. Biederman
2008-05-14 23:47 ` Rafael J. Wysocki
2008-05-15 20:55 ` Eric W. Biederman
2008-05-15 21:20 ` Rafael J. Wysocki
2008-05-14 20:41 ` Maxim Levitsky
2008-05-14 23:34 ` Eric W. Biederman
2008-03-12 8:57 ` Pavel Machek
2008-03-12 0:00 ` Nigel Cunningham
2008-03-12 1:45 ` Huang, Ying
2008-03-12 2:17 ` Eric W. Biederman
2008-03-12 6:54 ` Huang, Ying
2008-03-12 19:37 ` Vivek Goyal
2008-03-14 8:03 ` Huang, Ying
2008-03-21 19:12 ` Vivek Goyal [this message]
2008-03-25 7:25 ` Huang, Ying
2008-03-12 19:47 ` Vivek Goyal
2008-04-09 9:34 ` Pavel Machek
2008-04-09 12:30 ` Vivek Goyal
2008-05-14 16:03 ` Vivek Goyal
2008-05-14 17:49 ` Vivek Goyal
2008-05-14 20:52 ` Vivek Goyal
2008-05-15 2:32 ` Huang, Ying
2008-05-15 20:09 ` Vivek Goyal
2008-05-16 1:48 ` Huang, Ying
2008-05-16 1:51 ` Vivek Goyal
2008-05-16 2:08 ` Huang, Ying
2008-05-16 12:13 ` Pavel Machek
2008-05-15 5:41 ` Huang, Ying
2008-05-15 18:42 ` Eric W. Biederman
2008-05-16 0:51 ` Vivek Goyal
2008-05-16 1:35 ` Eric W. Biederman
2008-05-16 1:55 ` Huang, Ying
2008-05-27 7:27 ` Huang, Ying
2008-05-27 22:15 ` Vivek Goyal
2008-05-28 1:35 ` Huang, Ying
2008-05-14 22:30 ` Eric W. Biederman
2008-05-14 23:55 ` Rafael J. Wysocki
2008-05-15 22:03 ` Eric W. Biederman
2008-05-15 23:20 ` Rafael J. Wysocki
2008-05-16 12:18 ` Pavel Machek
2008-05-16 14:20 ` [linux-pm] " Alan Stern
2008-05-15 1:42 ` Huang, Ying
2008-05-15 19:05 ` Rafael J. Wysocki
2008-05-15 14:14 ` [linux-pm] " Alan Stern
2008-05-15 20:48 ` Eric W. Biederman
2008-05-15 21:07 ` Alan Stern
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=20080321191226.GA12609@redhat.com \
--to=vgoyal@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=nigel@nigel.suspend2.net \
--cc=pavel@ucw.cz \
--cc=rjw@sisk.pl \
--cc=ying.huang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox