diff options
author | Hari Bathini <[email protected]> | 2018-06-28 10:49:56 +0530 |
---|---|---|
committer | Michael Ellerman <[email protected]> | 2018-07-04 22:40:24 +1000 |
commit | 8950329c4a64c6d3ca0bc34711a1afbd9ce05657 (patch) | |
tree | 1080055d6988b7bef1dc7a3e8c2c2dd4564dc6e7 | |
parent | 741c5640a15a23a2ec3a0846668a82e8e3b4314d (diff) |
powerpc/kdump: Handle crashkernel memory reservation failure
Memory reservation for crashkernel could fail if there are holes around
kdump kernel offset (128M). Fail gracefully in such cases and print an
error message.
Signed-off-by: Hari Bathini <[email protected]>
Tested-by: David Gibson <[email protected]>
Reviewed-by: Dave Young <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
-rw-r--r-- | arch/powerpc/kernel/machine_kexec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index 936c7e2d421e..b53401334e81 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -188,7 +188,12 @@ void __init reserve_crashkernel(void) (unsigned long)(crashk_res.start >> 20), (unsigned long)(memblock_phys_mem_size() >> 20)); - memblock_reserve(crashk_res.start, crash_size); + if (!memblock_is_region_memory(crashk_res.start, crash_size) || + memblock_reserve(crashk_res.start, crash_size)) { + pr_err("Failed to reserve memory for crashkernel!\n"); + crashk_res.start = crashk_res.end = 0; + return; + } } int overlaps_crashkernel(unsigned long start, unsigned long size) |