diff options
Diffstat (limited to 'src/include/usr')
| -rw-r--r-- | src/include/usr/dump/dumpif.H | 113 | ||||
| -rw-r--r-- | src/include/usr/dump/dumpreasoncodes.H | 34 | ||||
| -rw-r--r-- | src/include/usr/runtime/runtime.H | 20 | ||||
| -rw-r--r-- | src/include/usr/vmmconst.h | 6 |
4 files changed, 155 insertions, 18 deletions
diff --git a/src/include/usr/dump/dumpif.H b/src/include/usr/dump/dumpif.H index 21bdde05c..ea48a71fd 100644 --- a/src/include/usr/dump/dumpif.H +++ b/src/include/usr/dump/dumpif.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2018 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,6 +25,8 @@ #ifndef __DUMPIF_H #define __DUMPIF_H +#include <hdat/hdat.H> + /** @file dumpif.H * @brief Provides the external interfaces for dump. * - copy dump data from src to destination @@ -34,7 +36,6 @@ namespace DUMP { - /** * @brief DUMP Message Types */ @@ -85,7 +86,7 @@ namespace DUMP #define DUMP_TEST_TABLE_SIZE (DUMP_TEST_SRC_MEM_SIZE + \ DUMP_TEST_DST_MEM_SIZE + DUMP_TEST_RESULTS_MEM_SIZE) - + #define DUMP_TEST_TABLE_END (DUMP_TEST_TABLE_START + DUMP_TEST_TABLE_SIZE) // In addition to the dump table locations we have scratch data area that is @@ -118,6 +119,112 @@ namespace DUMP } PACKED; + // Processor Dump Area table format + struct procDumpAreaEntry + { + uint32_t threadRegSize; // Architected reg data size per thread + uint8_t threadRegVersion; // Data format version + uint8_t reserved1[11]; // Reserved + uint64_t dstArrayAddr; // Hypervisor passed destination addresss + uint8_t reserved2[4]; // Reserved + uint32_t dstArraySize; // Hypervisor passed destination size + uint64_t capArrayAddr; // Actual destination address (filled by HB) + uint8_t reserved3[4]; // Reserved + uint32_t capArraySize; // Actual destination size (filled by HB) + } PACKED; + + // Host formatted architected register data content (as per HDAT spec) + struct hostArchRegDataHdr + { + uint32_t pir; + uint8_t coreState; + uint8_t reserved[3]; + HDAT::hdatHDIFDataArray_t iv_regArrayHdr; + } PACKED; + + #define DUMP_ARCH_REG_TYPE_GPR 0x01 + #define DUMP_ARCH_REG_TYPE_SPR 0x02 + + // Architected register data content entries + struct hostArchRegDataEntry + { + uint32_t regType; + uint32_t regNum; + uint64_t regVal; + } PACKED; + + // Structure version used to share SPR/GPR register data between + // SBE and HB + #define REG_DUMP_SBE_HB_STRUCT_VER 0x1 + + // Structure version used to share SPR/GPR register data between + // HB and OPAL + #define REG_DUMP_HDAT_STRUCT_VER 0x1 + + /* Processor architected dump header. This header is per processor*/ + struct sbeArchRegDumpProcHdr_t + { + uint8_t ownerId; /* FSP or SBE */ + uint8_t version; /* Interface version number*/ + uint16_t core_cnt; /* Actual number of core whose register data will be obtained */ + uint16_t thread_cnt; /* Total number of thread whose register data will be obtained */ + uint16_t reg_cnt; /* Max number of registers per thread */ + } PACKED; //8Bytes + + // SBE formatted architected registers data + // (Common structure between SBE and Hostboot) + struct sbeArchRegDumpThreadHdr_t + { + uint32_t pir; // PIR value of thread corresponding to register + uint32_t coreState:8; // State of core in which this thread is present + uint32_t reserved:24; + } PACKED; + + /** + * @brief Defines the structure for storing the SPR/GPR register data + * + * @var isRegDataValid :'1'- Variable regVal will contain valid register + * '0'- Variable regVal will contain fapiRC value + * + * @var isLastReg :'1' - Data is collected for the last SPR/GPR register + * '0' - otherwise. + * + * @var isFfdcPresent :'1' - Failing FAPI FFDC is shared + * '0' - Failing FFDC is not present + * + * @var reserved0 :Reserved for future use and padding + * + * @var regType :Indicates type of register(SPR/GPR) + * + * @var reserved1 :Reserved for future use and padding + * + * @var regNum :Address of the SPR/GPR register + * + * @var regVal :if isRegDataValid is '0' - Valid Register value + * isRegDataValid is '!=0'- fapiRC value. + */ + struct sbeArchRegDumpEntries_t + { + uint64_t isRegDataValid:1; + uint64_t isLastReg:1; + uint64_t isFfdcPresent:1; + uint64_t reseverd0:5; + uint64_t regType:8; + uint64_t reserved1:16; + uint64_t regNum:32; + uint64_t regVal; + } PACKED; + + /** + * @brief This function copies the architected register data content + * from SBE reserved memory to hypervisor allocated memory + * + * @param[in] void + * + * @return errlHndl_t + */ + errlHndl_t copyArchitectedRegs(void); + /** * @brief This function is a wrapper function that calls * getHostDataPtrs to get the MDDT, MDST, MDRT pointers diff --git a/src/include/usr/dump/dumpreasoncodes.H b/src/include/usr/dump/dumpreasoncodes.H index fb959fdca..eeeec126a 100644 --- a/src/include/usr/dump/dumpreasoncodes.H +++ b/src/include/usr/dump/dumpreasoncodes.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -32,22 +34,28 @@ namespace DUMP DUMP_COLLECT_INVALID = 0x00, DUMP_COLLECT = 0x01, DUMP_SEND_MBOX_MSG = 0x02, + DUMP_ARCH_REGS = 0x03, }; enum dumpReasonCode { - DUMP_INVALID_ADDR = DUMP_COMP_ID | 0x01, - DUMP_NO_HDAT_ADDR = DUMP_COMP_ID | 0x02, - DUMP_CANNOT_MAP = DUMP_COMP_ID | 0x03, - DUMP_CANNOT_UNMAP_SRC = DUMP_COMP_ID | 0x04, - DUMP_CANNOT_UNMAP_DEST = DUMP_COMP_ID | 0x05, - DUMP_CANNOT_UNMAP_RESULTS = DUMP_COMP_ID | 0x06, - DUMP_MDRT_INSUFFICIENT_SPACE = DUMP_COMP_ID | 0x07, - DUMP_MDST_INSUFFICIENT_SPACE = DUMP_COMP_ID | 0x08, - DUMP_MDDT_INSUFFICIENT_SPACE = DUMP_COMP_ID | 0x09, - DUMP_MDDT_INSUFFICIENT_ENTRIES = DUMP_COMP_ID | 0x0A, - DUMP_MDST_INVALID_TABLE_SIZE = DUMP_COMP_ID | 0x0B, - DUMP_MDDT_INVALID_TABLE_SIZE = DUMP_COMP_ID | 0x0C, + DUMP_INVALID_ADDR = DUMP_COMP_ID | 0x01, + DUMP_NO_HDAT_ADDR = DUMP_COMP_ID | 0x02, + DUMP_CANNOT_MAP = DUMP_COMP_ID | 0x03, + DUMP_CANNOT_UNMAP_SRC = DUMP_COMP_ID | 0x04, + DUMP_CANNOT_UNMAP_DEST = DUMP_COMP_ID | 0x05, + DUMP_CANNOT_UNMAP_RESULTS = DUMP_COMP_ID | 0x06, + DUMP_MDRT_INSUFFICIENT_SPACE = DUMP_COMP_ID | 0x07, + DUMP_MDST_INSUFFICIENT_SPACE = DUMP_COMP_ID | 0x08, + DUMP_MDDT_INSUFFICIENT_SPACE = DUMP_COMP_ID | 0x09, + DUMP_MDDT_INSUFFICIENT_ENTRIES = DUMP_COMP_ID | 0x0A, + DUMP_MDST_INVALID_TABLE_SIZE = DUMP_COMP_ID | 0x0B, + DUMP_MDDT_INVALID_TABLE_SIZE = DUMP_COMP_ID | 0x0C, + DUMP_PDAT_INVALID_ADDR = DUMP_COMP_ID | 0x0D, + DUMP_PDAT_CANNOT_UNMAP_SRC_ADDR = DUMP_COMP_ID | 0x0E, + DUMP_PDAT_CANNOT_UNMAP_DST_ADDR = DUMP_COMP_ID | 0x0F, + DUMP_PDAT_INSUFFICIENT_SPACE = DUMP_COMP_ID | 0x10, + DUMP_PDAT_VERSION_MISMATCH = DUMP_COMP_ID | 0x11, }; }; diff --git a/src/include/usr/runtime/runtime.H b/src/include/usr/runtime/runtime.H index b5e717e2b..9d22e387b 100644 --- a/src/include/usr/runtime/runtime.H +++ b/src/include/usr/runtime/runtime.H @@ -229,7 +229,8 @@ enum SectionId HRMOR_STASH, //< Pointer to address in reserved memory // where PHYP can write HRMOR CPU_CTRL, // Spira-H CPU controls area - LAST_SECTION = CPU_CTRL //< Placeholder for arrays + PROC_DUMP_AREA_TBL, //< Processor dump area table + LAST_SECTION = PROC_DUMP_AREA_TBL //< Placeholder for arrays }; /** @@ -306,6 +307,23 @@ void saveActualCount( SectionId i_id, errlHndl_t writeActualCount( SectionId i_id ); /** + * @brief Write actual architected register detail to HDAT/SPIRAH + * + * @param[in] i_section Chunk of data to update + * @param[in] threadRegSize Architected reg data size per thread + * @param[in] threadRegVersion Data format version + * @param[in] capArrayAddr Actual destination address + * @param[in] capArraySize Actual destiantion size + * + * @return errlHndl_t NULL on success + */ +errlHndl_t updateHostProcDumpActual( SectionId i_section, + uint32_t threadRegSize, + uint8_t threadRegVersion, + uint64_t capArrayAddr, + uint32_t capArraySize); + +/** * @brief Use relocated payload base address * * @param[in] val 'true' for post dump data collection diff --git a/src/include/usr/vmmconst.h b/src/include/usr/vmmconst.h index 3cf33e96f..ee280c6c2 100644 --- a/src/include/usr/vmmconst.h +++ b/src/include/usr/vmmconst.h @@ -177,7 +177,11 @@ enum BlockPriority #define VMM_ALL_HOMER_OCC_MEMORY_SIZE \ (VMM_OCC_COMMON_SIZE + VMM_HOMER_REGION_SIZE) -/** Memory for Architected state (max 4 procs - 256KB Each) **/ +/** + * Memory for Architected state (max 4 procs - 256KB Each) + * XXX MPIPL depends on memory reservation layout. Any change in the + * reservation order impact MPIPL (see copyArchitectedRegs()). + */ #define VMM_ARCH_REG_DATA_START_OFFSET VMM_OCC_COMMON_END_OFFSET #define VMM_ARCH_REG_DATA_PER_PROC_SIZE_IN_KB 256 #define VMM_ARCH_REG_DATA_PER_PROC_SIZE \ |

