diff options
author | Hari Bathini <hbathini@linux.ibm.com> | 2018-06-28 10:49:56 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-03 17:00:48 -0700 |
commit | 769ae06e4442d9efc4c2a7494ed0f348b6efb7ba (patch) | |
tree | c6218d0a846076ab06b2ea2ebdbcbdb22e111ef2 /arch/powerpc | |
parent | 333cb98f393ba2edd0e2f8577d823c0ffd9fef4b (diff) | |
download | linux-stable-769ae06e4442d9efc4c2a7494ed0f348b6efb7ba.tar.gz linux-stable-769ae06e4442d9efc4c2a7494ed0f348b6efb7ba.tar.bz2 linux-stable-769ae06e4442d9efc4c2a7494ed0f348b6efb7ba.zip |
powerpc/kdump: Handle crashkernel memory reservation failure
[ Upstream commit 8950329c4a64c6d3ca0bc34711a1afbd9ce05657 ]
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 <hbathini@linux.ibm.com>
Tested-by: David Gibson <dgibson@redhat.com>
Reviewed-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc')
-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 2694d078741d..9dafd7af39b8 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -186,7 +186,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) |