diff options
| author | Chris Cain <cjcain@us.ibm.com> | 2018-12-05 11:33:45 -0600 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-01-14 16:43:10 -0600 |
| commit | 2d59cd70dae624b16a957a1735299e12097c128a (patch) | |
| tree | 3a6526739799ec9635d36ec90a0b5d11daba2ebe | |
| parent | 9228e4c1f5b4da50925043987d0516ccb454f699 (diff) | |
| download | blackbird-hostboot-2d59cd70dae624b16a957a1735299e12097c128a.tar.gz blackbird-hostboot-2d59cd70dae624b16a957a1735299e12097c128a.zip | |
HTMGT: Clear OCC reset counts after an hour
- add HTMGT/OCC data to elogs
- parse HTMGT/OCC data in elogs
- add reset count per OCC since last boot
- remove unused legacy pstate attributes/code
Change-Id: I69f9fe504af13eae86ec423a329a7bc46286f906
RTC: 202016
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69717
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sheldon Bailey <baileysh@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
| -rw-r--r-- | src/include/usr/htmgt/htmgt_reasoncodes.H | 3 | ||||
| -rw-r--r-- | src/usr/htmgt/htmgt.C | 256 | ||||
| -rw-r--r-- | src/usr/htmgt/htmgt_occ.C | 150 | ||||
| -rw-r--r-- | src/usr/htmgt/htmgt_occ.H | 71 | ||||
| -rw-r--r-- | src/usr/htmgt/htmgt_occcmd.C | 15 | ||||
| -rw-r--r-- | src/usr/htmgt/htmgt_poll.C | 20 | ||||
| -rw-r--r-- | src/usr/htmgt/htmgt_utility.C | 67 | ||||
| -rw-r--r-- | src/usr/htmgt/htmgt_utility.H | 17 | ||||
| -rw-r--r-- | src/usr/htmgt/plugins/HTMGT_COMP_ID_Parse.C | 29 | ||||
| -rw-r--r-- | src/usr/htmgt/plugins/errludP_htmgt.H | 231 | ||||
| -rw-r--r-- | src/usr/htmgt/plugins/htmgtUdParserFactory.H | 58 | ||||
| -rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types_openpower.xml | 54 | ||||
| -rw-r--r-- | src/usr/targeting/common/xmltohb/target_types_openpower.xml | 18 |
13 files changed, 707 insertions, 282 deletions
diff --git a/src/include/usr/htmgt/htmgt_reasoncodes.H b/src/include/usr/htmgt/htmgt_reasoncodes.H index bd56282ed..a1fb6efc1 100644 --- a/src/include/usr/htmgt/htmgt_reasoncodes.H +++ b/src/include/usr/htmgt/htmgt_reasoncodes.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -87,7 +87,6 @@ namespace HTMGT HTMGT_RC_ECMD_DBUF_COPY_FAIL = HTMGT_COMP_ID | 0x53, HTMGT_RC_TARGET_NOT_FUNCTIONAL = HTMGT_COMP_ID | 0x54, HTMGT_RC_OCC_MASTER_NOT_FOUND = HTMGT_COMP_ID | 0x55, - HTMGT_RC_OCC_RESET_THREHOLD = HTMGT_COMP_ID | 0x56, HTMGT_RC_INVALID_OCC_ELOG = HTMGT_COMP_ID | 0x63, HTMGT_RC_BAD_FRU_CALLOUTS = HTMGT_COMP_ID | 0x7D, HTMGT_RC_MISMATCHING_SEVERITY = HTMGT_COMP_ID | 0x7F, diff --git a/src/usr/htmgt/htmgt.C b/src/usr/htmgt/htmgt.C index 4e6abbe77..f83cf65a8 100644 --- a/src/usr/htmgt/htmgt.C +++ b/src/usr/htmgt/htmgt.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -64,6 +64,18 @@ namespace HTMGT TMGT_INF("processOccStartStatus(Start Success=%c, failedOcc=0x%08X)", i_startCompleted?'y':'n', l_huid); + TARGETING::Target* sys = nullptr; + TARGETING::targetService().getTopLevelTarget(sys); + uint8_t safeMode = 0; + if(sys) + { + sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode); + } + if (safeMode == 0) + { + check_reset_count(); + } + if (false == int_flags_set(FLAG_HOLD_OCCS_IN_RESET)) { if (i_startCompleted) @@ -263,6 +275,8 @@ namespace HTMGT return; } + check_reset_count(); + bool polledOneOcc = false; errlHndl_t err = OccManager::buildOccs(); if (nullptr == err) @@ -342,6 +356,8 @@ namespace HTMGT return; } + check_reset_count(); + if( i_proc ) { TARGETING::TargetHandleList pOccs; @@ -385,7 +401,8 @@ namespace HTMGT if (false == int_flags_set(FLAG_EXT_RESET_DISABLED)) { - errl = OccManager::resetOccs(failedOccTarget); + errl = OccManager::resetOccs(failedOccTarget, false, false, + OCC_RESET_REASON_EXTERNAL_REQUEST); if(errl) { ERRORLOG::errlCommit(errl, HTMGT_COMP_ID); // sets errl to nullptr @@ -419,6 +436,8 @@ namespace HTMGT if (0 == safeMode) { + check_reset_count(); + occStateId targetState = OCC_STATE_ACTIVE; if (false == i_occActivation) { @@ -502,7 +521,37 @@ namespace HTMGT htmgtReasonCode failingSrc = HTMGT_RC_NO_ERROR; o_rspLength = 0; - err = OccManager::buildOccs(); + if ((i_cmdLength > 0) && (NULL != i_cmdData)) + { + TMGT_INF(">>passThruCommand(0x%02X)", i_cmdData[0]); + } + else + { + TMGT_INF(">>passThruCommand()"); + } + + TARGETING::Target* sys = nullptr; + TARGETING::targetService().getTopLevelTarget(sys); + uint8_t safeMode = 0; + if(sys) + { + sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode); + } + if (safeMode == 0) + { + check_reset_count(); + } + + bool skip_occ_comm = false; + if (safeMode || + (i_cmdData[0] == PASSTHRU_INTERNAL_FLAG) || + (i_cmdData[0] == PASSTHRU_OCC_CFG_DATA)) + { + // No need to talk to OCC + skip_occ_comm = true; + } + + err = OccManager::buildOccs(false, skip_occ_comm); if (nullptr == err) { if ((i_cmdLength > 0) && (NULL != i_cmdData)) @@ -510,8 +559,20 @@ namespace HTMGT switch (i_cmdData[0]) { case PASSTHRU_OCC_STATUS: - TMGT_INF("passThruCommand: OCC Status"); - OccManager::getOccData(o_rspLength, o_rspData); + TMGT_INF("passThruCommand: HTMGT/OCC Status"); + if (safeMode == 0) + { + // Send poll to confirm comm, update states and + // flush errors + TMGT_INF("passThruCommand: Sending Poll(s)"); + err = OccManager::sendOccPoll(true, nullptr); + if (err) + { + TMGT_ERR("passThruCommand: Poll OCCs failed."); + ERRORLOG::errlCommit(err, HTMGT_COMP_ID); + } + } + OccManager::getHtmgtData(o_rspLength, o_rspData); break; case PASSTHRU_INTERNAL_FLAG: @@ -538,7 +599,7 @@ namespace HTMGT break; case PASSTHRU_SEND_OCC_COMMAND: - if (i_cmdLength >= 3) + if ((i_cmdLength >= 3) && (safeMode == 0)) { const uint8_t occInstance = i_cmdData[1]; const occCommandType occCmd = @@ -586,34 +647,50 @@ namespace HTMGT } else { - TMGT_ERR("passThruCommand: invalid OCC command " - "length %d", i_cmdLength); - failingSrc = HTMGT_RC_INVALID_LENGTH; + if (safeMode) + { + TMGT_ERR("passThruCommand: Ignoring OCC command" + " because system is in safe mode"); + failingSrc = HTMGT_RC_OCC_CRIT_FAILURE; + } + else + { + TMGT_ERR("passThruCommand: Invalid OCC command " + "length %d", i_cmdLength); + failingSrc = HTMGT_RC_INVALID_LENGTH; + } } break; case PASSTHRU_CLEAR_RESET_COUNTS: TMGT_INF("passThruCommand: Clear all OCC reset counts"); - OccManager::clearResetCounts(); + if (safeMode == 0) + { + OccManager::clearResetCounts(); + } + else + { + TMGT_ERR("passThruCommand: Clear ignored because " + "system is in safe mode"); + failingSrc = HTMGT_RC_OCC_CRIT_FAILURE; + } break; case PASSTHRU_EXIT_SAFE_MODE: + TMGT_INF("passThruCommand: Clear Safe Mode"); + if (safeMode) { - TMGT_INF("passThruCommand: Clear Safe Mode"); - // Clear OCC reset counts and failed flags - OccManager::clearResetCounts(); // Clear safe mode reason OccManager::updateSafeModeReason(0, 0); // Clear system safe mode flag/attribute - TARGETING::Target* sys = NULL; - TARGETING::targetService().getTopLevelTarget(sys); - const uint8_t safeMode = 0; - // Mark system as NOT being in safe mode if(sys) { + safeMode = 0; sys->setAttr<TARGETING::ATTR_HTMGT_SAFEMODE> (safeMode); } + // Clear OCC reset counts and failed flags + OccManager::clearResetCounts(); // Reset the OCCs (do not increment reset count // or attempt comm with OCC since they are in reset) TMGT_INF("passThruCommand: Calling resetOccs"); @@ -625,44 +702,56 @@ namespace HTMGT err->reasonCode()); } } + else + { + TMGT_ERR("passThruCommand: Clear ignored, " + "system is NOT in safe mode"); + failingSrc=HTMGT_RC_PRESENT_STATE_PROHIBITS; + } break; case PASSTHRU_RESET_PM_COMPLEX: TMGT_INF("passThruCommand: Reset PM Complex"); - - err = OccManager::resetOccs(nullptr, true, true); - if(err) + if (safeMode == 0) { - TMGT_ERR("passThruCommand: Reset PM Complex FAIL " - "with rc 0x%04X", err->reasonCode() ); + // Will not increment reset count or attempt comm + err = OccManager:: + resetOccs(nullptr, true, true, + OCC_RESET_REASON_EXTERNAL_REQUEST); + if(err) + { + TMGT_ERR("passThruCommand: Reset PM Complex " + "FAIL with rc 0x%04X", + err->reasonCode()); + } + } + else + { + TMGT_ERR("passThruCommand: Ignoring reset because " + "system is in safe mode"); + failingSrc = HTMGT_RC_OCC_CRIT_FAILURE; } break; - //HOLD for future need. case PASSTHRU_QUERY_MODE_FUNCTION: - // TMGT_INF("passThruCommand: Query mode or function"); - - // break; - case PASSTHRU_ENA_DIS_OPAL_STATE: - { - TMGT_INF("passThruCommand: enable/disable OPAL STATE"); - - if (i_cmdLength == 2) + TMGT_INF("passThruCommand: set OPAL state(%d)", + i_cmdData[1]); + if ((i_cmdLength == 2) && (safeMode == 0)) { - //0 = disable OPAL mode (i.e. run as PowerVM) - if (i_cmdData[1] == 0) - { - G_system_type = OCC_CFGDATA_OPENPOWER_POWERVM; - } - //1 = enable OPAL mode - else if (i_cmdData[1] == 1) - { + //0 = disable OPAL mode (i.e. run as PowerVM) + if (i_cmdData[1] == 0) + { + G_system_type = OCC_CFGDATA_OPENPOWER_POWERVM; + } + //1 = enable OPAL mode + else if (i_cmdData[1] == 1) + { G_system_type = OCC_CFGDATA_OPENPOWER_OPALVM; - } - else - { - TMGT_ERR("passThruCommand: Invalid requested OPAL" - " mode 0x%02X ", i_cmdData[1] ); + } + else + { + TMGT_ERR("passThruCommand: Invalid requested " + "OPAL mode 0x%02X ", i_cmdData[1] ); /*@ * @errortype * @reasoncode HTMGT_RC_INVALID_PARAMETER @@ -671,33 +760,45 @@ namespace HTMGT * @userdata2 command data length * @devdesc Invalid pass thru command data */ - failingSrc = HTMGT_RC_INVALID_PARAMETER; - } + failingSrc = HTMGT_RC_INVALID_PARAMETER; + } if(failingSrc == HTMGT_RC_NO_ERROR) { - TMGT_INF("passThruCommand: OPAL State(0x%02X), " - "resetting PM Complex", G_system_type); - err = OccManager::resetOccs(nullptr,true,true); - if(err) - { - TMGT_ERR("passThruCommand: PM Complex Reset " - "failed with rc 0x%04X after updating " - "OPAL state", err->reasonCode()); - } - } + TMGT_INF("passThruCommand: OPAL State(0x%02X), " + "resetting PM Complex", G_system_type); + err = OccManager::resetOccs(nullptr,true,true, + OCC_RESET_REASON_EXTERNAL_REQUEST); + if(err) + { + TMGT_ERR("passThruCommand: PM Complex Reset" + " failed with rc 0x%04X after " + "updating OPAL state", + err->reasonCode()); + } + } } else { - TMGT_ERR("passThruCommand: invalid OPAL State " - "length %d", i_cmdLength); - failingSrc = HTMGT_RC_INVALID_LENGTH; + if (safeMode) + { + TMGT_ERR("passThruCommand: Ignoring Opal state" + " because system is in safe mode"); + failingSrc = HTMGT_RC_OCC_CRIT_FAILURE; + } + else + { + TMGT_ERR("passThruCommand: Invalid command " + "length %d", i_cmdLength); + failingSrc = HTMGT_RC_INVALID_LENGTH; + } } - } - break; + break; case PASSTHRU_SET_OCC_STATE: + TMGT_INF("passThruCommand: Set OCC State(%d)", + i_cmdData[1]); + if ((i_cmdLength == 2) && (safeMode == 0)) { - TMGT_INF("passThruCommand: Set OCC State"); occStateId l_targetState = (occStateId)i_cmdData[1]; //Validate state requested is supported. if( (l_targetState == OCC_STATE_OBSERVATION) || @@ -708,14 +809,15 @@ namespace HTMGT err = OccManager::setOccState(l_targetState); if (nullptr == err) { - TMGT_INF("passThruCommand: OCC states " - "updated to 0x%02X", l_targetState); + TMGT_INF("passThruCommand: OCC states " + "updated to 0x%02X", + l_targetState); } else { TMGT_ERR("passThruCommand: OCC state change" - " FAIL with rc 0x%04X", - err->reasonCode()); + " FAIL with rc 0x%04X", + err->reasonCode()); } } else @@ -725,10 +827,24 @@ namespace HTMGT failingSrc = HTMGT_RC_INVALID_PARAMETER; } } + else + { + if (safeMode) + { + TMGT_ERR("passThruCommand: Ignoring set state" + " because system is in safe mode"); + failingSrc = HTMGT_RC_OCC_CRIT_FAILURE; + } + else + { + TMGT_ERR("passThruCommand: Invalid command " + "length %d", i_cmdLength); + failingSrc = HTMGT_RC_INVALID_LENGTH; + } + } break; - case PASSTHRU_WOF_RESET_REASONS: TMGT_INF("passThruCommand: Query WOF Reset Reasons"); OccManager::getWOFResetReasons(o_rspLength, o_rspData); @@ -758,8 +874,8 @@ namespace HTMGT } else { - TMGT_ERR("passThruCommand: invalid data length %d", - i_cmdLength); + TMGT_ERR("passThruCommand: Invalid command " + "length %d", i_cmdLength); failingSrc = HTMGT_RC_INVALID_LENGTH; } break; @@ -791,6 +907,8 @@ namespace HTMGT } } } + TMGT_INF("<<passThruCommand() returning 0x%04X", + (err==nullptr) ? 0 : err->reasonCode()); return err; diff --git a/src/usr/htmgt/htmgt_occ.C b/src/usr/htmgt/htmgt_occ.C index 693209622..1a1795f94 100644 --- a/src/usr/htmgt/htmgt_occ.C +++ b/src/usr/htmgt/htmgt_occ.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -417,8 +417,7 @@ namespace HTMGT :iv_occMaster(nullptr), iv_state(OCC_STATE_UNKNOWN), iv_targetState(OCC_STATE_ACTIVE), - iv_sysResetCount(0), - iv_normalPstateTables(true) + iv_sysResetCount(0) { } @@ -828,6 +827,14 @@ namespace HTMGT if (nullptr == l_err) { + // Clear safe mode reason since OCC is at target state + if (cv_safeReturnCode != 0) + { + TMGT_INF("_setOccState: clearing safe mode reason " + "(0x%04X)", cv_safeReturnCode); + cv_safeReturnCode = 0; + cv_safeOccInstance = 0; + } TMGT_INF("_setOccState: All OCCs have reached state " "0x%02X", requestedState); iv_state = requestedState; @@ -875,7 +882,8 @@ namespace HTMGT errlHndl_t OccManager::_resetOccs(TARGETING::Target * i_failedOccTarget, bool i_skipCountIncrement, - bool i_skipComm) + bool i_skipComm, + enum occResetReason i_reason) { errlHndl_t err = nullptr; bool atThreshold = false; @@ -910,6 +918,10 @@ namespace HTMGT for(const auto & occ : iv_occArray ) { + if (i_reason != OCC_RESET_REASON_NONE) + { + occ->iv_resetReason = i_reason; + } if(occ->getTarget() == i_failedOccTarget) { occ->failed(true); @@ -953,8 +965,23 @@ namespace HTMGT } uint64_t retryCount = OCC_RESET_COUNT_THRESHOLD; + TARGETING::Target* sys = nullptr; + TARGETING::targetService().getTopLevelTarget(sys); while(retryCount) { + if (sys) + { + // Increment cumulative reset count since boot + uint8_t count = sys->getAttr<TARGETING:: + ATTR_CUMULATIVE_PMCOMPLEX_RESET_COUNT>(); + if (count < 0xFF) + { + ++count; + sys->setAttr<TARGETING:: + ATTR_CUMULATIVE_PMCOMPLEX_RESET_COUNT>(count); + } + } + // Reset all OCCs TMGT_INF("_resetOccs: Calling HBPM::resetPMAll"); err = HBPM::resetPMAll(); @@ -991,7 +1018,7 @@ namespace HTMGT { for( const auto & occ : iv_occArray ) { - // After OCC has been reset, clear flag + // After OCC has been reset, clear internal flags occ->postResetClear(); } @@ -1033,11 +1060,12 @@ namespace HTMGT 0, cv_safeReturnCode, 0, cv_safeOccInstance, ERRORLOG::ERRL_SEV_UNRECOVERABLE); + TMGT_ERR("_resetOccs: Safe Mode (RC: 0x%04X OCC%d)", + cv_safeReturnCode, cv_safeOccInstance); + // Check if OCC already logged reason for safe mode // (add proc callout if non-OCC safe mode reason or // the OCC hit an exception) - TMGT_ERR("_resetOccs: Safe Mode (RC: 0x%04X OCC%d)", - cv_safeReturnCode, cv_safeOccInstance); if (((cv_safeReturnCode & OCCC_COMP_ID) != OCCC_COMP_ID) || ((cv_safeReturnCode & 0xE0) == 0xE0)) { @@ -1159,7 +1187,7 @@ namespace HTMGT TARGETING::getParentChip(occ->getTarget() ); // Read SRAM response buffer to check for OCC checkpoint - errlHndl_t l_err = nullptr; + errlHndl_t l_err = nullptr; const uint16_t l_length = 8; //Note: number of bytes uint8_t l_sram_data[l_length] = { 0x0 }; l_err = HBOCC::readSRAM(procTarget, @@ -1325,36 +1353,21 @@ namespace HTMGT // Collect HTMGT Status Information for debug - // NOTE: o_data is pointer to 4096 byte buffer - void OccManager::_getOccData(uint16_t & o_length, uint8_t *o_data) + // NOTE: o_data is pointer to OCC_MAX_DATA_LENGTH byte buffer + void OccManager::_getHtmgtData(uint16_t & o_length, uint8_t *o_data) { uint16_t index = 0; - // If the system is in safemode then can't talk to OCCs (no build/poll) TARGETING::Target* sys = nullptr; TARGETING::targetService().getTopLevelTarget(sys); uint8_t safeMode = 0; - if (sys && - sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode) && - (0 == safeMode)) + uint8_t resets_since_boot = 0; + if (sys) { - // Make sure OCCs were built first (so data is valid) - errlHndl_t err = _buildOccs(); // if not already built. - if (err) - { - TMGT_ERR("_getOccData: failed to build OCC structures " - "rc=0x%04X", err->reasonCode()); - ERRORLOG::errlCommit(err, HTMGT_COMP_ID); - } - // Send poll to confirm comm, update states and flush errors - err = _sendOccPoll(true, nullptr); - if (err) - { - TMGT_ERR("_getOccData: Poll OCCs failed."); - ERRORLOG::errlCommit(err, HTMGT_COMP_ID); - } + sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode); + sys->tryGetAttr<TARGETING::ATTR_CUMULATIVE_PMCOMPLEX_RESET_COUNT> + (resets_since_boot); } - // First add HTMGT specific data o_data[index++] = _getNumOccs(); o_data[index++] = @@ -1362,7 +1375,7 @@ namespace HTMGT o_data[index++] = iv_state; o_data[index++] = iv_targetState; o_data[index++] = iv_sysResetCount; - o_data[index++] = iv_normalPstateTables ? 0 : 1; + o_data[index++] = resets_since_boot; o_data[index++] = 0x00; // STATUS VERSION (for future expansion) o_data[index++] = safeMode; UINT32_PUT(&o_data[index], cv_safeReturnCode); @@ -1428,23 +1441,6 @@ namespace HTMGT } - - // Set default pstate table type and reset all OCCs to pick them up - errlHndl_t OccManager::_loadPstates(bool i_normalPstates) - { - errlHndl_t err = nullptr; - - // Set default pstate table type - _setPstateTable(i_normalPstates); - - // Reset OCCs to pick up new tables (skip incrementing reset count) - TMGT_INF("_loadPstates: Resetting OCCs"); - err = _resetOccs(nullptr, true); - - return err; - } - - // Consolidate all OCC states void OccManager::_syncOccStates() { @@ -1479,18 +1475,12 @@ namespace HTMGT // Clear all OCC reset counts + // Should not be called if the system is in safe mode. void OccManager::_clearResetCounts() { - TARGETING::Target* sys = nullptr; - TARGETING::targetService().getTopLevelTarget(sys); - uint8_t safeMode = 0; - if (sys) - { - sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode); - } for( const auto & occ : iv_occArray ) { - if ( occ->iv_resetCount != 0 ) + if (occ->iv_resetCount != 0) { TMGT_INF("_clearResetCounts: Clearing OCC%d reset count " "(was %d)", @@ -1499,28 +1489,15 @@ namespace HTMGT occ->iv_resetCount = 0; } - if( occ->iv_wofResetCount != 0 ) + if (occ->iv_wofResetCount != 0) { - occ->iv_wofResetCount = 0; TMGT_INF("_clearResetCounts: Clearing OCC%d WOF reset count " - "( was %d)", - occ->getInstance(), - occ->iv_wofResetCount); - } - - if( occ->iv_wofResetReasons != 0 ) - { - TMGT_INF("_clearResetCounts: Clearing OCC%d WOF reset reasons " - "( was 0x%08x)", + "(was %d) reason(s): 0x%08X", occ->getInstance(), - occ->iv_wofResetReasons ); - } - if( safeMode ) - { - // Clear OCC flags (failed, commEstablished, etc) - occ->postResetClear(); + occ->iv_wofResetCount, + occ->iv_wofResetReasons); + occ->iv_wofResetCount = 0; } - } if (iv_sysResetCount != 0) @@ -1571,12 +1548,14 @@ namespace HTMGT errlHndl_t OccManager::resetOccs(TARGETING::Target * i_failedOccTarget, bool i_skipCountIncrement, - bool i_skipComm) + bool i_skipComm, + enum occResetReason i_reason) { return Singleton<OccManager>::instance()._resetOccs(i_failedOccTarget, i_skipCountIncrement, - i_skipComm); + i_skipComm, + i_reason); } @@ -1614,9 +1593,9 @@ namespace HTMGT return Singleton<OccManager>::instance()._occFailed(); } - void OccManager::getOccData(uint16_t & o_length, uint8_t *o_data) + void OccManager::getHtmgtData(uint16_t & o_length, uint8_t *o_data) { - Singleton<OccManager>::instance()._getOccData(o_length, o_data); + Singleton<OccManager>::instance()._getHtmgtData(o_length, o_data); } void OccManager::getWOFResetReasons(uint16_t & o_length, uint8_t * o_data) @@ -1625,21 +1604,6 @@ namespace HTMGT o_data); } - errlHndl_t OccManager::loadPstates(bool i_normalPstates) - { - return Singleton<OccManager>::instance()._loadPstates(i_normalPstates); - } - - bool OccManager::isNormalPstate() - { - return Singleton<OccManager>::instance()._isNormalPstate(); - } - - void OccManager::setPstateTable(bool i_useNormal) - { - Singleton<OccManager>::instance()._setPstateTable(i_useNormal); - } - void OccManager::clearResetCounts() { Singleton<OccManager>::instance()._clearResetCounts(); diff --git a/src/usr/htmgt/htmgt_occ.H b/src/usr/htmgt/htmgt_occ.H index 91ede4d61..1a707af46 100644 --- a/src/usr/htmgt/htmgt_occ.H +++ b/src/usr/htmgt/htmgt_occ.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -84,7 +84,9 @@ namespace HTMGT OCC_RESET_REASON_POWER_FAULT = 0x04, OCC_RESET_REASON_DIFF_OCC = 0x05, OCC_RESET_REASON_OCC_REQUEST = 0x06, - OCC_RESET_REASON_WOF_REQUEST = 0x07, + OCC_RESET_REASON_EXTERNAL_REQUEST = 0x0A, + OCC_RESET_REASON_WOF_REQUEST = 0x0C, + OCC_RESET_REASON_CHECKPOINT_FAIL = 0x0D, }; // OCC Callout Structure @@ -161,7 +163,7 @@ namespace HTMGT /** * @brief Return pointer OCC target * - * @return pointer to last poll response + * @return pointer to OCC target (not processor target) */ TARGETING::TargetHandle_t getTarget() { return iv_target; }; @@ -515,11 +517,15 @@ namespace HTMGT * @param[in] i_skipComm true will prevent attempts to * communicate with OCC before reset (poll/resetPrep) * Used when exiting safe mode. + * @param[in] i_reason reason for the reset + * Reason will not be updated for OCC_RESET_REASON_NONE * @return Error Log | NULL */ static errlHndl_t resetOccs(TARGETING::Target * i_failedOccTarget, bool i_skipCountIncrement = false, - bool i_skipComm = false); + bool i_skipComm = false, + enum occResetReason i_reason = + OCC_RESET_REASON_NONE); /** @@ -615,7 +621,7 @@ namespace HTMGT * @param[out] o_data Buffer of 256 bytes where data will * be copied */ - static void getOccData(uint16_t & o_length, uint8_t *o_data); + static void getHtmgtData(uint16_t & o_length, uint8_t *o_data); /** * @brief Collect WOF reset reasons for ALL OCCs @@ -629,36 +635,6 @@ namespace HTMGT uint8_t * o_data); /** - * @brief Load specified pstate tables for all OCCs. - * This will reset all OCCs so they pick up the new - * tables. - * - * @param[in] i_normalPstates true to generate normal pstate tables - * false to generate mfg pstate tables - * - * @return NULL on success, else error handle - */ - static errlHndl_t loadPstates(bool i_normalPstates); - - - /** - * @brief Determine if normal pstate tables should be used - * - * @return true if normal pstates should be used - */ - static bool isNormalPstate(); - - - /** - * @brief Determine if normal pstate tables should be used - * - * @param[in] i_useNormal Set to true if normal pstate table - * should be used (vs MFG table) - */ - static void setPstateTable(bool i_useNormal); - - - /** * @brief Update error log with safe mode callouts and set * attribute indicating system is in safe mode. * @@ -698,7 +674,6 @@ namespace HTMGT occStateId iv_state; occStateId iv_targetState; uint8_t iv_sysResetCount; - bool iv_normalPstateTables; /** @@ -766,8 +741,9 @@ namespace HTMGT /* See resetOccs() above */ errlHndl_t _resetOccs(TARGETING::Target * i_failedOccTarget, - bool i_skipCountIncrement = false, - bool i_skipComm = false); + bool i_skipCountIncrement, + bool i_skipComm, + enum occResetReason i_reason); /** See sendOccPoll() above */ /* @param[in] i_onlyIfEstablished: If true, only send poll if @@ -791,27 +767,12 @@ namespace HTMGT /** See occFailed() above */ bool _occFailed(); - /** See getOccData() above */ - void _getOccData(uint16_t & o_length, uint8_t *o_data); + /** See getHtmgtData() above */ + void _getHtmgtData(uint16_t & o_length, uint8_t *o_data); /** See getWOFResetReasons above */ void _getWOFResetReasons(uint16_t & o_length, uint8_t *o_data); - /** See loadPstates() above */ - errlHndl_t _loadPstates(bool i_normalPstates); - - /** See isNormalPstate() above */ - bool _isNormalPstate() - { - return(true == iv_normalPstateTables); - }; - - /** See setPstateTable() above */ - void _setPstateTable(bool i_useNormal) - { - iv_normalPstateTables = i_useNormal; - }; - /** See syncOccStates() above */ void _syncOccStates(); diff --git a/src/usr/htmgt/htmgt_occcmd.C b/src/usr/htmgt/htmgt_occcmd.C index fbb380535..c5d050b58 100644 --- a/src/usr/htmgt/htmgt_occcmd.C +++ b/src/usr/htmgt/htmgt_occcmd.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -548,11 +548,14 @@ namespace HTMGT if (l_errlHndl) { // Add OCC command data to user details - l_errlHndl->addFFDC(HTMGT_COMP_ID, - iv_OccCmd.cmdData, - std::min(iv_OccCmd.dataLength, MAX_FFDC), - 1, // version - SUBSEC_OCC_CMD_DATA); + if (iv_OccCmd.dataLength > 0) + { + l_errlHndl->addFFDC(HTMGT_COMP_ID, + iv_OccCmd.cmdData, + std::min(iv_OccCmd.dataLength, MAX_FFDC), + 1, // version + SUBSEC_OCC_CMD_DATA); + } } return l_errlHndl; diff --git a/src/usr/htmgt/htmgt_poll.C b/src/usr/htmgt/htmgt_poll.C index 52651f0e7..5b042e695 100644 --- a/src/usr/htmgt/htmgt_poll.C +++ b/src/usr/htmgt/htmgt_poll.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -147,9 +147,11 @@ namespace HTMGT { // Limit number of elogs retrieved so // we do not get stuck in loop - TMGT_INF("pollForErrors: OCC%d still has" - "more errors to report.", - iv_instance); + TMGT_INF("pollForErrors: OCC%d still has " + "more errors to report. " + "(ID 0x%02X)", + iv_instance, + currentPollRsp->errorId); continuePolling = false; } } @@ -316,7 +318,10 @@ namespace HTMGT iv_role, pollRsp->status, ERRORLOG::ERRL_SEV_INFORMATIONAL); ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID); - iv_resetReason = OCC_RESET_REASON_ERROR; + if (iv_resetReason == OCC_RESET_REASON_NONE) + { + iv_resetReason = OCC_RESET_REASON_ERROR; + } break; } @@ -343,7 +348,10 @@ namespace HTMGT iv_occsPresent, pollRsp->status, ERRORLOG::ERRL_SEV_INFORMATIONAL); ERRORLOG::errlCommit(l_err, HTMGT_COMP_ID); - iv_resetReason = OCC_RESET_REASON_ERROR; + if (iv_resetReason == OCC_RESET_REASON_NONE) + { + iv_resetReason = OCC_RESET_REASON_ERROR; + } } } diff --git a/src/usr/htmgt/htmgt_utility.C b/src/usr/htmgt/htmgt_utility.C index 79aa96e77..e929feea4 100644 --- a/src/usr/htmgt/htmgt_utility.C +++ b/src/usr/htmgt/htmgt_utility.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,6 +25,7 @@ #include "htmgt_utility.H" #include <targeting/common/commontargeting.H> #include <targeting/common/attributes.H> +#include <time.h> using namespace TARGETING; @@ -38,6 +39,8 @@ namespace HTMGT uint32_t G_debug_data = 0; uint32_t G_debug_trace = DEBUG_TRACE_FULL_NONVERBOSE; + // Timer for periodically clearing OCC reset counts (seconds) + const uint64_t OCC_RCOUNT_RESET_TIME = 60 * 60; // 1 hour // Create/Build an Error log and add HTMGT component trace void bldErrLog(errlHndl_t & io_err, @@ -70,9 +73,6 @@ namespace HTMGT } else { - // TODO RTC 124739 - // - collectTrace will not filter dup traces and no way to clear - // - no way to add secondary SRC to elog io_err->collectTrace("HTMGT"); uint32_t additionalSrc[] = @@ -87,10 +87,21 @@ namespace HTMGT 1, // version SUBSEC_ADDITIONAL_SRC); } - } + // Add HTMGT/OCC state data + uint16_t occ_data_len = 0; + uint8_t occ_data[OCC_MAX_DATA_LENGTH]; + OccManager::getHtmgtData(occ_data_len, occ_data); + if (occ_data_len > 0) + { + io_err->addFFDC(HTMGT_COMP_ID, + occ_data, + occ_data_len, + 1, //version + SUBSEC_ELOG_TYPE_HTMGT_DATA); + } + } - // TODO RTC 124739 - refactor/optimize trace strings // Internal utility to convert OCC command type to a string const char *command_string(const uint8_t i_cmd) @@ -118,7 +129,6 @@ namespace HTMGT const uint8_t l_total = sizeof(L_cmd_string) / sizeof(struct string_data_t); - // TODO RTC 124739 uint8_t l_idx = 0; for (l_idx=0; l_idx<l_total; l_idx++) { @@ -223,4 +233,47 @@ namespace HTMGT return flags_are_set; } + // Check if reset count needs to be cleared due to periodic timer. + // Should not be called if the system is in safe mode. + void check_reset_count() + { + TARGETING::Target* sys = NULL; + TARGETING::targetService().getTopLevelTarget(sys); + if (sys) + { + uint8_t safeMode = 0; + sys->tryGetAttr<TARGETING::ATTR_HTMGT_SAFEMODE>(safeMode); + if (safeMode == 0) + { + const uint64_t last_clear = + sys->getAttr<ATTR_HTMGT_PMCOMPLEX_RESET_COUNT_TIMER>(); + timespec_t curTime; + + if (clock_gettime(CLOCK_MONOTONIC, &curTime) == 0) + { + bool update_attr = false; + if (last_clear == 0) + { + // First call since boot + update_attr = true; + } + else if ((curTime.tv_sec < last_clear) || + (curTime.tv_sec - last_clear > + OCC_RCOUNT_RESET_TIME)) + { + // Clear reset counters (counter wrapped/exceeded time) + OccManager::clearResetCounts(); + update_attr = true; + } + if (update_attr) + { + sys->setAttr + <TARGETING::ATTR_HTMGT_PMCOMPLEX_RESET_COUNT_TIMER> + (curTime.tv_sec); + } + } + } + } + } + } // end namespace diff --git a/src/usr/htmgt/htmgt_utility.H b/src/usr/htmgt/htmgt_utility.H index 6b16adfd7..d1d6207d0 100644 --- a/src/usr/htmgt/htmgt_utility.H +++ b/src/usr/htmgt/htmgt_utility.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -155,11 +155,12 @@ namespace HTMGT SUBSEC_ADDITIONAL_SRC = 0x0C, SUBSEC_OCC_CMD_DATA = 0x0D, SUBSEC_OCC_RSP_DATA = 0x0E, - //SUBSEC_ELOG_TYPE_TOIF_RESET = 0x10, + SUBSEC_ELOG_TYPE_HTMGT_DATA = 0x10, //SUBSEC_ELOG_TYPE_OCC_RESET = 0x11, //SUBSEC_ELOG_TYPE_PCAP_DATA = 0x12, //SUBSEC_ELOG_TYPE_THERMAL_DATA = 0x13, //SUBSEC_PROC_SCOM_REGISTERS = 0x14, + //SUBSEC_ELOG_TYPE_OCC_TRACE = 0x15, // 0xE0-0xEF are reserved for OCC Exceptions }; @@ -178,12 +179,6 @@ namespace HTMGT PASSTHRU_OCC_CFG_DATA = 0x0C, }; - enum htmgtAttrName - { - ATTR_PSTATE = 0x01, - ATTR_PSTATE_MFG = 0x02, - ATTR_RAW = 0xFF - }; /** * @brief Create/Build an Error log and add HTMGT component trace @@ -267,6 +262,12 @@ namespace HTMGT */ bool int_flags_set(const uint32_t i_mask); + /** + * @brief Check if OCC reset counters need to be cleared. + * Function is called periodically (OCC_RCOUNT_RESET_TIME) + * + */ + void check_reset_count(); } // end namespace #endif diff --git a/src/usr/htmgt/plugins/HTMGT_COMP_ID_Parse.C b/src/usr/htmgt/plugins/HTMGT_COMP_ID_Parse.C new file mode 100644 index 000000000..301355eaf --- /dev/null +++ b/src/usr/htmgt/plugins/HTMGT_COMP_ID_Parse.C @@ -0,0 +1,29 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/htmgt/plugins/HTMGT_COMP_ID_Parse.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,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. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include "errludparser.H" +#include "htmgtUdParserFactory.H" + + +ERRL_MAKE_UD_PARSER(HTMGT::UserDetailsParserFactory, hbfw::HTMGT_COMP_ID) diff --git a/src/usr/htmgt/plugins/errludP_htmgt.H b/src/usr/htmgt/plugins/errludP_htmgt.H new file mode 100644 index 000000000..c45e7a4d1 --- /dev/null +++ b/src/usr/htmgt/plugins/errludP_htmgt.H @@ -0,0 +1,231 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/htmgt/plugins/errludP_htmgt.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,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. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef ERRL_UDP_HTMGT_H +#define ERRL_UDP_HTMGT_H + +/** +* @file errludP_htmgt.H +* +* Defines the ErrlUserDetailsParser classes that parse HTMGT FFDC +*/ + +#include "errluserdetails.H" +#include <string.h> + +/** +* Macros required when parser runs on x86 +*/ +#define TO_UINT8(ptr) (*(reinterpret_cast<uint8_t*>(ptr))) +#define TO_UINT16(ptr) (ntohs(*(reinterpret_cast<uint16_t*>(ptr)))) +#define TO_UINT32(ptr) (ntohl(*(reinterpret_cast<uint32_t*>(ptr)))) +#define TO_UINT64(ptr) (ntohll(*(reinterpret_cast<uint64_t*>(ptr)))) + + + +namespace HTMGT +{ + // Already in HTMGT + enum tmgtElogSubsecTypes + { + // Values selected to be common with FSP from tmgt_elog_parser.H + //SUBSEC_MSG_DATA_TYPE = 0x01, + //SUBSEC_ERROR_DATA_TYPE = 0x06, + //SUBSEC_ENERGYSCALE_DATA_TYPE = 0x08, + //SUBSEC_OCC_ELOG_DATA_TYPE = 0x0A, + //SUBSEC_OCC_FFDC_DATA_TYPE = 0x0B, + SUBSEC_ADDITIONAL_SRC = 0x0C, + SUBSEC_OCC_CMD_DATA = 0x0D, + SUBSEC_OCC_RSP_DATA = 0x0E, + SUBSEC_ELOG_TYPE_HTMGT_DATA = 0x10, + //SUBSEC_ELOG_TYPE_OCC_RESET = 0x11, + //SUBSEC_ELOG_TYPE_PCAP_DATA = 0x12, + //SUBSEC_ELOG_TYPE_THERMAL_DATA = 0x13, + //SUBSEC_PROC_SCOM_REGISTERS = 0x14, + //SUBSEC_ELOG_TYPE_OCC_TRACE = 0x15, + // 0xE0-0xEF are reserved for OCC Exceptions + }; + // END Already in HTMGT + + struct occStateData + { + uint8_t instance; + uint8_t state; + uint8_t role; + uint8_t masterCapable; + uint8_t commEstablished; + uint8_t reserved[3]; + uint8_t failed; + uint8_t needsReset; + uint8_t resetReason; + uint8_t resetCount:4; + uint8_t resetCountWof:4; + uint32_t lastPollHeader; + } __attribute__ ((__packed__)); + typedef struct occStateData occData_t; + + struct htmgtStateData + { + // HTMGT specific data + uint8_t numOccs; + uint8_t masterInstance; + uint8_t state; + uint8_t targetState; + uint8_t sysResetCount; + uint8_t cumulativeResets; + uint8_t version; + uint8_t safeMode; + uint32_t safeReturnCode; + uint32_t safeOccInstance; + + // Now add OCC specific data (for each OCC) + occData_t occData[4]; + } __attribute__ ((__packed__)); + typedef struct htmgtStateData htmgtStateData_t; + + + + /** + * @class UdParserHtmgtData + * + * Parses UdPibInfo + */ + class UdParserHtmgtData : public ERRORLOG::ErrlUserDetailsParser + { + public: + /** + * @brief Constructor + */ + UdParserHtmgtData() {} + + /** + * @brief Destructor + */ + virtual ~UdParserHtmgtData() {} + + /** + * @brief Parses string user detail data from an error log + * + * @param i_version Version of the data + * @param i_parse ErrlUsrParser object for outputting information + * @param i_pBuffer Pointer to buffer containing detail data + * @param i_buflen Length of the buffer + */ + virtual void parse(errlver_t i_version, + ErrlUsrParser & i_parser, + void * i_pBuffer, + const uint32_t i_buflen) const + { + htmgtStateData_t* hdata = static_cast<htmgtStateData_t*> + (i_pBuffer); + i_parser.PrintString( "HTMGT", "" ); + i_parser.PrintNumber(" Number of OCCs", "%d", hdata->numOccs); + i_parser.PrintNumber(" Master OCC", "%d", + hdata->masterInstance); + i_parser.PrintNumber(" State", "0x%02X", hdata->state); + i_parser.PrintNumber(" Target State", "0x%02X", + hdata->targetState); + i_parser.PrintNumber(" HTMGT triggered resets", "%d", + hdata->sysResetCount); + i_parser.PrintNumber(" Resets since power on", "%d", + hdata->cumulativeResets); + i_parser.PrintNumber(" Data Version", "0x%02X", + hdata->version); + // Don't display if not in safe mode because the flag may not be + // set at the time this data is added to an error log + if (hdata->safeMode) + { + i_parser.PrintBool( " In Safe Mode", hdata->safeMode); + i_parser.PrintNumber(" Safe Reason Code", "0x%04X", + TO_UINT32(&hdata->safeReturnCode)); + i_parser.PrintNumber(" Safe OCC Instance", "%d", + TO_UINT32(&hdata->safeOccInstance)); + } + for (unsigned int instance = 0; + instance < hdata->numOccs; + ++instance) + { + occData_t *odata = &hdata->occData[instance]; + char occ_name[16]; + sprintf(occ_name, "OCC%d", odata->instance); + i_parser.PrintBlank(); + i_parser.PrintString(occ_name, "" ); + i_parser.PrintNumber(" Instance", "%d", odata->instance); + i_parser.PrintNumber(" State", "0x%02X", odata->state); + i_parser.PrintNumber(" Role", "0x%02X", odata->role); + i_parser.PrintBool( " Master Capable", + odata->masterCapable); + i_parser.PrintBool( " Comm Established", + odata->commEstablished); + i_parser.PrintBool( " Failed", odata->failed); + i_parser.PrintBool( " Needs Reset", odata->needsReset); + i_parser.PrintNumber(" Reset Reason", "0x%02X", + odata->resetReason); + i_parser.PrintNumber(" Reset Count", "%d", + odata->resetCount); + i_parser.PrintNumber(" WOF Reset Count", "%d", + odata->resetCountWof); + uint16_t status = TO_UINT16(&odata->lastPollHeader); + if ((status & 0x00FF) != 0) + { + char status_string[256] = ""; + sprintf(status_string, "0x%08X -", + TO_UINT32(&odata->lastPollHeader)); + if (status & 0x0080) strcat(status_string, + " Throttle-ProcOverTemp"); + if (status & 0x0040) strcat(status_string, + " Throttle-Power"); + if (status & 0x0020) strcat(status_string, + " MemThrot-OverTemp"); + if (status & 0x0010) strcat(status_string, + " QuickPowerDrop"); + if (status & 0x0008) strcat(status_string, + " Throttle-VddOverTemp"); + i_parser.PrintString(" Last Poll Header", + status_string); + } + else + { + i_parser.PrintNumber(" Last Poll Header", "0x%08X", + TO_UINT32(&odata->lastPollHeader)); + } + } + } + + private: + + // Parser isn't compiled with c++11 in all environments, and + // therefore "delete" of unused interfaces (like below) is not + // supported, nor are functions with move semantics + + // Disable compiler provided default functions + UdParserHtmgtData( + const UdParserHtmgtData&); + UdParserHtmgtData & operator=( + const UdParserHtmgtData&); + }; + +} + +#endif diff --git a/src/usr/htmgt/plugins/htmgtUdParserFactory.H b/src/usr/htmgt/plugins/htmgtUdParserFactory.H new file mode 100644 index 000000000..ed38f6ecb --- /dev/null +++ b/src/usr/htmgt/plugins/htmgtUdParserFactory.H @@ -0,0 +1,58 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/htmgt/plugins/htmgtUdParserFactory.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016,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. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#if !defined(_HTMGTUDPARSERFACTORY_H) +#define _HTMGTUDPARSERFACTORY_H + +#include "errludparserfactory.H" +#include "errludP_htmgt.H" + +namespace HTMGT +{ + + class UserDetailsParserFactory + : public ERRORLOG::ErrlUserDetailsParserFactory + { + public: + UserDetailsParserFactory() + { + registerParser<HTMGT::UdParserHtmgtData> + (SUBSEC_ELOG_TYPE_HTMGT_DATA); + } + + + private: + // Parser isn't compiled with c++11 in all environments, and + // therefore "delete" of unused interfaces (like below) is not + // supported, nor are functions with move semantics + + // Disable compiler provided default functions + UserDetailsParserFactory( + const UserDetailsParserFactory &); + UserDetailsParserFactory & operator= ( + const UserDetailsParserFactory &); + }; +}; + +#endif diff --git a/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml b/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml index f93730c46..bd5c19154 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml @@ -5,7 +5,7 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- Contributors Listed Below - COPYRIGHT 2016,2018 --> +<!-- Contributors Listed Below - COPYRIGHT 2016,2019 --> <!-- [+] International Business Machines Corp. --> <!-- --> <!-- --> @@ -208,6 +208,20 @@ <writeable/> </attribute> + <attribute> + <id>CUMULATIVE_PMCOMPLEX_RESET_COUNT</id> + <description> + Number of PM Complex resets since the system was booted. + Value will only be cleared at power on. + </description> + <simpleType> + <uint8_t/> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + </attribute> + <enumerationType> <id>ENTITY_ID</id> <description>Enumeration indicating the IPMI entity ID, these values are @@ -556,6 +570,20 @@ </attribute> <attribute> + <id>HTMGT_PMCOMPLEX_RESET_COUNT_TIMER</id> + <description> + Timer value used to periodically clear the PM Complex reset + counters. Used internally by HTMGT. + </description> + <simpleType> + <uint64_t/> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + </attribute> + + <attribute> <id>HTMGT_SAFEMODE</id> <description>1 = in safemode. 0 = in normal mode.</description> <simpleType> @@ -1306,30 +1334,6 @@ ID for the sensor number returned with the elog. --> </attribute> <attribute> - <id>PSTATE_TABLE</id> - <description>HTMGT PSTATE data</description> - <simpleType> - <uint8_t/> - <array>3656</array> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> - </attribute> - - <attribute> - <id>PSTATE_TABLE_MFG</id> - <description>HTMGT PSTATE data for mfg</description> - <simpleType> - <uint8_t/> - <array>3656</array> - </simpleType> - <persistency>volatile-zeroed</persistency> - <readable/> - <writeable/> - </attribute> - - <attribute> <id>REPORT_THROTTLE_BELOW_NOMINAL</id> <description> Indicates if OCC should wait to report DVFS due to power/thermal until diff --git a/src/usr/targeting/common/xmltohb/target_types_openpower.xml b/src/usr/targeting/common/xmltohb/target_types_openpower.xml index 2caf21b8a..54fc1a61b 100644 --- a/src/usr/targeting/common/xmltohb/target_types_openpower.xml +++ b/src/usr/targeting/common/xmltohb/target_types_openpower.xml @@ -5,7 +5,7 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- Contributors Listed Below - COPYRIGHT 2016,2018 --> +<!-- Contributors Listed Below - COPYRIGHT 2016,2019 --> <!-- [+] International Business Machines Corp. --> <!-- --> <!-- --> @@ -129,16 +129,6 @@ </targetTypeExtension> <targetTypeExtension> - <id>occ</id> - <attribute> - <id>PSTATE_TABLE</id> - </attribute> - <attribute> - <id>PSTATE_TABLE_MFG</id> - </attribute> - </targetTypeExtension> - - <targetTypeExtension> <id>sys-sys-power9</id> <attribute> <id>ADC_CHANNEL_FUNC_IDS</id> @@ -174,9 +164,15 @@ <id>CALCULATED_PROC_MEMORY_POWER_DROP</id> </attribute> <attribute> + <id>CUMULATIVE_PMCOMPLEX_RESET_COUNT</id> + </attribute> + <attribute> <id>HTMGT_INTERNAL_FLAGS</id> </attribute> <attribute> + <id>HTMGT_PMCOMPLEX_RESET_COUNT_TIMER</id> + </attribute> + <attribute> <id>HTMGT_SAFEMODE</id> </attribute> <attribute> |

