diff options
author | Michael Holzheu <holzheu@linux.vnet.ibm.com> | 2013-04-04 13:49:53 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-04-15 07:34:44 -0400 |
commit | b66ac63e20b3f4d7931e67c986956aa5ffbea57f (patch) | |
tree | f0da72ef98032f4606f9938d9c6eef56b519b6e2 /arch/s390/kernel/machine_kexec.c | |
parent | 41ef2d5678d83af030125550329b6ae8b74618fa (diff) |
s390/kdump: Add PM notifier for kdump
For s390 the page table mapping for the crashkernel memory is removed to
protect the pre-loaded kdump kernel and ramdisk. Because the crashkernel
memory is not included in the page tables for suspend/resume it is not
included in the suspend image. Therefore after resume the resumed system
does no longer contain the pre-loaded kdump kernel and when kdump is
triggered it fails.
This patch adds a PM notifier that creates the page tables before suspend
is done and removes them for resume. This ensures that the kdump kernel
is included in the suspend image.
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/machine_kexec.c')
-rw-r--r-- | arch/s390/kernel/machine_kexec.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c index b3de27700016..ac2178161ec3 100644 --- a/arch/s390/kernel/machine_kexec.c +++ b/arch/s390/kernel/machine_kexec.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/reboot.h> | 13 | #include <linux/reboot.h> |
14 | #include <linux/ftrace.h> | 14 | #include <linux/ftrace.h> |
15 | #include <linux/debug_locks.h> | 15 | #include <linux/debug_locks.h> |
16 | #include <linux/suspend.h> | ||
16 | #include <asm/cio.h> | 17 | #include <asm/cio.h> |
17 | #include <asm/setup.h> | 18 | #include <asm/setup.h> |
18 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
@@ -67,6 +68,35 @@ void setup_regs(void) | |||
67 | memcpy((void *) SAVE_AREA_BASE, (void *) sa, sizeof(struct save_area)); | 68 | memcpy((void *) SAVE_AREA_BASE, (void *) sa, sizeof(struct save_area)); |
68 | } | 69 | } |
69 | 70 | ||
71 | /* | ||
72 | * PM notifier callback for kdump | ||
73 | */ | ||
74 | static int machine_kdump_pm_cb(struct notifier_block *nb, unsigned long action, | ||
75 | void *ptr) | ||
76 | { | ||
77 | switch (action) { | ||
78 | case PM_SUSPEND_PREPARE: | ||
79 | case PM_HIBERNATION_PREPARE: | ||
80 | if (crashk_res.start) | ||
81 | crash_map_reserved_pages(); | ||
82 | break; | ||
83 | case PM_POST_SUSPEND: | ||
84 | case PM_POST_HIBERNATION: | ||
85 | if (crashk_res.start) | ||
86 | crash_unmap_reserved_pages(); | ||
87 | break; | ||
88 | default: | ||
89 | return NOTIFY_DONE; | ||
90 | } | ||
91 | return NOTIFY_OK; | ||
92 | } | ||
93 | |||
94 | static int __init machine_kdump_pm_init(void) | ||
95 | { | ||
96 | pm_notifier(machine_kdump_pm_cb, 0); | ||
97 | return 0; | ||
98 | } | ||
99 | arch_initcall(machine_kdump_pm_init); | ||
70 | #endif | 100 | #endif |
71 | 101 | ||
72 | /* | 102 | /* |