From 4d7850eb4d6dd8a433abef0aa36b8815bb3b0d75 Mon Sep 17 00:00:00 2001 From: Bill Hoffa Date: Thu, 8 Sep 2016 16:35:01 -0500 Subject: Allow garding of CORE targets Change-Id: I1d605593309eb132334b749b8bc2ba84d5177f20 RTC: 158588 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29392 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell Reviewed-by: DHRUVARAJ SUBHASH CHANDRAN Reviewed-by: Christian R. Geddes Reviewed-by: Matthew A. Ploetz --- src/usr/errl/errlentry.C | 57 +----------------------------------- src/usr/errl/test/errltest.H | 69 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 57 deletions(-) (limited to 'src/usr') diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index ace3ac0d7..8f430a70b 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -594,62 +594,7 @@ void ErrlEntry::addHwCallout(const TARGETING::Target *i_target, TARGETING::ATTR_ECID).addToLog(this); } - if (l_type == TARGETING::TYPE_CORE) - { - //IF the type being garded is a Core the associated EX Chiplet - // needs to be found and garded instead because the core is - // not gardable - TRACFCOMP(g_trac_errl, INFO_MRK - "addHwCallout - Callout on Core type, use EX Chiplet instead" - " because Core is not gardable"); - TARGETING::TargetHandleList targetList; - getParentAffinityTargets(targetList, - i_target, - TARGETING::CLASS_UNIT, - TARGETING::TYPE_EX); - if ( targetList.size() != 1 ) - { - TRACFCOMP(g_trac_errl, ERR_MRK - "addHwCallout - Found No EX Chiplet for this Core"); - - //Just use the the Core itself in the gard operation - ep = i_target->getAttr(); - - /*@ errorlog tag - * @errortype ERRL_SEV_UNRECOVERABLE - * @moduleid ERRL_ADD_HW_CALLOUT_ID - * @reasoncode ERRL_CORE_EX_TARGET_NULL - * @userdata1 Core HUID that has bad EX association - * @userdata2 Number of EX chips associatd with core - * - * @devdesc Hardware callout could not Gard target - * because it could not find EX chip - * associated with the Core to be called out - * - */ - errlHndl_t l_errl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_UNRECOVERABLE, - ERRORLOG::ERRL_ADD_HW_CALLOUT_ID, - ERRORLOG::ERRL_CORE_EX_TARGET_NULL, - get_huid(i_target), targetList.size(), - true); - - if (l_errl) - { - errlCommit(l_errl, ERRL_COMP_ID); - } - - } - else - { - //Use the EX target found in below logic to gard - ep = targetList[0]->getAttr(); - } - } - else - { - ep = i_target->getAttr(); - } + ep = i_target->getAttr(); // size is total EntityPath size minus unused path elements uint32_t size1 = sizeof(ep) - diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H index 6dd7c599b..3de01fb52 100644 --- a/src/usr/errl/test/errltest.H +++ b/src/usr/errl/test/errltest.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -868,7 +868,74 @@ public: return l_dataMatching; } + /** + * @brief Test CORE callout + */ + void testErrl7(void) + { + TS_TRACE( "test testErrl7"); +#if 1 + // these tests deconfigure and gard targets. and even tho they + // restore their state after the tests, since the cxxtests are + // all run in parallel, during the time that a target is non- + // functional due to this test, another test may be running that + // might be adversly affected. + // tests are left in the code so that a developer can enable them + // to test these specific functions - just keep in mind that there + // could be side effects in other cxxtests. + TS_TRACE( " - SKIPPING -- other tests could be adversly affected"); +#else + do + { + // find a core unit that we can play with + TARGETING::Target * pSys; + TARGETING::targetService().getTopLevelTarget(pSys); + + TARGETING::PredicateCTM predCore(TARGETING::CLASS_UNIT, + TARGETING::TYPE_CORE); + TARGETING::PredicateHwas predFunctional; + predFunctional.poweredOn(true).present(true).functional(true); + TARGETING::PredicatePostfixExpr checkExpr; + checkExpr.push(&predCore).push(&predFunctional).And(); + + TARGETING::TargetHandleList l_coreList; + TARGETING::targetService().getAssociated( l_coreList, pSys, + TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, + &checkExpr ); + + if (l_coreList.empty()) + { + TS_FAIL("test callout: empty l_coreList"); + break; + } + + TARGETING::TargetHandle_t l_target = *l_coreList.begin(); + + // Create an error log + errlHndl_t errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + ERRORLOG::ERRL_TEST_MOD_ID, + ERRORLOG::ERRL_TEST_REASON_CODE); + + // test the different callout types + TS_TRACE( "test callout l_core %p", l_target); + ERRORLOG::ErrlUserDetailsTarget(l_target).addToLog(errl); + + errl->addHwCallout(l_target, + HWAS::SRCI_PRIORITY_HIGH, + HWAS::DECONFIG, + HWAS::GARD_User_Manual); + + errlCommit(errl, CXXTEST_COMP_ID); + + TS_TRACE("testErrl7 done"); + } + while(0); +#endif + } + }; } + #endif -- cgit v1.2.1