diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H index aea5390625b..13e9620f240 100644 --- a/src/include/usr/errl/errlentry.H +++ b/src/include/usr/errl/errlentry.H @@ -753,12 +753,28 @@ private: bool getSkipShowingLog(); /** - * @brief Set iv_skipShowingLogs based on the passed in value + * @brief Sets internal flag to indicate if this log should be + * saved to PNOR and sent to the BMC * * @return nothing */ void checkHiddenLogsEnable( ); + /** + * @brief Check if the severity of this log indicates it is + * customer visible, note this ignores any override flags that + * might change standard behavior + * + * INFORMATIONAL = false + * RECOVERED = false + * PREDICTIVE = true + * UNRECOVERABLE = true + * CRITICAL_SYS_TERM = true + * + * @return true if log is visible + */ + bool isSevVisible( void ); + /** * @brief Disabled copy constructor and assignment operator diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index 5c1c681a5e9..3c5cdb638ef 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -582,11 +582,11 @@ void ErrlEntry::checkHiddenLogsEnable( ) else { // need to check based on severity - switch( iv_User.iv_severity ) + switch( sev() ) { case ERRL_SEV_INFORMATIONAL: - if(l_enableLogs == ENABLE_INFORMATIONAL_LOGS ) + if(l_enableLogs & ENABLE_INFORMATIONAL_LOGS ) { iv_skipShowingLog = false; } @@ -594,7 +594,7 @@ void ErrlEntry::checkHiddenLogsEnable( ) case ERRL_SEV_RECOVERED: - if(l_enableLogs == ENABLE_RECOVERABLE_LOGS ) + if(l_enableLogs & ENABLE_RECOVERABLE_LOGS ) { iv_skipShowingLog = false; } @@ -1109,6 +1109,13 @@ void ErrlEntry::processCallout() { TRACDCOMP(g_trac_errl, INFO_MRK"errlEntry::processCallout"); + // Skip all callouts if this is a non-visible log + if( !isSevVisible() ) + { + TRACDCOMP(g_trac_errl, "Error log is non-visible - skipping callouts"); + return; + } + // see if HWAS has been loaded and has set the processCallout function HWAS::processCalloutFn pFn = ERRORLOG::theErrlManager::instance().getHwasProcessCalloutFn(); @@ -1161,6 +1168,13 @@ void ErrlEntry::deferredDeconfigure() TRACDCOMP(g_trac_errl, INFO_MRK"errlEntry::deferredDeconfigure"); + // Skip all callouts if this is a non-visible log + if( !isSevVisible() ) + { + TRACDCOMP(g_trac_errl, "Error log is non-visible - skipping callouts"); + return; + } + // see if HWAS has been loaded and has set the processCallout function HWAS::processCalloutFn pFn = ERRORLOG::theErrlManager::instance().getHwasProcessCalloutFn(); @@ -1543,5 +1557,32 @@ std::vector ErrlEntry::getUDSections(compId_t i_compId, return copy_vector; } +/** + * @brief Check if the severity of this log indicates it is + * customer visible, note this ignores any override flags that + * might change standard behavior + * @return true if log is visible + */ +bool ErrlEntry::isSevVisible( void ) +{ + bool l_vis = true; + switch( sev() ) + { + // Hidden logs + case( ERRL_SEV_INFORMATIONAL ): l_vis = false; break; + case( ERRL_SEV_RECOVERED ): l_vis = false; break; + + // Visible logs + case( ERRL_SEV_PREDICTIVE ): l_vis = true; break; + case( ERRL_SEV_UNRECOVERABLE ): l_vis = true; break; + case( ERRL_SEV_CRITICAL_SYS_TERM ): l_vis = true; break; + + // Error case, shouldn't happen so make it show up + case( ERRL_SEV_UNKNOWN ): l_vis = true; break; + } + return l_vis; +} + + } // End namespace diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H index 8ca85d69ab5..4fa789b5339 100644 --- a/src/usr/errl/test/errltest.H +++ b/src/usr/errl/test/errltest.H @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -1098,6 +1099,82 @@ public: } } + + /** + * @brief Guarantee non-visible logs do not post callouts + */ + void testErrl_hidecallouts(void) + { + // Find a non-master core that is currently functional + TARGETING::TargetHandleList l_cores; + TARGETING::getAllChiplets( l_cores, TARGETING::TYPE_CORE, true ); + TARGETING::Target* l_victim = nullptr; + const TARGETING::Target* l_master = TARGETING::getMasterCore(); + for( auto c : l_cores ) + { + if( c != l_master ) + { + l_victim = c; + break; + } + } + if( l_victim == nullptr ) + { + TS_FAIL( "Could not find a non-master core" ); + return; + } + + // Create an informational log + errlHndl_t l_err = nullptr; + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + ERRORLOG::ERRL_TEST_MOD_ID, + ERRORLOG::ERRL_TEST_REASON_CODE, + 0x494E464F, //INFO + 0 ); + // Add a callout with deconfig and gard + l_err->addHwCallout( l_victim, + HWAS::SRCI_PRIORITY_HIGH, + HWAS::DECONFIG, + HWAS::GARD_Fatal ); + // Commit the log + errlCommit(l_err,CXXTEST_COMP_ID); + + // Verify that the target wasn't actually deconfigured + TARGETING::ATTR_HWAS_STATE_type l_state = + l_victim->getAttr(); + if( !l_state.functional ) + { + TS_FAIL( "Info log incorrectly caused deconfig" ); + } + + + // Create a recovered log + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_RECOVERED, + ERRORLOG::ERRL_TEST_MOD_ID, + ERRORLOG::ERRL_TEST_REASON_CODE, + 0x52454300, //REC + 0 ); + // Add a callout with deconfig and gard + l_err->addHwCallout( l_victim, + HWAS::SRCI_PRIORITY_HIGH, + HWAS::DECONFIG, + HWAS::GARD_Fatal ); + // Commit the log + errlCommit(l_err,CXXTEST_COMP_ID); + + // Verify that the target wasn't actually deconfigured + l_state = + l_victim->getAttr(); + if( !l_state.functional ) + { + TS_FAIL( "Recovered log incorrectly caused deconfig" ); + } + } + + + }; }