[PATCH] powerpc/fadump: set an upper limit for boot memory size

Michael Ellerman mpe at ellerman.id.au
Fri Feb 17 17:24:11 AEDT 2017


Hari Bathini <hbathini at linux.vnet.ibm.com> writes:

> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index de7d39a..d5107f4 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -222,6 +222,18 @@ static inline unsigned long fadump_calculate_reserve_size(void)
>  				&size, &base);
>  	if (ret == 0 && size > 0) {
>  		fw_dump.reserve_bootvar = (unsigned long)size;
> +		/*
> +		 * Adjust if the boot memory size specified is above
> +		 * the upper limit.
> +		 */
> +		if (fw_dump.reserve_bootvar >
> +		    (memblock_end_of_DRAM() / MAX_BOOT_MEM_RATIO)) {

Using memblock_end_of_DRAM() doesn't take into account the fact that you
might have holes in your memory layout.

Possibly on PowerVM that never happens, but I don't think we should
write the code to assume that, if possible.

cheers


More information about the Linuxppc-dev mailing list