[patch 2/9] kdump: Add machine_kexec_finish()

Michael Holzheu
2011-07-04T17:11:46Z

[-- Attachment #1: 02-s390-kdump-common-kexec_finish.patch --]
[-- Type: text/plain, Size: 1571 bytes --]

From: Michael Holzheu <holzheu@linux.vnet.ibm.com>

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 <holzheu@linux.vnet.ibm.com>
---
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,