diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/hwas/common/deconfigGard.H | 20 | ||||
-rw-r--r-- | src/usr/hwas/common/deconfigGard.C | 90 | ||||
-rw-r--r-- | src/usr/hwas/hwasPlatCallout.C | 2 | ||||
-rw-r--r-- | src/usr/hwas/hwasPlatDeconfigGard.C | 72 | ||||
-rw-r--r-- | src/usr/hwas/test/hwasGardTest.H | 44 |
5 files changed, 91 insertions, 137 deletions
diff --git a/src/include/usr/hwas/common/deconfigGard.H b/src/include/usr/hwas/common/deconfigGard.H index abf8af3b9..d321c0113 100644 --- a/src/include/usr/hwas/common/deconfigGard.H +++ b/src/include/usr/hwas/common/deconfigGard.H @@ -249,26 +249,6 @@ public: const uint32_t i_errlEid); /** - * @brief Creates a GARD Record for a Target. - * - * Called by ErrlManager when committing an error log containing a - * GARD Record request. - * - * Called by an administrator to manually create a GARD Record. - * - * Any error creating the GARD Record will be returned to the user. - * - * @param[in] i_pTarget Pointer to Target to create GARD Record for. - * @param[in] i_errlEid Error log EID to store in GARD Record. - * @param[in] i_errorType error type of the GARD Record. - * - * @return errlHndl_t. Error log handle. - */ - errlHndl_t createGardRecord(const TARGETING::Target * const i_pTarget, - const uint32_t i_errlEid, - const GARD_ErrorType i_errorType); - - /** * @brief Platform specific function that * Creates a GARD Record for a Target. * diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C index a2aa67110..bd4c90fca 100644 --- a/src/usr/hwas/common/deconfigGard.C +++ b/src/usr/hwas/common/deconfigGard.C @@ -67,7 +67,7 @@ using namespace TARGETING; //****************************************************************************** errlHndl_t collectGard(const PredicateBase *i_pPredicate) { - HWAS_INF("collectGard entry" ); + HWAS_DBG("collectGard entry" ); errlHndl_t errl = NULL; do @@ -119,14 +119,14 @@ DeconfigGard::DeconfigGard() iv_XABusEndpointDeconfigured(false), iv_deconfigCount(0) { - HWAS_INF("DeconfigGard Constructor"); + HWAS_DBG("DeconfigGard Constructor"); HWAS_MUTEX_INIT(iv_mutex); } //****************************************************************************** DeconfigGard::~DeconfigGard() { - HWAS_INF("DeconfigGard Destructor"); + HWAS_DBG("DeconfigGard Destructor"); HWAS_MUTEX_DESTROY(iv_mutex); free(iv_platDeconfigGard); } @@ -247,7 +247,7 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl( break; } - HWAS_INF("%d GARD Records found", l_gardRecords.size()); + HWAS_DBG("%d GARD Records found", l_gardRecords.size()); if (l_gardRecords.empty()) { @@ -341,7 +341,7 @@ bool compareTargetHuid(TargetHandle_t t1, TargetHandle_t t2) //****************************************************************************** errlHndl_t DeconfigGard::processFieldCoreOverride() { - HWAS_INF("Process Field Core Override FCO"); + HWAS_DBG("Process Field Core Override FCO"); errlHndl_t l_pErr = NULL; do @@ -446,78 +446,6 @@ errlHndl_t DeconfigGard::processFieldCoreOverride() } //****************************************************************************** -errlHndl_t DeconfigGard::createGardRecord(const Target * const i_pTarget, - const uint32_t i_errlEid, - const GARD_ErrorType i_errorType) -{ - errlHndl_t l_pErr = NULL; - - do - { - const uint8_t lDeconfigGardable = - i_pTarget->getAttr<ATTR_DECONFIG_GARDABLE>(); - const uint8_t lPresent = - i_pTarget->getAttr<ATTR_HWAS_STATE>().present; - if (!lDeconfigGardable || !lPresent) - { - // Target is not GARDable. Commit an error - HWAS_ERR("Target not GARDable"); - - /*@ - * @errortype - * @moduleid HWAS::MOD_DECONFIG_GARD - * @reasoncode HWAS::RC_TARGET_NOT_GARDABLE - * @devdesc Attempt to create a GARD Record for a target that - * is not GARDable - * (not DECONFIG_GARDABLE or not present) - * @userdata1 HUID of input target // GARD errlog EID - * @userdata2 ATTR_DECONFIG_GARDABLE // ATTR_HWAS_STATE.present - */ - const uint64_t userdata1 = - (static_cast<uint64_t>(get_huid(i_pTarget)) << 32) | i_errlEid; - const uint64_t userdata2 = - (static_cast<uint64_t>(lDeconfigGardable) << 32) | lPresent; - l_pErr = hwasError( - ERRL_SEV_UNRECOVERABLE, - HWAS::MOD_DECONFIG_GARD, - HWAS::RC_TARGET_NOT_GARDABLE, - userdata1, - userdata2); - break; - } - - Target* pSys; - targetService().getTopLevelTarget(pSys); - HWAS_ASSERT(pSys, "HWAS createGardRecord: no TopLevelTarget"); - - // check for system CDM Policy - const ATTR_CDM_POLICIES_type l_sys_policy = - pSys->getAttr<ATTR_CDM_POLICIES>(); - if (l_sys_policy & CDM_POLICIES_MANUFACTURING_DISABLED) - { - // manufacturing records are disabled - // - don't process - HWAS_INF("Manufacturing policy: disabled - skipping GARD Record create"); - break; - } - - if ((l_sys_policy & CDM_POLICIES_PREDICTIVE_DISABLED) && - (i_errorType == GARD_Predictive)) - { - // predictive records are disabled AND gard record is predictive - // - don't process - HWAS_INF("Predictive policy: disabled - skipping GARD Record create"); - break; - } - - l_pErr = platCreateGardRecord(i_pTarget, i_errlEid, i_errorType); - } - while (0); - - return l_pErr; -} - -//****************************************************************************** errlHndl_t DeconfigGard::clearGardRecords( const Target * const i_pTarget) { @@ -539,7 +467,7 @@ errlHndl_t DeconfigGard::deconfigureTarget(Target & i_target, const uint32_t i_errlEid, bool i_evenAtRunTime) { - HWAS_INF("Deconfigure Target"); + HWAS_DBG("Deconfigure Target"); errlHndl_t l_pErr = NULL; do @@ -640,7 +568,7 @@ errlHndl_t DeconfigGard::_getDeconfigureRecords( const Target * const i_pTarget, DeconfigureRecords_t & o_records) { - HWAS_INF("Get Deconfigure Record(s)"); + HWAS_DBG("Get Deconfigure Record(s)"); o_records.clear(); HWAS_MUTEX_LOCK(iv_mutex); @@ -1312,7 +1240,7 @@ void DeconfigGard::_deconfigureByAssoc(Target & i_target, } // switch } // !i_atRunTime - //HWAS_INF("deconfigByAssoc exiting: %.8X", get_huid(&i_target)); + HWAS_DBG("deconfigByAssoc exiting: %.8X", get_huid(&i_target)); } // _deconfigByAssoc //****************************************************************************** @@ -1320,7 +1248,7 @@ uint32_t DeconfigGard::getDeconfigureStatus() const { // no lock needed - just return the value. uint32_t l_deconfigCount = iv_deconfigCount; - HWAS_INF("getDeconfigureStatus returning %u", l_deconfigCount); + HWAS_DBG("getDeconfigureStatus returning %u", l_deconfigCount); return l_deconfigCount; } diff --git a/src/usr/hwas/hwasPlatCallout.C b/src/usr/hwas/hwasPlatCallout.C index 7c7ea4732..b8adddecf 100644 --- a/src/usr/hwas/hwasPlatCallout.C +++ b/src/usr/hwas/hwasPlatCallout.C @@ -89,7 +89,7 @@ errlHndl_t platHandleHWCallout( } default: { - errl = HWAS::theDeconfigGard().createGardRecord(i_pTarget, + errl = HWAS::theDeconfigGard().platCreateGardRecord(i_pTarget, io_errl->eid(), i_gardErrorType); break; diff --git a/src/usr/hwas/hwasPlatDeconfigGard.C b/src/usr/hwas/hwasPlatDeconfigGard.C index 71ffb2d78..5f658235b 100644 --- a/src/usr/hwas/hwasPlatDeconfigGard.C +++ b/src/usr/hwas/hwasPlatDeconfigGard.C @@ -56,12 +56,7 @@ errlHndl_t DeconfigGard::platClearGardRecords( errlHndl_t l_pErr = NULL; EntityPath l_targetId; - if (i_pTarget) - { - HWAS_INF("Clear GARD Records for %.8X", get_huid(i_pTarget)); - l_targetId = i_pTarget->getAttr<ATTR_PHYS_PATH>(); - } - else + if (!i_pTarget) { HWAS_INF("Clear all GARD Records"); } @@ -103,7 +98,7 @@ errlHndl_t DeconfigGard::platClearGardRecords( } } // for - HWAS_INF("GARD Records to Cleared: %d", l_gardRecordsCleared); + HWAS_INF("GARD Records Cleared: %d", l_gardRecordsCleared); } else { @@ -122,12 +117,7 @@ errlHndl_t DeconfigGard::platGetGardRecords( o_records.clear(); EntityPath l_targetId; - if (i_pTarget) - { - HWAS_INF("Get GARD Record for %.8X", get_huid(i_pTarget)); - l_targetId = i_pTarget->getAttr<ATTR_PHYS_PATH>(); - } - else + if (!i_pTarget) { HWAS_INF("Get all GARD Records"); } @@ -188,6 +178,62 @@ errlHndl_t DeconfigGard::platCreateGardRecord( do { + const uint8_t lDeconfigGardable = + i_pTarget->getAttr<ATTR_DECONFIG_GARDABLE>(); + const uint8_t lPresent = + i_pTarget->getAttr<ATTR_HWAS_STATE>().present; + if (!lDeconfigGardable || !lPresent) + { + // Target is not GARDable. Commit an error + HWAS_ERR("Target not GARDable"); + + /*@ + * @errortype + * @moduleid HWAS::MOD_DECONFIG_GARD + * @reasoncode HWAS::RC_TARGET_NOT_GARDABLE + * @devdesc Attempt to create a GARD Record for a target that + * is not GARDable + * (not DECONFIG_GARDABLE or not present) + * @userdata1 HUID of input target // GARD errlog EID + * @userdata2 ATTR_DECONFIG_GARDABLE // ATTR_HWAS_STATE.present + */ + const uint64_t userdata1 = + (static_cast<uint64_t>(get_huid(i_pTarget)) << 32) | i_errlEid; + const uint64_t userdata2 = + (static_cast<uint64_t>(lDeconfigGardable) << 32) | lPresent; + l_pErr = hwasError( + ERRL_SEV_UNRECOVERABLE, + HWAS::MOD_DECONFIG_GARD, + HWAS::RC_TARGET_NOT_GARDABLE, + userdata1, + userdata2); + break; + } + + Target* pSys; + targetService().getTopLevelTarget(pSys); + HWAS_ASSERT(pSys, "HWAS platCreateGardRecord: no TopLevelTarget"); + + // check for system CDM Policy + const ATTR_CDM_POLICIES_type l_sys_policy = + pSys->getAttr<ATTR_CDM_POLICIES>(); + if (l_sys_policy & CDM_POLICIES_MANUFACTURING_DISABLED) + { + // manufacturing records are disabled + // - don't process + HWAS_INF("Manufacturing policy: disabled - skipping GARD Record create"); + break; + } + + if ((l_sys_policy & CDM_POLICIES_PREDICTIVE_DISABLED) && + (i_errorType == GARD_Predictive)) + { + // predictive records are disabled AND gard record is predictive + // - don't process + HWAS_INF("Predictive policy: disabled - skipping GARD Record create"); + break; + } + l_pErr = _GardRecordIdSetup(iv_platDeconfigGard); if (l_pErr) { diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H index 487c28df3..834937306 100644 --- a/src/usr/hwas/test/hwasGardTest.H +++ b/src/usr/hwas/test/hwasGardTest.H @@ -841,11 +841,11 @@ public: // Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(l_pTarget, 0x12, GARD_Predictive); + platCreateGardRecord(l_pTarget, 0x12, GARD_Predictive); if (l_pErr) { - TS_FAIL("testGard4: Error from createGardRecord"); + TS_FAIL("testGard4: Error from platCreateGardRecord"); break; } @@ -971,21 +971,21 @@ public: // Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(l_pTarget, 0x23, GARD_Predictive); + platCreateGardRecord(l_pTarget, 0x23, GARD_Predictive); if (l_pErr) { - TS_FAIL("testGard5: Error from createGardRecord"); + TS_FAIL("testGard5: Error from platCreateGardRecord"); break; } // Create another GARD Record for the target l_pErr = theDeconfigGard(). - createGardRecord(l_pTarget, 0x45, GARD_Fatal); + platCreateGardRecord(l_pTarget, 0x45, GARD_Fatal); if (l_pErr) { - TS_FAIL("testGard5: Error from createGardRecord (2)"); + TS_FAIL("testGard5: Error from platCreateGardRecord (2)"); break; } @@ -1104,21 +1104,21 @@ public: // Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(l_pTarget, 0x23, GARD_User_Manual); + platCreateGardRecord(l_pTarget, 0x23, GARD_User_Manual); if (l_pErr) { - TS_FAIL("testGard6: Error from createGardRecord"); + TS_FAIL("testGard6: Error from platCreateGardRecord"); break; } // Create another GARD Record for the target - should overwrite l_pErr = theDeconfigGard(). - createGardRecord(l_pTarget, 0x46, GARD_Fatal); + platCreateGardRecord(l_pTarget, 0x46, GARD_Fatal); if (l_pErr) { - TS_FAIL("testGard6: Error from createGardRecord (2)"); + TS_FAIL("testGard6: Error from platCreateGardRecord (2)"); break; } @@ -1245,11 +1245,11 @@ public: // Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(l_pTarget, 0x71, GARD_Predictive); + platCreateGardRecord(l_pTarget, 0x71, GARD_Predictive); if (l_pErr) { - TS_FAIL("testGard7: Error from createGardRecord"); + TS_FAIL("testGard7: Error from platCreateGardRecord"); break; } @@ -1355,10 +1355,10 @@ public: // create GARD record, call 'doGard' step and confirm target is // deconfigured l_pErr = theDeconfigGard(). - createGardRecord(l_target, 0x12, GARD_User_Manual); + platCreateGardRecord(l_target, 0x12, GARD_User_Manual); if (l_pErr) { - TS_FAIL("testGard8: Error from createGardRecord"); + TS_FAIL("testGard8: Error from platCreateGardRecord"); break; } @@ -1504,11 +1504,11 @@ public: // (try to) Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(l_pTarget, 0x12, GARD_Fatal); + platCreateGardRecord(l_pTarget, 0x12, GARD_Fatal); if (l_pErr) { - TS_FAIL("testGard9: Error from createGardRecord"); + TS_FAIL("testGard9: Error from platCreateGardRecord"); break; } @@ -1535,11 +1535,11 @@ public: // (try to) Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(l_pTarget, 0x12, GARD_Predictive); + platCreateGardRecord(l_pTarget, 0x12, GARD_Predictive); if (l_pErr) { - TS_FAIL("testGard9: Error from createGardRecord"); + TS_FAIL("testGard9: Error from platCreateGardRecord"); break; } @@ -1635,10 +1635,10 @@ public: // create GARD record, set Policy, call 'doGard' step and confirm // target is NOT deconfigured l_pErr = theDeconfigGard(). - createGardRecord(l_target, 0x12, GARD_Predictive); + platCreateGardRecord(l_target, 0x12, GARD_Predictive); if (l_pErr) { - TS_FAIL("testGard10: Error from createGardRecord"); + TS_FAIL("testGard10: Error from platCreateGardRecord"); break; } @@ -1721,10 +1721,10 @@ public: // create GARD record, set Policy, call 'doGard' step and confirm // target is NOT deconfigured l_pErr = theDeconfigGard(). - createGardRecord(l_target, 0x12, GARD_Predictive); + platCreateGardRecord(l_target, 0x12, GARD_Predictive); if (l_pErr) { - TS_FAIL("testGard10: Error from createGardRecord"); + TS_FAIL("testGard10: Error from platCreateGardRecord"); break; } |