Skip to content

Commit

Permalink
Avoid callouts, deconfigs, and gards for all non-visible errors
Browse files Browse the repository at this point in the history
Fixed the deferred deconfig path that was still applying
callouts for info logs
Simplified where the check is for regular deconfigs

Change-Id: I49ff4b0fe4ee81c28fde594c15bfd8f38bea1afc
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43289
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@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>
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
dcrowell77 authored and wghoffa committed Jul 21, 2017
1 parent 152aabb commit 2db3963
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 4 deletions.
18 changes: 17 additions & 1 deletion src/include/usr/errl/errlentry.H
Expand Up @@ -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
Expand Down
47 changes: 44 additions & 3 deletions src/usr/errl/errlentry.C
Expand Up @@ -582,19 +582,19 @@ 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;
}
break;

case ERRL_SEV_RECOVERED:

if(l_enableLogs == ENABLE_RECOVERABLE_LOGS )
if(l_enableLogs & ENABLE_RECOVERABLE_LOGS )
{
iv_skipShowingLog = false;
}
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -1543,5 +1557,32 @@ std::vector<void*> 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

77 changes: 77 additions & 0 deletions src/usr/errl/test/errltest.H
Expand Up @@ -40,6 +40,7 @@

#include <errl/errludtarget.H>
#include <targeting/common/target.H>
#include <targeting/namedtarget.H>
#include <targeting/common/iterators/rangefilter.H>
#include <targeting/common/predicates/predicates.H>
#include <hwas/common/hwasCallout.H>
Expand Down Expand Up @@ -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<TARGETING::ATTR_HWAS_STATE>();
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<TARGETING::ATTR_HWAS_STATE>();
if( !l_state.functional )
{
TS_FAIL( "Recovered log incorrectly caused deconfig" );
}
}



};
}

Expand Down

0 comments on commit 2db3963

Please sign in to comment.