[PATCH] powerpc/kdump: handle crashkernel memory reservation failure

David Gibson dgibson at redhat.com
Thu Jun 28 15:32:56 AEST 2018


On Thu, 28 Jun 2018 10:49:56 +0530
Hari Bathini <hbathini at linux.ibm.com> wrote:

> 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 at linux.ibm.com>

Tested-by: David Gibson <dgibson at redhat.com>

> ---
>  arch/powerpc/kernel/machine_kexec.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
> index 936c7e2..6181442 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)) {
> +		printk(KERN_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)
> 


-- 
David Gibson <dgibson at redhat.com>
Principal Software Engineer, Virtualization, Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20180628/202ecbb3/attachment.sig>


More information about the Linuxppc-dev mailing list