[PATCH v4 18/25] powernv/fadump: process architected register state data provided by firmware

Mahesh J Salgaonkar mahesh at linux.vnet.ibm.com
Thu Aug 15 03:15:03 AEST 2019


On 2019-07-16 17:04:08 Tue, Hari Bathini wrote:
> From: Hari Bathini <hbathini at linux.vnet.ibm.com>
> 
> Firmware provides architected register state data at the time of crash.
> Process this data and build CPU notes to append to ELF core.
> 
> Signed-off-by: Hari Bathini <hbathini at linux.vnet.ibm.com>
> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> ---
>  arch/powerpc/kernel/fadump-common.h          |    4 +
>  arch/powerpc/platforms/powernv/opal-fadump.c |  197 ++++++++++++++++++++++++--
>  arch/powerpc/platforms/powernv/opal-fadump.h |   39 +++++
>  3 files changed, 228 insertions(+), 12 deletions(-)
> 
[...]
> @@ -430,6 +577,32 @@ int __init opal_fadump_dt_scan(struct fw_dump *fadump_conf, ulong node)
>  			return 1;
>  		}
>  
> +		ret = opal_mpipl_query_tag(OPAL_MPIPL_TAG_CPU, &addr);
> +		if ((ret != OPAL_SUCCESS) || !addr) {
> +			pr_err("Failed to get CPU metadata (%lld)\n", ret);
> +			return 1;
> +		}
> +
> +		addr = be64_to_cpu(addr);
> +		pr_debug("CPU metadata addr: %llx\n", addr);
> +
> +		opal_cpu_metadata = __va(addr);
> +		r_opal_cpu_metadata = (void *)addr;
> +		fadump_conf->cpu_state_data_version =
> +			be32_to_cpu(r_opal_cpu_metadata->cpu_data_version);
> +		if (fadump_conf->cpu_state_data_version !=
> +		    HDAT_FADUMP_CPU_DATA_VERSION) {
> +			pr_err("CPU data format version (%lu) mismatch!\n",
> +			       fadump_conf->cpu_state_data_version);
> +			return 1;
> +		}
> +		fadump_conf->cpu_state_entry_size =
> +			be32_to_cpu(r_opal_cpu_metadata->cpu_data_size);
> +		fadump_conf->cpu_state_destination_addr =
> +			be64_to_cpu(r_opal_cpu_metadata->region[0].dest);
> +		fadump_conf->cpu_state_data_size =
> +			be64_to_cpu(r_opal_cpu_metadata->region[0].size);
> +

opal_fadump_dt_scan isn't the right place to do this. Can you please move above
cpu related data processing to opal_fadump_build_cpu_notes() ?

Thanks,
-Mahesh.

>  		pr_info("Firmware-assisted dump is active.\n");
>  		fadump_conf->dump_active = 1;
>  		opal_fadump_get_config(fadump_conf, r_opal_fdm_active);



More information about the Linuxppc-dev mailing list