Re: [PATCH -mm 1/2] kexec jump -v12: kexec jump



Hi!

The patch looks mostly ok to me. (Perhaps there's time to split it
into smaller chunks?)

You can add Acked-by: Pavel Machek <pavel@xxxxxxx> to it, I guess.


This patch provides an enhancement to kexec/kdump. It implements
the following features:

- Backup/restore memory used by the original kernel before/after
kexec.

- Save/restore CPU state before/after kexec.

The features of this patch can be used as a general method to call
program in physical mode (paging turning off). This can be used to
call BIOS code under Linux.


kexec-tools needs to be patched to support kexec jump. The patches and
the precompiled kexec can be download from the following URL:

source: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec-tools-src_git_kh10.tar.bz2
patches: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec-tools-patches_git_kh10.tar.bz2
binary: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec_git_kh10


Usage example of calling some physical mode code and return:

@@ -98,16 +101,24 @@ int machine_kexec_prepare(struct kimage
*/
void machine_kexec_cleanup(struct kimage *image)
{
+ if (nx_enabled)
+ set_pages_nx(image->control_code_page, 1);
}

, 0 ? (setup and cleanup were same, which is strange).



@@ -1411,3 +1421,50 @@ static int __init crash_save_vmcoreinfo_
}

module_init(crash_save_vmcoreinfo_init)
+
+/**
+ * kernel_kexec - reboot the system

Really?

+ * Move into place and start executing a preloaded standalone
+ * executable. If nothing was preloaded return an error.
+ */
+int kernel_kexec(void)
+{
+ int error = 0;
+
+ if (xchg(&kexec_lock, 1))
+ return -EBUSY;

That's quite a strange way to provide a lock. mutex_trylock?


+ if (!kexec_image) {
+ error = -EINVAL;
+ goto Unlock;
+ }
+
+ if (kexec_image->preserve_context) {
+#ifdef CONFIG_KEXEC_JUMP
+ local_irq_disable();
+ save_processor_state();

#else
BUG()

...because otherwise you silently do nothing?

+#endif
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [Fastboot] kexec based crash dumping
    ... > The patches that follow contain the kexec based crash dumping implementation. ... The documentation patch has complete details on how to do this. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: ANNOUNCE: CE Linux Forum - Specification V1.0 draft
    ... >> for features that REAL application developers need. ... I agree that patches should get posted with requirement and implementation ... The example below is simply one patch to enhance the kenrel latency ...
    (Linux-Kernel)
  • Re: wpa_supplicant features and compile options
    ... require the EAP_GTC and EAP_OTP features in wpa_supplicant. ... Using the patch below works great, but it's inconvenient having to ... I'm unable to comment on including your patch into cvs, ... integrate a bunch of patches into /usr/src. ...
    (freebsd-stable)
  • Re: 6/06 -> 11/06 with patches
    ... ALL new features become available via patches. ... should be the case that it's mostly-safe to patch a production machine, ... I'm sure Sun haven't done this particular thing and would not ...
    (comp.unix.solaris)
  • [PATCH 0/9] au1xmmc updates #3
    ... The following set of patches remove demoboard-specific code from the ... au1xmmc.c driver and adds new features. ... Patch #1 is required to get the driver to build as a module. ... Patch #2 is required to be able to load/unload the driver> 16 times. ...
    (Linux-Kernel)