summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-11-05 11:53:07 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-11-07 14:59:47 -0600
commit288892a74556c285f8ec6b823dd8929fed1b4ac2 (patch)
treea1db6f5bb2d7f7ac0e5b45c281c35627ca9e4e04 /src/usr/hwas
parent503a82e95be52cfbf4f67dbb6270f4dff27e3ae6 (diff)
downloadtalos-hostboot-288892a74556c285f8ec6b823dd8929fed1b4ac2.tar.gz
talos-hostboot-288892a74556c285f8ec6b823dd8929fed1b4ac2.zip
Remove unused createGardRecord() function
hwas common createGardRecord() function is not used by FSP and so doesn't need to be in the common section. move functionality to the hostboot platCreateGardRecord() and delete the common function. Change-Id: Ie8245d6a52ea3acf75966f97740af9c24dc97913 RTC: 90404 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7064 Tested-by: Jenkins Server Reviewed-by: SHELDON R. BAILEY <baileysh@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwas')
-rw-r--r--src/usr/hwas/common/deconfigGard.C90
-rw-r--r--src/usr/hwas/hwasPlatCallout.C2
-rw-r--r--src/usr/hwas/hwasPlatDeconfigGard.C72
-rw-r--r--src/usr/hwas/test/hwasGardTest.H44
4 files changed, 91 insertions, 117 deletions
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;
}
OpenPOWER on IntegriCloud