From: Michael Holzheu <[email protected]>

On s390 we create checksums for the loaded kexec segments case of kdump.
Therefore we need an additional callback at the end of the kexec_load()
system call. This patch introduces machine_kexec_finish() with an empty
implementation for all architectures that do not need the callback.

Signed-off-by: Michael Holzheu <[email protected]>
---
 include/linux/kexec.h |    1 +
 kernel/kexec.c        |    8 ++++++++
 2 files changed, 9 insertions(+)

--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -115,6 +115,7 @@ struct kimage {
 /* kexec interface functions */
 extern void machine_kexec(struct kimage *image);
 extern int machine_kexec_prepare(struct kimage *image);
+extern void machine_kexec_finish(struct kimage *image, int flags);
 extern void machine_kexec_cleanup(struct kimage *image);
 extern asmlinkage long sys_kexec_load(unsigned long entry,
                                        unsigned long nr_segments,
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1017,6 +1017,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned lon
                kimage_terminate(image);
        }
        /* Install the new kernel, and  Uninstall the old */
+       machine_kexec_finish(image, flags);
        image = xchg(dest_image, image);
 
 out:
@@ -1026,6 +1027,13 @@ out:
        return result;
 }
 
+/*
+ * provide an empty default implementation here -- architecture
+ * code may override this
+ */
+void __weak machine_kexec_finish(struct kimage *image, int flags)
+{}
+
 #ifdef CONFIG_COMPAT
 asmlinkage long compat_sys_kexec_load(unsigned long entry,
                                unsigned long nr_segments,


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to