提交 b66ac63e 编写于 作者: M Michael Holzheu 提交者: Martin Schwidefsky

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: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 41ef2d56
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/ftrace.h> #include <linux/ftrace.h>
#include <linux/debug_locks.h> #include <linux/debug_locks.h>
#include <linux/suspend.h>
#include <asm/cio.h> #include <asm/cio.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -67,6 +68,35 @@ void setup_regs(void) ...@@ -67,6 +68,35 @@ void setup_regs(void)
memcpy((void *) SAVE_AREA_BASE, (void *) sa, sizeof(struct save_area)); memcpy((void *) SAVE_AREA_BASE, (void *) sa, sizeof(struct save_area));
} }
/*
* PM notifier callback for kdump
*/
static int machine_kdump_pm_cb(struct notifier_block *nb, unsigned long action,
void *ptr)
{
switch (action) {
case PM_SUSPEND_PREPARE:
case PM_HIBERNATION_PREPARE:
if (crashk_res.start)
crash_map_reserved_pages();
break;
case PM_POST_SUSPEND:
case PM_POST_HIBERNATION:
if (crashk_res.start)
crash_unmap_reserved_pages();
break;
default:
return NOTIFY_DONE;
}
return NOTIFY_OK;
}
static int __init machine_kdump_pm_init(void)
{
pm_notifier(machine_kdump_pm_cb, 0);
return 0;
}
arch_initcall(machine_kdump_pm_init);
#endif #endif
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册