Skip to content

Commit

Permalink
Only switch sides and perform hreset if SEEPROM side versions match
Browse files Browse the repository at this point in the history
In the event that the SBE fails hostboot will attempt to recover it.
During runtime hostboot will attempt an HRESET if the SBE is in a
failed state. When the SBE performs the HRESET it will save some
important information that will persist through the reset. If one
side is failing to recover the retry code will attempt to switch sides
and do the hreset. If the SBE seeproms have different versions of the
SBE code the data that was supposed to persist through the HRESET will
be in incorrect places because the version mismatch. Because of this
we cannot switch seeprom sides and perform a hreset if the seeproms have
different level of the SBE code.

CQ: SW438029
Change-Id: Ic7078a886088cc4d5355cc076e72d0fc36f85027
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/62952
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: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Jul 20, 2018
1 parent 0eda42c commit 3e3f1ab
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 118 deletions.
12 changes: 12 additions & 0 deletions src/include/usr/sbe/sbe_update.H
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,18 @@ namespace SBE
const uint64_t i_boundary,
uint8_t* o_dst);

/**
* @brief Read the version of code found on each of the SBE's seeproms
* and store values in sbeTargetState_t type
*
* @param[in] io_sbeState Struct holding SBE related information
* @pre it is expected that the member 'target' in the
* sbeTargetState_t struct is set prior to calling this function
*
* @return errlHndl_t if error, nullptr if no error
*/
errlHndl_t getSeepromVersions(sbeTargetState_t& io_sbeState);


/**
* @brief Removes ECC from a block of code or data. Removes padding at
Expand Down
12 changes: 12 additions & 0 deletions src/include/usr/sbe/sbeif.H
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ namespace SBE
SHA512_t o_hash,
const void * i_image_ptr = nullptr);

/**
* @brief Loop through all active processor targets and compare both sides of
* the processor's SBE's seeprom versions. Mark down in the attribute
* ATTR_HB_SBE_SEEPROM_VERSION_MATCH whether or not the versions match.
* This value is used later on to determine if it is safe to switch
* seeprom sides in the event that we attempt to recover the SBE from
* a failed state.
*
* @return errlHndl_t Error log handle on failure; otherwise nullptr
*/
errlHndl_t querySbeSeepromVersions();

} //end namespace SBE

#endif /* _SBEIF_H */
1 change: 1 addition & 0 deletions src/include/usr/sbeio/sbeioreasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ enum sbeioReasonCode

// SBE Vital Attention error codes
SBEIO_SBE_RC_VALUE_INFO = SBEIO_COMP_ID | 0x60,
SBEIO_SEEPROM_VERSION_MISMATCH = SBEIO_COMP_ID | 0x61,

// Remove once we collect the FFDC ourselves - @todo-RTC:144313
//termination_rc
Expand Down
11 changes: 11 additions & 0 deletions src/usr/isteps/istep10/call_host_slave_sbe_update.C
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,17 @@ void* call_host_slave_sbe_update (void *io_pArgs)
}
}


// Set SEEPROM_VERSIONS_MATCH attributes for each processor
// this will be used later on by the sbe_retry code to determine
// if it is safe to switch seeprom sides during recovery attempts
l_errl = SBE::querySbeSeepromVersions();
if(l_errl)
{
l_StepError.addErrorDetails( l_errl);
errlCommit( l_errl, HWPF_COMP_ID);
}

} while (0);

TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
Expand Down
327 changes: 210 additions & 117 deletions src/usr/sbe/sbe_update.C

Large diffs are not rendered by default.

44 changes: 43 additions & 1 deletion src/usr/sbeio/common/sbe_retry_handler.C
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )

if(this->iv_currentAction == P9_EXTRACT_SBE_RC::NO_RECOVERY_ACTION)
{
SBE_TRACF("main_sbe_handler(): We have concluded there are no further recovery actions to take, deconfiguring proc and exiting handler");
// There is no action possible. Gard and Callout the proc
/*@
* @errortype ERRL_SEV_UNRECOVERABLE
Expand Down Expand Up @@ -292,7 +293,6 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )

errlCommit(l_errl, ISTEP_COMP_ID);
this->iv_currentSBEState = SBE_REG_RETURN::PROC_DECONFIG;
SBE_TRACF("main_sbe_handler(): We have concluded there are no further recovery actions to take, deconfiguring proc and exiting handler");
break;
}

Expand All @@ -305,6 +305,48 @@ void SbeRetryHandler::main_sbe_handler( TARGETING::Target * i_target )
this->iv_currentAction ==
P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM))
{
// We cannot switch sides and perform an hreset if the seeprom's
// versions do not match. If this happens, log an error and stop
// trying to recover the SBE
if(this->iv_sbeRestartMethod == HRESET)
{
TARGETING::ATTR_HB_SBE_SEEPROM_VERSION_MISMATCH_type l_versionsMismatch =
i_target->getAttr<TARGETING::ATTR_HB_SBE_SEEPROM_VERSION_MISMATCH>();

if(l_versionsMismatch)
{
SBE_TRACF("main_sbe_handler(): We cannot switch SEEPROM sides if their versions do not match, exiting handler");
/*@
* @errortype ERRL_SEV_UNRECOVERABLE
* @moduleid SBEIO_EXTRACT_RC_HANDLER
* @reasoncode SBEIO_SEEPROM_VERSION_MISMATCH
* @userdata1 HUID of proc
* @userdata2 unused
* @devdesc Attempted to swap seeprom sides and
* boot using hreset but version mismatched
* @custdesc Processor Error
*/
l_errl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
SBEIO_EXTRACT_RC_HANDLER,
SBEIO_SEEPROM_VERSION_MISMATCH,
TARGETING::get_huid(i_target),0);
l_errl->collectTrace( "ISTEPS_TRACE", 256);
l_errl->collectTrace( SBEIO_COMP_NAME, 256);
l_errl->addHwCallout( i_target,
HWAS::SRCI_PRIORITY_HIGH,
HWAS::NO_DECONFIG,
HWAS::GARD_NULL );

// Set the PLID of the error log to master PLID
// if the master PLID is set
updatePlids(l_errl);

errlCommit(l_errl, SBEIO_COMP_ID);
// break out of the retry loop
break;
}
}
if(this->iv_switchSidesCount >= MAX_SWITCH_SIDE_COUNT)
{
/*@
Expand Down
16 changes: 16 additions & 0 deletions src/usr/targeting/common/xmltohb/attribute_types_hb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1128,4 +1128,20 @@
<writeable/>
</attribute>

<attribute>
<id>HB_SBE_SEEPROM_VERSION_MISMATCH</id>
<description>
Describes if the processor's SBE's seeprom versions match or not
0x0 = MATCH
0x1 = MISMATCH
</description>
<simpleType>
<uint8_t>
</uint8_t>
</simpleType>
<persistency>volatile-zeroed</persistency>
<readable/>
<writeable/>
</attribute>

</attributes>
3 changes: 3 additions & 0 deletions src/usr/targeting/common/xmltohb/target_types_hb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
<attribute>
<id>HBRT_HYP_ID</id>
</attribute>
<attribute>
<id>HB_SBE_SEEPROM_VERSION_MISMATCH</id>
</attribute>
</targetTypeExtension>

<targetTypeExtension>
Expand Down

0 comments on commit 3e3f1ab

Please sign in to comment.