[v4,22/25] powernv/fadump: Warn before processing partial crashdump
diff mbox series

Message ID 156327687873.27462.9042420686385726788.stgit@hbathini.in.ibm.com
State Changes Requested
Headers show
Series
  • Add FADump support on PowerNV platform
Related show

Checks

Context Check Description
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Hari Bathini July 16, 2019, 11:34 a.m. UTC
If not all kernel boot memory regions are registered for MPIPL before
system crashes, try processing the partial crashdump but warn the user
before proceeding.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
 arch/powerpc/platforms/powernv/opal-fadump.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Mahesh J Salgaonkar Aug. 16, 2019, 5:59 a.m. UTC | #1
On 2019-07-16 17:04:38 Tue, Hari Bathini wrote:
> If not all kernel boot memory regions are registered for MPIPL before
> system crashes, try processing the partial crashdump but warn the user
> before proceeding.
> 
> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
> ---
>  arch/powerpc/platforms/powernv/opal-fadump.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/arch/powerpc/platforms/powernv/opal-fadump.c b/arch/powerpc/platforms/powernv/opal-fadump.c
> index b55f25c..3ef212d 100644
> --- a/arch/powerpc/platforms/powernv/opal-fadump.c
> +++ b/arch/powerpc/platforms/powernv/opal-fadump.c
> @@ -136,6 +136,27 @@ static void opal_fadump_get_config(struct fw_dump *fadump_conf,
>  		last_end = base + size;
>  	}
>  
> +	/*
> +	 * Rarely, but it can so happen that system crashes before all
> +	 * boot memory regions are registered for MPIPL. In such
> +	 * cases, warn that the vmcore may not be accurate and proceed
> +	 * anyway as that is the best bet considering free pages, cache
> +	 * pages, user pages, etc are usually filtered out.
> +	 *
> +	 * Hope the memory that could not be preserved only has pages
> +	 * that are usually filtered out while saving the vmcore.
> +	 */
> +	if (fdm->region_cnt < fdm->registered_regions) {
> +		pr_warn("The crashdump may not be accurate as the below boot memory regions could not be preserved:\n");

This would be opal crashing while kernel is middle of gearing itself for
fadump. If you decide to still go ahead with partial dump then you will need to
have nice warning message about dump capture (makedmpfile capture) may
fail, but we will still have full opal core that can help in analysis.

Thanks,
-Mahesh.

Patch
diff mbox series

diff --git a/arch/powerpc/platforms/powernv/opal-fadump.c b/arch/powerpc/platforms/powernv/opal-fadump.c
index b55f25c..3ef212d 100644
--- a/arch/powerpc/platforms/powernv/opal-fadump.c
+++ b/arch/powerpc/platforms/powernv/opal-fadump.c
@@ -136,6 +136,27 @@  static void opal_fadump_get_config(struct fw_dump *fadump_conf,
 		last_end = base + size;
 	}
 
+	/*
+	 * Rarely, but it can so happen that system crashes before all
+	 * boot memory regions are registered for MPIPL. In such
+	 * cases, warn that the vmcore may not be accurate and proceed
+	 * anyway as that is the best bet considering free pages, cache
+	 * pages, user pages, etc are usually filtered out.
+	 *
+	 * Hope the memory that could not be preserved only has pages
+	 * that are usually filtered out while saving the vmcore.
+	 */
+	if (fdm->region_cnt < fdm->registered_regions) {
+		pr_warn("The crashdump may not be accurate as the below boot memory regions could not be preserved:\n");
+		i = fdm->registered_regions;
+		while (i < fdm->region_cnt) {
+			pr_warn("\t%d. base: 0x%llx, size: 0x%llx\n",
+				(i + 1), fdm->rgn[i].src,
+				fdm->rgn[i].size);
+			i++;
+		}
+	}
+
 	fadump_conf->boot_mem_top = (fadump_conf->boot_memory_size + hole_size);
 	fadump_conf->boot_mem_regs_cnt = fdm->region_cnt;
 	opal_fadump_update_config(fadump_conf, fdm);