Skip to content

Commit

Permalink
Create error for unsuspected target in configureHbrtHypIds
Browse files Browse the repository at this point in the history
Specifically check for all expected types.  Create an error
if an unsuspected type is encountered.  Also use the const
for error logs which just add software callout.

Change-Id: Ie1b35945ee7c580dd70d3c97c68184a22fb6ced5
RTC:210321
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82225
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R Geddes <crgeddes@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: Corey V Swenson <cswenson@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mderkse1 authored and dcrowell77 committed Oct 7, 2019
1 parent e017df4 commit 63989a5
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/include/usr/runtime/runtime_reasoncodes.H
Expand Up @@ -68,7 +68,8 @@ namespace RUNTIME
MOD_OPEN_UNTRUSTED_SP_AREAS = 0x28, /**< populate_hbruntime.C */
MOD_SEND_ATTRIBUTES_TO_FSP = 0x29, /**< hbrt_utilities.H */
MOD_RT_DO_NVDIMM_OP = 0x2A, /**< rt_fwnotify.C */
SET_ATTR_NVDIMM_ENCRYPTION_ENABLE = 0x2B, /**< rt_fwnotify.C */
SET_ATTR_NVDIMM_ENCRYPTION_ENABLE = 0x2B, /**< rt_fwnotify.C */
MOD_CONFIGURE_HBRT_HYP_IDS = 0x2C,
};

enum RuntimeReasonCode
Expand Down
54 changes: 47 additions & 7 deletions src/usr/runtime/customize_attrs_for_payload.C
Expand Up @@ -78,15 +78,16 @@ errlHndl_t createProcNotFoundError(
* @reasoncode RUNTIME::RT_NO_PROC_TARGET
* @userdata1 Input targeting target's HUID
* @devdesc No processor targeting target was found for the given
* targeting target
* targeting target
* @custdesc Unexpected internal firmware error
*/
pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
RUNTIME::MOD_CUST_COMP_NON_PHYP_RT_TARGET,
RUNTIME::RT_NO_PROC_TARGET,
huid,
0,
true);
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);

ERRORLOG::ErrlUserDetailsTarget(i_pTarget,"Targeting target").
addToLog(pError);
Expand Down Expand Up @@ -165,14 +166,15 @@ errlHndl_t computeNonPhypRtTarget(
* @userdata1 MEMBUF targeting target's HUID
* @devdesc No associated DMI targeting target(s) found for
* given MEMBUF targeting target
* @custdesc Unexpected internal firmware error
*/
pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
RUNTIME::MOD_CUST_COMP_NON_PHYP_RT_TARGET,
RUNTIME::RT_UNIT_TARGET_NOT_FOUND,
huid,
0,
true);
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);

ERRORLOG::ErrlUserDetailsTarget(i_pTarget,"Targeting Target").
addToLog(pError);
Expand Down Expand Up @@ -257,14 +259,15 @@ errlHndl_t computeNonPhypRtTarget(
* @userdata1 OCMB targeting target's HUID
* @devdesc No associated OMI targeting target(s) found for
* given OCMB targeting target
* @custdesc Unexpected internal firmware error
*/
pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
RUNTIME::MOD_CUST_COMP_NON_PHYP_RT_TARGET,
RUNTIME::RT_NO_OMI_TARGET_FOUND,
huid,
0,
true);
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);

ERRORLOG::ErrlUserDetailsTarget(i_pTarget,"Targeting Target").
addToLog(pError);
Expand Down Expand Up @@ -319,14 +322,15 @@ errlHndl_t computeNonPhypRtTarget(
* @userdata2 Targeting target's type
* @devdesc The targeting type of the input targeting target is
* not supported by runtime code
* @custdesc Unexpected internal firmware error
*/
pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
RUNTIME::MOD_CUST_COMP_NON_PHYP_RT_TARGET,
RUNTIME::RT_TARGET_TYPE_NOT_SUPPORTED,
huid,
targetingTargetType,
true);
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);

ERRORLOG::ErrlUserDetailsTarget(i_pTarget,"Targeting Target").
addToLog(pError);
Expand Down Expand Up @@ -402,14 +406,15 @@ errlHndl_t getRtTypeForTarget(
* @userdata1 Target's HUID
* @userdata2 Target's targeting type
* @devdesc Targeting target's type not supported by runtime code
* @custdesc Unexpected internal firmware error
*/
pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
RUNTIME::MOD_CUST_CONF_HBRT_HYP_IDS,
RUNTIME::RT_TARGET_TYPE_NOT_SUPPORTED,
huid,
targetingTargetType,
true);
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);

ERRORLOG::ErrlUserDetailsTarget(i_pTarget,"Targeting Target").
addToLog(pError);
Expand Down Expand Up @@ -543,9 +548,38 @@ errlHndl_t configureHbrtHypIds(const bool i_configForPhyp)
hbrtHypId += pos; // Add OMI chip unit to end
break;
}
default: // just PROC
case TARGETING::TYPE_PROC:
{
hbrtHypId = (*pIt)->getAttr<TARGETING::ATTR_ORDINAL_ID>();
break;
}
default:
{
auto huid = get_huid(*pIt);
auto targetType = (*pIt)->getAttr<TARGETING::ATTR_TYPE>();
TRACFCOMP(g_trac_runtime, ERR_MRK
"configureHbrtHypIds> 0x%08X is not a supported type. "
"HUID: 0x%08X", targetType, huid);
/*@
* @errortype
* @moduleid RUNTIME::MOD_CONFIGURE_HBRT_HYP_IDS
* @reasoncode RUNTIME::RT_TARGET_TYPE_NOT_SUPPORTED
* @userdata1 Target's HUID
* @userdata2 Target's targeting type
* @devdesc Targeting target's type not supported by runtime code
* @custdesc Unexpected internal firmware error
*/
pError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
RUNTIME::MOD_CONFIGURE_HBRT_HYP_IDS,
RUNTIME::RT_TARGET_TYPE_NOT_SUPPORTED,
huid,
targetType,
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);

ERRORLOG::ErrlUserDetailsTarget(*pIt,"Targeting Target").
addToLog(pError);
break;
}
} // end of ATTR_TYPE switch
hbrtHypId |= rtType;
Expand All @@ -559,6 +593,12 @@ errlHndl_t configureHbrtHypIds(const bool i_configForPhyp)
}
}

// Only set HBRT_HYP_ID attribute if no error found
if (pError)
{
break;
}

(*pIt)->setAttr<TARGETING::ATTR_HBRT_HYP_ID>(hbrtHypId);
TRACDCOMP( g_trac_runtime, "configureHbrtHypIds> "
"Set ATTR_HBRT_HYP_ID attribute to 0x%016llX on targeting target "
Expand Down

0 comments on commit 63989a5

Please sign in to comment.