diff options
author | Matthew Raybuck <matthew.raybuck@ibm.com> | 2019-02-26 14:46:10 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-03-18 15:43:46 -0500 |
commit | 3265b62f038c0e91d0f22cde3e95f9b9076cb6fa (patch) | |
tree | 8885af5dc78eca2cccd57dfb4f8e2054c4d60f99 /src/include/usr | |
parent | e0f03516109881263fe86fc97d42d3ec6ae75155 (diff) | |
download | talos-hostboot-3265b62f038c0e91d0f22cde3e95f9b9076cb6fa.tar.gz talos-hostboot-3265b62f038c0e91d0f22cde3e95f9b9076cb6fa.zip |
Improve performance of general PG algorithm
The previous PG algorithm had several places where targets would be
rechecked or modified unnecessarily. This commit restructures the PG
algorithm and pulls all related code out of discoverTargets and adds it
to checkPartialGoodForDescendants which will be called by
discoverTargets.
Change-Id: I045f17f7ac22c673633cd3d951997b2371be1b8d
RTC:206066
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72732
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>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r-- | src/include/usr/hwas/common/hwasCommon.H | 71 | ||||
-rw-r--r-- | src/include/usr/hwas/common/hwas_reasoncodes.H | 2 | ||||
-rw-r--r-- | src/include/usr/hwas/common/pgLogic.H | 4 |
3 files changed, 74 insertions, 3 deletions
diff --git a/src/include/usr/hwas/common/hwasCommon.H b/src/include/usr/hwas/common/hwasCommon.H index 0d168008e..be6d8746e 100644 --- a/src/include/usr/hwas/common/hwasCommon.H +++ b/src/include/usr/hwas/common/hwasCommon.H @@ -158,7 +158,7 @@ typedef std::map<const TARGETING::TargetHandle_t, bool> pgState_map; * from VPD; must be malloc'ed by the caller, and * must be VPD_CP00_PG_DATA_ENTRIES in size. * - * @param[in] io_targetStates Reference to the target state map to prevent + * @param[io] io_targetStates Reference to the target state map to prevent * re-checking targets. * * @return bool Returns true if the descendant is functional; @@ -169,6 +169,75 @@ bool isDescFunctional(const TARGETING::TargetHandle_t &i_desc, const uint16_t (&i_pgData)[VPD_CP00_PG_DATA_ENTRIES], pgState_map &io_targetStates); + +/** + * @brief Checks the PG keyword data to determine if all + * of the descendant chiplets are functional. The + * caller is responsible for allocating and + * de-allocating the PG keyword space. + * + * @param[in] i_pTarget The target whose descendants need to be + * checked. Must not be nullptr. + * + * @param[in] i_pgData Reference to area holding the PG keyword read + * from VPD; must be malloc'ed by the caller, and + * must be VPD_CP00_PG_DATA_ENTRIES in size. + * + * @param[in] i_chipFunctional The functional state of i_pTarget. + * + * @param[in] i_errlEid Error log ID of the error associated with + * i_pTarget, if any. + * + * @param[io] io_infoErrl The informational error log that contains PG + * issues. + * + * @param[io] io_createInfoLog Determines whether or not PG issues exist and + * if the informational log should be created. + * + * @param[in] i_isTestcase Determines if the code is running from a + * testcase and if so will not modify the state + * of the system. Defaulted to false. + * + * @param[out] o_testResult A pointer to the functional state of i_pTarget + * if we are running a test. Default nullptr. + * + * @return Returns an error if encountered, otherwise + * nullptr. + * + */ +errlHndl_t checkPartialGoodForDescendants( + const TARGETING::TargetHandle_t &i_pTarget, + const uint16_t (&i_pgData)[VPD_CP00_PG_DATA_ENTRIES], + const bool i_chipFunctional, + const uint32_t i_errlEid, + errlHndl_t io_infoErrl, + bool &io_createInfoLog, + bool i_isTestcase = false, + bool* o_testResult = nullptr); + +/** +* @brief This function will propagate a parent's +* non-functional status down to all functional +* children since children cannot be considered +* functional if they have non-functional parents. +* NOTE: This function will only mark children +* non-functional if the passed-in parent is +* non-functional and is in the io_targetStates +* map. Therefore, if a parent is passsed in that +* is functional or missing from the +* io_targetStates map (parent state unknown) this +* function behaves as a no-op. +* +* @param[in] i_desc Pointer to the parent target we're looking +* at. Must not be nullptr. +* +* @param[io] io_targetStates Reference to the pgState_map that will be +* updated by this function. +* +*/ +void markChildrenNonFunctional(const TARGETING::TargetHandle_t &i_parent, + pgState_map &io_targetStates); + /** * @deprecated * @brief platform specific code to determine the PR vector of the input diff --git a/src/include/usr/hwas/common/hwas_reasoncodes.H b/src/include/usr/hwas/common/hwas_reasoncodes.H index 7b793ecb3..b60e10032 100644 --- a/src/include/usr/hwas/common/hwas_reasoncodes.H +++ b/src/include/usr/hwas/common/hwas_reasoncodes.H @@ -41,6 +41,7 @@ namespace HWAS MOD_FIND_RULES_FOR_TARGET = 0x0A, MOD_DISCOVER_TARGETS = 0x0B, MOD_UPDATE_PROC_COMPAT_RISK_LEVEL = 0x0C, + MOD_CHECK_PG_FOR_DESC = 0x0D, }; enum HwasReasonCode @@ -78,6 +79,7 @@ namespace HWAS RC_FORCED_COMPAT_INVALID_LEVEL = HWAS_COMP_ID | 0x1B, RC_FORCED_NATIVE_INVALID_MIXED_EC = HWAS_COMP_ID | 0x1C, RC_FORCED_NATIVE_OF_INCOMPATIBLE_RISK = HWAS_COMP_ID | 0x1D, + RC_PARTIAL_GOOD_MISSING_TARGET = HWAS_COMP_ID | 0x1E, }; enum HwasPlatUserDetailsTypes diff --git a/src/include/usr/hwas/common/pgLogic.H b/src/include/usr/hwas/common/pgLogic.H index 1adf5509f..8e1ca32ba 100644 --- a/src/include/usr/hwas/common/pgLogic.H +++ b/src/include/usr/hwas/common/pgLogic.H @@ -695,14 +695,14 @@ namespace PARTIAL_GOOD APPLICABLE_TO_ALL, NO_SPECIAL_RULE ), - // OBUS Rule 3: pbioo1 unit on chiplet N3 must be checked + // OBUS Rule 3: pbioo1 unit on chiplet N1 must be checked // for Cumulus OBUSes (chip unit 1 and 2). new PartialGoodRule ( {&PREDICATE_CUMULUS}, OBUS_R3_PG_MASK, ALL_OFF_AG_MASK, - N3_PG_INDEX, + N1_PG_INDEX, OBUS_R3_CU_MASK, NO_SPECIAL_RULE ), |