linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>
To: Hari Bathini <hbathini@linux.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>,
	Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
	Vasant Hegde <hegdevasant@linux.ibm.com>,
	linuxppc-dev <linuxppc-dev@ozlabs.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Stewart Smith <stewart@linux.ibm.com>,
	Daniel Axtens <dja@axtens.net>
Subject: Re: [PATCH v2 15/16] powernv/fadump: consider f/w load area
Date: Tue, 7 May 2019 22:43:31 +0530	[thread overview]
Message-ID: <20190507171331.p5wwzc3asvpkltxb@in.ibm.com> (raw)
In-Reply-To: <155541097094.812.18328895014763068053.stgit@hbathini.in.ibm.com>

On 2019-04-16 16:06:13 Tue, Hari Bathini wrote:
> OPAL loads kernel & initrd at 512MB offset (256MB size), also exported
> as ibm,opal/dump/fw-load-area. So, if boot memory size of FADump is
> less than 768MB, kernel memory to be exported as '/proc/vmcore' would
> be overwritten by f/w while loading kernel & initrd. To avoid such a
> scenario, enforce a minimum boot memory size of 768MB on OPAL platform.
> 
> Also, skip using FADump if a newer F/W version loads kernel & initrd
> above 768MB.
> 
> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
> ---
>  arch/powerpc/kernel/fadump-common.h          |   15 +++++++++++++--
>  arch/powerpc/kernel/fadump.c                 |    8 ++++++++
>  arch/powerpc/platforms/powernv/opal-fadump.c |   23 +++++++++++++++++++++++
>  3 files changed, 44 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/fadump-common.h b/arch/powerpc/kernel/fadump-common.h
> index 1bd3aeb..f59fdc7 100644
> --- a/arch/powerpc/kernel/fadump-common.h
> +++ b/arch/powerpc/kernel/fadump-common.h
> @@ -24,14 +24,25 @@
>  #define RMA_END		(ppc64_rma_size)
>  
>  /*
> + * With kernel & initrd loaded at 512MB (with 256MB size), enforce a minimum
> + * boot memory size of 768MB to ensure f/w loading kernel and initrd doesn't
> + * mess with crash'ed kernel's memory during MPIPL.
> + */
> +#define OPAL_MIN_BOOT_MEM	(0x30000000UL)
> +
> +/*
>   * On some Power systems where RMO is 128MB, it still requires minimum of
>   * 256MB for kernel to boot successfully. When kdump infrastructure is
>   * configured to save vmcore over network, we run into OOM issue while
>   * loading modules related to network setup. Hence we need additional 64M
>   * of memory to avoid OOM issue.
>   */
> -#define MIN_BOOT_MEM	(((RMA_END < (0x1UL << 28)) ? (0x1UL << 28) : RMA_END) \
> -			+ (0x1UL << 26))
> +#define PSERIES_MIN_BOOT_MEM	(((RMA_END < (0x1UL << 28)) ? (0x1UL << 28) : \
> +				 RMA_END) + (0x1UL << 26))
> +
> +#define MIN_BOOT_MEM	((fw_dump.fadump_platform ==			\
> +			 FADUMP_PLATFORM_POWERNV) ? OPAL_MIN_BOOT_MEM :	\
> +			 PSERIES_MIN_BOOT_MEM)

Can we hide this behind fadump_ops.get_bootmem_min() instead of common code
doing platform check ?

>  
>  /* The upper limit percentage for user specified boot memory size (25%) */
>  #define MAX_BOOT_MEM_RATIO			4
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index ba26169..3c3adc2 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -582,6 +582,14 @@ int __init fadump_reserve_mem(void)
>  				ALIGN(fw_dump.boot_memory_size,
>  							FADUMP_CMA_ALIGNMENT);
>  #endif
> +
> +		if ((fw_dump.fadump_platform == FADUMP_PLATFORM_POWERNV) &&
> +		    (fw_dump.boot_memory_size < OPAL_MIN_BOOT_MEM)) {

and here too.. fadump_ops.validate_bootmem_size() ? push platform specific
stuff behind fadump_ops.

Rest looks good.

Thanks,
-Mahesh.


  reply	other threads:[~2019-05-07 17:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 10:32 [PATCH v2 00/16] Add FADump support on PowerNV platform Hari Bathini
2019-04-16 10:33 ` [PATCH v2 01/16] powerpc/fadump: move internal fadump code to a new file Hari Bathini
2019-04-16 10:33 ` [PATCH v2 02/16] powerpc/fadump: Improve fadump documentation Hari Bathini
2019-04-16 10:33 ` [PATCH v2 03/16] pseries/fadump: move out platform specific support from generic code Hari Bathini
2019-04-16 10:33 ` [PATCH v2 04/16] powerpc/fadump: use FADump instead of fadump for how it is pronounced Hari Bathini
2019-04-16 10:34 ` [PATCH v2 05/16] powerpc/fadump: enable fadump support on OPAL based POWER platform Hari Bathini
2019-04-16 10:34 ` [PATCH v2 06/16] powerpc/fadump: Update documentation about OPAL platform support Hari Bathini
2019-04-16 10:34 ` [PATCH v2 07/16] powerpc/fadump: consider reserved ranges while reserving memory Hari Bathini
2019-04-16 10:34 ` [PATCH v2 08/16] powerpc/fadump: consider reserved ranges while releasing memory Hari Bathini
2019-04-16 10:35 ` [PATCH v2 09/16] powernv/fadump: process architected register state data provided by firmware Hari Bathini
2019-05-07 14:13   ` Mahesh J Salgaonkar
2019-05-07 16:00     ` Segher Boessenkool
2019-05-09  4:42       ` Hari Bathini
2019-04-16 10:35 ` [PATCH v2 10/16] powernv/fadump: add support to preserve crash data on FADUMP disabled kernel Hari Bathini
2019-04-16 10:35 ` [PATCH v2 11/16] powerpc/fadump: update documentation about CONFIG_PRESERVE_FA_DUMP Hari Bathini
2019-04-16 10:35 ` [PATCH v2 12/16] powerpc/powernv: export /proc/opalcore for analysing opal crashes Hari Bathini
2019-05-08  0:25   ` Nicholas Piggin
2019-05-09  4:46     ` Hari Bathini
2019-04-16 10:35 ` [PATCH v2 13/16] powernv/fadump: Skip processing /proc/vmcore when only OPAL core exists Hari Bathini
2019-04-16 10:36 ` [PATCH v2 14/16] powernv/opalcore: provide an option to invalidate /proc/opalcore file Hari Bathini
2019-04-16 10:36 ` [PATCH v2 15/16] powernv/fadump: consider f/w load area Hari Bathini
2019-05-07 17:13   ` Mahesh J Salgaonkar [this message]
2019-05-09  4:50     ` Hari Bathini
2019-04-16 10:36 ` [PATCH v2 16/16] powernv/fadump: update documentation about option to release opalcore Hari Bathini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190507171331.p5wwzc3asvpkltxb@in.ibm.com \
    --to=mahesh@linux.vnet.ibm.com \
    --cc=ananth@linux.ibm.com \
    --cc=dja@axtens.net \
    --cc=hbathini@linux.ibm.com \
    --cc=hegdevasant@linux.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mahesh@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=stewart@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).