Skip to content

Commit

Permalink
Enable mss_scrub on MPIPL if NVDIMM is configured
Browse files Browse the repository at this point in the history
NVDIMM restore blows away the scrub settings so it needs to be
reinitialized during MPIPL

Change-Id: I67f74c71e98b8907351eb7477bf197a941aefb8d
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71786
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: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: TSUNG K. YEUNG <tyeung@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Tsung Yeung authored and dcrowell77 committed Feb 19, 2019
1 parent cbc7571 commit 85e03b6
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 80 deletions.
13 changes: 5 additions & 8 deletions src/include/usr/diag/prdf/prdfMain_ipl.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* Contributors Listed Below - COPYRIGHT 2014,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -65,16 +65,13 @@ extern int32_t analyzeIplCEStats( const TARGETING::TargetHandle_t i_mba,
bool &o_calloutMade );

/**
* @brief Starts memory background scrubbing on all MBAs in the node.
*
* This will only start the initial fast scrub of all memory. PRD on the FSP or
* HostServices (SP-less machines) will need to resume normal background
* scrubbing once this initial fast scrub is complete.
*
* @brief Starts memory background scrubbing on the given target.
* @param i_trgt A target that contains the maintenance command logic (i.e.
* MCBIST or MBA).
* @return If an error log is returned, then some internal function failed. See
* the FFDC in the error log for failure details.
*/
extern errlHndl_t startScrub();
extern errlHndl_t startScrub( const TARGETING::TargetHandle_t i_trgt );

#ifdef CONFIG_ENABLE_CHECKSTOP_ANALYSIS

Expand Down
6 changes: 5 additions & 1 deletion src/include/usr/isteps/istep16list.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -141,7 +141,11 @@ namespace INITSERVICE
// Hostboot PRD should no longer be called after this step.
ISTEPNAME(16,04,"mss_scrub"),
ISTEP_16::call_mss_scrub,
#ifdef CONFIG_NVDIMM
{ START_FN, EXT_IMAGE, NORMAL_IPL_OP | MPIPL_OP, false }
#else
{ START_FN, EXT_IMAGE, NORMAL_IPL_OP, false }
#endif
},
{
ISTEPNAME(16,05,"host_load_io_ppe"),
Expand Down
1 change: 1 addition & 0 deletions src/include/usr/isteps/istep_reasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ namespace ISTEP
MOD_SMP_WRAP_PROC_IOVALID = 0x22,
MOD_APPLY_HCODE_GEN_CPU_REGS = 0x23,
MOD_GET_LANEMASK_FROM_HX_KEYWORD = 0x24,
MOD_MSS_SCRUB = 0x25,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/usr/diag/prdf/plat/mem/prdfMemBgScrub.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down
68 changes: 23 additions & 45 deletions src/usr/diag/prdf/prdfMain_ipl.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* Contributors Listed Below - COPYRIGHT 2014,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -40,10 +40,9 @@

// Platform includes
#include <prdfCenMbaDataBundle.H>
#include <prdfCenMbaDomain.H>
#include <prdfPlatServices.H>
#include <prdfP9McaDataBundle.H>
#include <prdfP9McbistDomain.H>
#include <prdfMemBgScrub.H>

// Custom compile configs
#include <config.h>
Expand Down Expand Up @@ -115,71 +114,48 @@ int32_t analyzeIplCEStats( TargetHandle_t i_trgt, bool &o_calloutMade )

//------------------------------------------------------------------------------

errlHndl_t startScrub()
errlHndl_t startScrub( const TargetHandle_t i_trgt )
{
#define PRDF_FUNC "[PRDF::startScrub] "
PRDF_ENTER( PRDF_FUNC );

errlHndl_t o_errl = nullptr;

int32_t l_rc = SUCCESS;
HUID nodeId = INVALID_HUID;

// will unlock when going out of scope
PRDF_SYSTEM_SCOPELOCK;

do
{
// Since the last refresh is in istep10 host_prd_hwreconfig,
// it may be good to call it again here at istep16 mss_scrub
// to remove any non-functional MBAs from PRD system model.
o_errl = noLock_refresh();
// This shouldn't return any error but if it does, break out
if( nullptr != o_errl )
// Get the PRD chip object.
ExtensibleChip * chip = (ExtensibleChip *)systemPtr->GetChip(i_trgt);
if ( nullptr == chip )
{
PRDF_ERR( PRDF_FUNC "noLock_refresh() failed" );
break;
}

// This is run in Hostboot so there should only be one node.
TargetHandleList list = getFunctionalTargetList( TYPE_NODE );
if ( 1 != list.size() )
{
PRDF_ERR( PRDF_FUNC "getFunctionalTargetList(TYPE_NODE) failed" );
PRDF_ERR( PRDF_FUNC "unable to find chip object for given target: "
"0x%08x", getHuid(i_trgt) );
l_rc = FAIL; break;
}
nodeId = getHuid(list[0]);

PRDF_ENTER( PRDF_FUNC "HUID=0x%08x", nodeId );

// Start background scrubbing.
TARGETING::MODEL procModel = getChipModel( getMasterProc() );
if ( MODEL_CUMULUS == procModel )
// Start background scrubbing on this target.
switch ( chip->getType() )
{
MbaDomain * domain = (MbaDomain *)systemPtr->GetDomain(MBA_DOMAIN);
l_rc = domain->startScrub();
case TYPE_MBA: startInitialBgScrub<TYPE_MBA>( chip); break;
case TYPE_MCBIST: startInitialBgScrub<TYPE_MCBIST>(chip); break;
default:
PRDF_ERR( PRDF_FUNC "Unsupported maintenance target type "
"0x%02x", chip->getType() );
l_rc = FAIL;
}
else if ( MODEL_NIMBUS == procModel )
{
McbistDomain * domain =
(McbistDomain *)systemPtr->GetDomain(MCBIST_DOMAIN);
l_rc = domain->startScrub();
}
else
{
PRDF_ERR(PRDF_FUNC "Master PROC model %d not supported", procModel);
PRDF_ASSERT(false);
}

PRDF_EXIT( PRDF_FUNC "HUID=0x%08x", nodeId );
if ( SUCCESS != l_rc ) break;

} while (0);

if (( SUCCESS != l_rc ) && (NULL == o_errl))
if ( SUCCESS != l_rc )
{
// Get user data
uint64_t ud12 = PRDF_GET_UINT64_FROM_UINT32( nodeId, __LINE__ );
uint64_t ud34 = PRDF_GET_UINT64_FROM_UINT32( 0, 0 );
uint64_t ud12 = PRDF_GET_UINT64_FROM_UINT32( getHuid(i_trgt), 0 );
uint64_t ud34 = PRDF_GET_UINT64_FROM_UINT32( 0, 0 );

// Create error log
o_errl = new ERRORLOG::ErrlEntry(
Expand All @@ -193,7 +169,9 @@ errlHndl_t startScrub()
HWAS::SRCI_PRIORITY_HIGH );

// Add traces
o_errl->collectTrace( PRDF_COMP_NAME, 512 );
o_errl->collectTrace( PRDF_COMP_NAME, 512 );
o_errl->collectTrace( FAPI_TRACE_NAME, 256 );
o_errl->collectTrace( FAPI_IMP_TRACE_NAME, 256 );
}

PRDF_EXIT( PRDF_FUNC );
Expand Down
112 changes: 87 additions & 25 deletions src/usr/isteps/istep16/call_mss_scrub.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -44,9 +44,11 @@ namespace ISTEP_16
{
void* call_mss_scrub (void *io_pArgs)
{
#define ISTEP_FUNC "call_mss_scrub: "

IStepError l_stepError;

TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_scrub entry" );
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, ISTEP_FUNC "entry" );

errlHndl_t errl = nullptr;

Expand All @@ -56,57 +58,117 @@ void* call_mss_scrub (void *io_pArgs)
{
// There are performance issues and some functional deficiencies
// that make background scrub problematic in SIMICs.
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Skipping background "
"scrub in SIMICs" );
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, ISTEP_FUNC
"Background scrubbing not supported in SIMICs" );
break;
}
else

TargetHandle_t sysTrgt = nullptr;
targetService().getTopLevelTarget( sysTrgt );

TargetHandle_t masterProc = nullptr;
targetService().masterProcChipTargetHandle( masterProc );

// Determine which target type runs the maintenance commands.
TARGETING::MODEL masterProcModel = masterProc->getAttr<ATTR_MODEL>();
TARGETING::TYPE maintTrgtType;
switch ( masterProcModel )
{
// Start background scrubbing.
errl = PRDF::startScrub();
case MODEL_CUMULUS: maintTrgtType = TYPE_MBA; break;
case MODEL_NIMBUS: maintTrgtType = TYPE_MCBIST; break;
default:
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, ISTEP_FUNC
"Master PROC model %d not supported",
masterProcModel );
/*@
* @errortype
* @moduleid ISTEP::MOD_MSS_SCRUB
* @reasoncode ISTEP::RC_INVALID_TARGET_TYPE
* @userdata1 Master processor model
* @userdata2 unused
* @devdesc The master processor model is unsupported.
* @custdesc A problem occurred during the IPL of the system.
*/
errl = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
ISTEP::MOD_MSS_SCRUB,
ISTEP::RC_INVALID_TARGET_TYPE,
masterProcModel, 0 );
}
if ( nullptr != errl ) break;

// Start background scrubbing on all targets of this maintenance type.
TargetHandleList maintList; getAllChiplets( maintList, maintTrgtType );
for ( auto & maintTrgt : maintList )
{
bool start = true; // initially true except for MP-IPL conditions.

#ifdef CONFIG_NVDIMM
// During MP-IPLs, We only want to start background scrubbing on
// maintenance targets that have connected NVDIMMs.
if ( sysTrgt->getAttr<ATTR_IS_MPIPL_HB>() )
{
start = false; // Only true if there is an NVDIMM.

// Find at least one DIMM behind this MCBIST that is an NVDIMM.
TargetHandleList dimmList;
getChildAffinityTargets( dimmList, maintTrgt, CLASS_NA,
TYPE_DIMM );
for ( auto & dimmTrgt : dimmList )
{
start = isNVDIMM(dimmTrgt);
if ( start ) break;
}
}
#endif
// Continue to the next target if we are unable to start background
// scrubbing on this target.
if ( !start ) continue;

// Start the command on this target.
errl = PRDF::startScrub( maintTrgt );
if ( nullptr != errl )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"PRDF::startScrub() failed" );
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, ISTEP_FUNC
"PRDF::startScrub(0x%08x) failed",
get_huid(maintTrgt) );
break;
}
}

// Nimbus chips require us to unmask some additional FIR bits. Note that
// this is not needed on Cumulus based systems because this is already
// contained within the other Centaur HWPs.
TargetHandle_t masterProc = nullptr;
targetService().masterProcChipTargetHandle(masterProc);
if ( MODEL_NIMBUS == masterProc->getAttr<ATTR_MODEL>() )
{
TargetHandleList trgtList; getAllChiplets( trgtList, TYPE_MCBIST );

for ( auto & tt : trgtList )
// Nimbus chips require us to unmask some additional FIR bits. Note
// that this is not needed on Cumulus based systems because this is
// already contained within the other Centaur HWPs.
if ( TYPE_MCBIST == maintTrgtType )
{
fapi2::Target<fapi2::TARGET_TYPE_MCBIST> ft ( tt );
fapi2::Target<fapi2::TARGET_TYPE_MCBIST> ft ( maintTrgt );

FAPI_INVOKE_HWP( errl, mss::unmask::after_background_scrub, ft);
if ( nullptr != errl )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, ISTEP_FUNC
"mss::unmask::after_background_scrub(0x%08x) "
"failed", get_huid(tt) );
"failed", get_huid(maintTrgt) );
break;
}
}
if ( nullptr != errl ) break;
}
if ( nullptr != errl ) break;

} while (0);

if ( nullptr != errl )
{
l_stepError.addErrorDetails( errl );
errl->collectTrace( "ISTEPS_TRACE", 256 );
errlCommit( errl, HWPF_COMP_ID );
}

TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_scrub exit" );
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, ISTEP_FUNC "exit" );

// end task, returning any errorlogs to IStepDisp
return l_stepError.getErrorHandle();

#undef ISTEP_FUNC
}

};

0 comments on commit 85e03b6

Please sign in to comment.