[Skiboot] [PATCH v7 04/22] hdata: Define various DUMP related tables
Michael Neuling
mikey at neuling.org
Thu May 9 10:55:15 AEST 2019
On Sat, 2019-04-13 at 14:45 +0530, Vasant Hegde wrote:
> - MDDT is used by OPAL to pass destination memory details to hostboot.
> - MDRT is used by hostboot to pass post dump result table to OPAL.
> - Processor dump area is used to capture architected register data.
>
> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> ---
> hdata/spira.c | 1 +
> hdata/spira.h | 5 ++--
> include/opal-dump.h | 67
> +++++++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 71 insertions(+), 2 deletions(-)
>
> diff --git a/hdata/spira.c b/hdata/spira.c
> index e3b8be08e..69fd91531 100644
> --- a/hdata/spira.c
> +++ b/hdata/spira.c
> @@ -1683,6 +1683,7 @@ static void fixup_spira(void)
> spira.ntuples.mdump_src = spirah.ntuples.mdump_src;
> spira.ntuples.mdump_dst = spirah.ntuples.mdump_dst;
> spira.ntuples.mdump_res = spirah.ntuples.mdump_res;
> + spira.ntuples.proc_dump_area = spirah.ntuples.proc_dump_area;
> spira.ntuples.pcia = spiras->ntuples.pcia;
> spira.ntuples.proc_chip = spiras->ntuples.proc_chip;
> spira.ntuples.hs_data = spiras->ntuples.hs_data;
> diff --git a/hdata/spira.h b/hdata/spira.h
> index 41159d2ba..3ee23afdf 100644
> --- a/hdata/spira.h
> +++ b/hdata/spira.h
> @@ -1,4 +1,4 @@
> -/* Copyright 2013-2017 IBM Corp.
> +/* Copyright 2013-2019 IBM Corp.
> *
> * Licensed under the Apache License, Version 2.0 (the "License");
> * you may not use this file except in compliance with the License.
> @@ -76,6 +76,7 @@ struct spira_ntuples {
> struct spira_ntuple hs_data; /* 0x320 */
> struct spira_ntuple ipmi_sensor; /* 0x360 */
> struct spira_ntuple node_stb_data; /* 0x380 */
> + struct spira_ntuple proc_dump_area; /* 0x400 */
> };
>
> struct spira {
> @@ -89,7 +90,7 @@ struct spira {
> *
> * According to FSP engineers, this is an okay thing to do.
> */
> - u8 reserved[0x80];
> + u8 reserved[0x60];
Why is this changing?
> } __packed __align(0x100);
>
> extern struct spira spira;
> diff --git a/include/opal-dump.h b/include/opal-dump.h
> index 2baa770dd..a35520fbc 100644
> --- a/include/opal-dump.h
> +++ b/include/opal-dump.h
> @@ -55,4 +55,71 @@ struct mdst_table {
> __be32 size;
> } __packed;
>
> +/* Memory dump destination table (MDDT) */
> +struct mddt_table {
> + __be64 addr;
> + uint8_t data_region; /* Same as mdst_table->data_region */
> + uint8_t dump_type; /* Same as mdst_table->dump_type */
> + __be16 reserved;
> + __be32 size;
> +} __packed;
> +
> +/*
> + * Memory dump result table (MDRT)
> + *
> + * List of the memory ranges that have been included in the dump. This table
> is
> + * filled by hostboot and passed to OPAL on second boot. OPAL/payload will
> use
> + * this table to extract the dump.
> + */
> +struct mdrt_table {
> + __be64 src_addr;
> + __be64 dest_addr;
> + uint8_t data_region; /* Same as mdst_table->data_region */
> + uint8_t dump_type; /* Same as mdst_table->dump_type */
> + __be16 reserved;
> + __be32 size;
> + __be64 padding;
> +} __packed;
> +
> +/*
> + * Processor Dump Area
> + *
> + * This contains the information needed for having processor
> + * state captured during a platform dump.
> + */
> +struct proc_dump_area {
> + __be32 thread_size; /* Size of each thread register entry */
> +#define PROC_DUMP_AREA_FORMAT_P9 0x1 /* P9 format */
This is P9 only?
> + uint8_t version; /* P9 - 0x1 */
> + uint8_t reserved[11];
> + __be64 alloc_addr; /* Destination memory to place register data
> */
> + __be32 reserved2;
> + __be32 alloc_size; /* Allocated size */
> + __be64 dest_addr; /* Destination address */
> + __be32 reserved3;
> + __be32 act_size; /* Actual data size */
> +} __packed;
> +
> +struct proc_reg_data_hdr {
> + /* PIR value of the thread */
> + __be32 pir;
> + /* 0x00 - 0x0F - The corresponding stop state of the core */
> + uint8_t core_state;
> + uint8_t reserved[3];
> +
> + uint32_t offset; /* Offset to Register Entries array */
> + uint32_t ecnt; /* Number of entries */
> + uint32_t esize; /* Alloc size of each array entry in bytes */
> + uint32_t eactsz; /* Actual size of each array entry in bytes */
> +} __packed;
> +
> +/* Architected register data content */
> +#define ARCH_REG_TYPE_GPR 0x01
> +#define ARCH_REG_TYPE_SPR 0x02
What about VSX registers?
I assume all these structures are defined elsewhere, but they are very sparse.
Like this below one, could just be all 32 GPRs in one dump, rather than
specifying them one at a time.
> +struct proc_reg_data {
> + uint32_t reg_type; /* ARCH_REG_TYPE_* */
> + uint32_t reg_num;
> + uint64_t reg_val;
> +} __packed;
> +
> #endif /* __OPAL_DUMP_H */
More information about the Skiboot
mailing list