diff options
| author | Andrew Geissler <andrewg@us.ibm.com> | 2018-06-13 13:40:39 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-06-19 12:18:25 -0400 |
| commit | ea86539a69de1f7415cf697fba5c35b8970a7db4 (patch) | |
| tree | 9f2289fb9a51a2bf77a742c0639522a9c56869d1 /src/usr/hwas/common | |
| parent | 74bfadb2ab8796c738c7d951041d890261aee293 (diff) | |
| download | blackbird-hostboot-ea86539a69de1f7415cf697fba5c35b8970a7db4.tar.gz blackbird-hostboot-ea86539a69de1f7415cf697fba5c35b8970a7db4.zip | |
Ensure hwas state reflects resource recovery actions
Once resource recovery is run to recover hardware resources to
allow the system to boot, it will not be run again until the
configuration of the hardware changes. An issue with that design
is that the HWAS state, deconfiguredByEid, will not be properly
updated in situations where resource recovery has already run.
This state is used by the gard command line tool to inform
the user on the state of their garded hardware.
This commit ensure the deconfiguredByEid is properly updated
for targets that are guarded, but have been resource recovered
to allow system boot.
Change-Id: Ib15c1e8402e7c13b6497915c5138831e5e591bbe
CQ: SW432846
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60486
Tested-by: Jenkins Server <pfd-jenkins+hostboot@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: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: DHRUVARAJ SUBHASH CHANDRAN <dhruvaraj@in.ibm.com>
Reviewed-by: ARAVIND T. NAIR <aravindnair@in.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/hwas/common')
| -rw-r--r-- | src/usr/hwas/common/deconfigGard.C | 83 |
1 files changed, 81 insertions, 2 deletions
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C index 1cdbb3637..c5ec54c9d 100644 --- a/src/usr/hwas/common/deconfigGard.C +++ b/src/usr/hwas/common/deconfigGard.C @@ -445,6 +445,78 @@ errlHndl_t DeconfigGard::clearGardRecordsByType(const GARD_ErrorType i_type) return l_pErr; } // clearGardRecordsByType +//****************************************************************************** +errlHndl_t DeconfigGard::updateSpecDeconfigTargetStates( + const PredicateBase *i_pPredicate) +{ + errlHndl_t l_pErr = NULL; + + do + { + // It is a caller error if this function is called and spec deconfig + // is not enabled. + Target * pSys; + targetService().getTopLevelTarget(pSys); + HWAS_ASSERT((pSys->getAttr<ATTR_BLOCK_SPEC_DECONFIG>() == 1), + "HWAS updateSpecDeconfigTargetStates: " + "ATTR_BLOCK_SPEC_DECONFIG != 1"); + + // Get all GARD Records + GardRecords_t l_gardRecords; + l_pErr = platGetGardRecords(NULL, l_gardRecords); + if (l_pErr) + { + HWAS_ERR("Error from platGetGardRecords"); + break; + } + + for (GardRecordsCItr_t l_itr = l_gardRecords.begin(); + (l_itr != l_gardRecords.end()); + ++l_itr) + { + GardRecord l_gardRecord = *l_itr; + + // Find the associated Target + Target * l_pTarget = + targetService().toTarget(l_gardRecord.iv_targetId); + + if (l_pTarget == NULL) + { + // could be a platform specific target for the other + // ie, we are hostboot and this is an FSP target, or vice-versa + // Binary trace the iv_targetId (EntityPath) + HWAS_INF_BIN("Could not find Target for:", + &(l_gardRecord.iv_targetId), + sizeof(l_gardRecord.iv_targetId)); + continue; + } + + // if this does NOT match, continue to next in loop + if (i_pPredicate && ((*i_pPredicate)(l_pTarget) == false)) + { + HWAS_INF("skipping %.8X - predicate didn't match", + get_huid(l_pTarget)); + continue; + } + + // Since all GARD records have already been processed, if we find + // any target that is functional, it means it has been resource + // recovered. Update it's HWAS state to reflect this + TARGETING::HwasState l_hwasState = + l_pTarget->getAttr<TARGETING::ATTR_HWAS_STATE>(); + if(l_hwasState.functional) + { + HWAS_INF("Found GARDED target 0x%08X is functional, set state", + TARGETING::get_huid(l_pTarget)); + l_hwasState.deconfiguredByEid = + DeconfigGard::CONFIGURED_BY_RESOURCE_RECOVERY; + l_pTarget->setAttr<TARGETING::ATTR_HWAS_STATE>(l_hwasState); + } + } + }while (0); + + return l_pErr; +} //****************************************************************************** errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl( @@ -602,8 +674,15 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl( #if (!defined(CONFIG_CONSOLE_OUTPUT_TRACE) && defined(CONFIG_CONSOLE)) CONSOLE::displayf("HWAS", "Blocking Speculative Deconfig"); #endif - HWAS_INF("Blocking Speculative Deconfig: " - "skipping Predictive GARD Records"); + HWAS_INF("Blocking Speculative Deconfig: skipping Predictive GARD " + " and updating recovered resources"); + + l_pErr = updateSpecDeconfigTargetStates(i_pPredicate); + if(l_pErr) + { + HWAS_ERR("updateSpecDeconfigTargetStates returned an error"); + break; + } } GardRecords_t l_specDeconfigVector; |

