From: "Mika Penttilä" <mika.penttila@kolumbus.fi>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: nigel@nigel.suspend2.net,
Kexec Mailing List <kexec@lists.infradead.org>,
linux-kernel@vger.kernel.org,
"Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Machek <pavel@ucw.cz>,
Andrew Morton <akpm@linux-foundation.org>,
linux-pm@lists.linux-foundation.org,
Jeremy Maitin-Shepard <jbms@cmu.edu>
Subject: Re: [linux-pm] [RFC][PATCH 0/2 -mm] kexec based hibernation -v3
Date: Fri, 21 Sep 2007 12:47:49 +0300 [thread overview]
Message-ID: <46F39345.3040201@kolumbus.fi> (raw)
In-Reply-To: <1190266440.21818.16.camel@caritas-dev.intel.com>
> Usage:
>
> 1. Compile kernel with following options selected:
>
> CONFIG_X86_32=y
> CONFIG_RELOCATABLE=y # not needed strictly, but it is more convenient with it
> CONFIG_KEXEC=y
> CONFIG_CRASH_DUMP=y # only needed by kexeced kernel to save/restore memory image
> CONFIG_PM=y
> CONFIG_KEXEC_JUMP=y
>
> 2. Download the kexec-tools-testing git tree, apply the kexec-tools
> kjump patches (or download the source tar ball directly) and
> compile.
>
> 3. Download and compile the krestore tool.
>
> 4. Prepare 2 root partition used by kernel A and kernel B/C, referred
> as /dev/hda, /dev/hdb in following text. This is not strictly
> necessary, I use this scheme for testing during development.
>
> 5. Boot kernel compiled for normal usage (kernal A).
>
> 6. Load kernel compiled for hibernating/restore usage (kernel B) with
> kexec, the same kernel as that of 5 can be used if
> CONFIG_RELOCATABLE=y and CONFIG_CRASH_DUMP=y are selected.
>
> The --elf64-core-headers should be specified in command line of
> kexec, because only the 64bit ELF is supported by krestore tool.
>
> For example, the shell command line can be as follow:
>
> kexec -p -n /boot/bzImage --mem-min=0x100000 --mem-max=0xffffff
> --elf64-core-headers --append="root=/dev/hdb single"
>
> 7. Jump to the hibernating kernel (kernel B) with following shell
> command line:
>
> kexec -j
>
> 8. In the hibernating kernel (kernel B), the memory image of
> hibernated kernel (kernel A) can be saved as follow:
>
> cp /proc/vmcore .
> cp /sys/kernel/kexec_jump_back_entry .
>
Here we save also kernel B's pages.
> 9. Shutdown or reboot in hibernating kernel (kernel B).
>
> 10. Boot kernel (kernel C) compiled for hibernating/restore usage on
> the root file system /dev/hdb in memory range of kernel B.
>
> For example, the following kernel command line parameters can be
> used:
>
> root=/dev/hdb single memmap=exactmap memmap=640K@0K memmap=15M@1M
>
0-640K from kernel A overrides 0-640K of kernel C at restore time.
> 11. In restore kernel (kernel C), the memory image of kernel A can be
> restored as follow:
>
> cp kexec_jump_back_entry /sys/kernel/kexec_jump_back_entry
> krestore vmcore
>
>
This steps replaces kernel C's pages with kernel B's (at least 15m-16m),
saved at step 8, so these kernels should be equal? Or they must be
physically located in non-overlapping regions such that C is in B's
memory range but non-overlapping. The proposed setup doesn't guaratee
this afaics.
> 12. Jump back to hibernated kernel (kernel A)
>
> kexec -b
>
> Best Regards,
> Huang Ying
> _______________________________________________
> linux-pm mailing list
> linux-pm@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/linux-pm
>
>
--Mika
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: "Mika Penttilä" <mika.penttila@kolumbus.fi>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Machek <pavel@ucw.cz>,
nigel@nigel.suspend2.net,
Andrew Morton <akpm@linux-foundation.org>,
Jeremy Maitin-Shepard <jbms@cmu.edu>,
linux-pm@lists.linux-foundation.org,
Kexec Mailing List <kexec@lists.infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: [linux-pm] [RFC][PATCH 0/2 -mm] kexec based hibernation -v3
Date: Fri, 21 Sep 2007 12:47:49 +0300 [thread overview]
Message-ID: <46F39345.3040201@kolumbus.fi> (raw)
In-Reply-To: <1190266440.21818.16.camel@caritas-dev.intel.com>
> Usage:
>
> 1. Compile kernel with following options selected:
>
> CONFIG_X86_32=y
> CONFIG_RELOCATABLE=y # not needed strictly, but it is more convenient with it
> CONFIG_KEXEC=y
> CONFIG_CRASH_DUMP=y # only needed by kexeced kernel to save/restore memory image
> CONFIG_PM=y
> CONFIG_KEXEC_JUMP=y
>
> 2. Download the kexec-tools-testing git tree, apply the kexec-tools
> kjump patches (or download the source tar ball directly) and
> compile.
>
> 3. Download and compile the krestore tool.
>
> 4. Prepare 2 root partition used by kernel A and kernel B/C, referred
> as /dev/hda, /dev/hdb in following text. This is not strictly
> necessary, I use this scheme for testing during development.
>
> 5. Boot kernel compiled for normal usage (kernal A).
>
> 6. Load kernel compiled for hibernating/restore usage (kernel B) with
> kexec, the same kernel as that of 5 can be used if
> CONFIG_RELOCATABLE=y and CONFIG_CRASH_DUMP=y are selected.
>
> The --elf64-core-headers should be specified in command line of
> kexec, because only the 64bit ELF is supported by krestore tool.
>
> For example, the shell command line can be as follow:
>
> kexec -p -n /boot/bzImage --mem-min=0x100000 --mem-max=0xffffff
> --elf64-core-headers --append="root=/dev/hdb single"
>
> 7. Jump to the hibernating kernel (kernel B) with following shell
> command line:
>
> kexec -j
>
> 8. In the hibernating kernel (kernel B), the memory image of
> hibernated kernel (kernel A) can be saved as follow:
>
> cp /proc/vmcore .
> cp /sys/kernel/kexec_jump_back_entry .
>
Here we save also kernel B's pages.
> 9. Shutdown or reboot in hibernating kernel (kernel B).
>
> 10. Boot kernel (kernel C) compiled for hibernating/restore usage on
> the root file system /dev/hdb in memory range of kernel B.
>
> For example, the following kernel command line parameters can be
> used:
>
> root=/dev/hdb single memmap=exactmap memmap=640K@0K memmap=15M@1M
>
0-640K from kernel A overrides 0-640K of kernel C at restore time.
> 11. In restore kernel (kernel C), the memory image of kernel A can be
> restored as follow:
>
> cp kexec_jump_back_entry /sys/kernel/kexec_jump_back_entry
> krestore vmcore
>
>
This steps replaces kernel C's pages with kernel B's (at least 15m-16m),
saved at step 8, so these kernels should be equal? Or they must be
physically located in non-overlapping regions such that C is in B's
memory range but non-overlapping. The proposed setup doesn't guaratee
this afaics.
> 12. Jump back to hibernated kernel (kernel A)
>
> kexec -b
>
> Best Regards,
> Huang Ying
> _______________________________________________
> linux-pm mailing list
> linux-pm@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/linux-pm
>
>
--Mika
next prev parent reply other threads:[~2007-09-21 10:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-20 5:34 [RFC][PATCH 0/2 -mm] kexec based hibernation -v3 Huang, Ying
2007-09-20 5:34 ` Huang, Ying
2007-09-21 8:43 ` Stefan Rompf
2007-09-21 8:43 ` [linux-pm] " Stefan Rompf
2007-09-21 8:43 ` Stefan Rompf
2007-09-21 8:47 ` Huang, Ying
2007-09-21 8:47 ` Huang, Ying
2007-09-21 8:47 ` Huang, Ying
2007-09-21 9:47 ` Mika Penttilä
2007-09-21 9:47 ` Mika Penttilä [this message]
2007-09-21 9:47 ` [linux-pm] " Mika Penttilä
2007-09-21 13:44 ` huang ying
2007-09-21 13:44 ` huang ying
2007-09-21 14:56 ` [linux-pm] " Mika Penttilä
2007-09-21 14:56 ` Mika Penttilä
2007-09-21 15:13 ` huang ying
2007-09-21 15:13 ` huang ying
2007-09-21 15:13 ` [linux-pm] " Mika Penttilä
2007-09-21 15:13 ` Mika Penttilä
2007-09-21 15:41 ` huang ying
2007-09-21 15:41 ` huang ying
2007-09-21 15:13 ` Mika Penttilä
2007-09-21 14:56 ` Mika Penttilä
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=46F39345.3040201@kolumbus.fi \
--to=mika.penttila@kolumbus.fi \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=jbms@cmu.edu \
--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=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 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.