Skip to content

Commit

Permalink
Dump collection should only be run on the master node and skipped on …
Browse files Browse the repository at this point in the history
…slaves.

Added an attribute, IS_MASTER_DRAWER, and a utility function,
isCurrentMasterNode().  The attribute is set in host_sys_fab_iovalid_processing
which is called during istep 18.9.  isCurrentMasterNode() is called by
call_host_mpipl_service() to ensure that memory dump collection is only
performed on the master node during a MPIPL.

Change-Id: I7fd48476c3cd7cf4697eafed6705d158a9c54dcf
RTC: 116089
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55162
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: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
rward15 authored and dcrowell77 committed Mar 22, 2018
1 parent bbe9dd4 commit a48f950
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 156 deletions.
16 changes: 15 additions & 1 deletion src/include/usr/targeting/targplatutil.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -184,6 +184,20 @@ inline bool isThisMasterNodeTarget(const Target* const i_pTarget)
return true;
}

/* @brief - returns whether the current node is the master node
*
* @par Detailed Description:
* Checks whether the current node is the master node. If yes, returns
* true to the user, else false. Master node is not determined until
* istep 18.9, so this function will return false before then except
* in the case of a MPIPL (second pass).
*
* @return boolean indicating whether request was successful or not
* @retval, Returns true if the current node is the master node
* @retval, Returns false if the current node is not the master node
*/
bool isCurrentMasterNode();

/* @brief - Syncs the master system target's attribute with non-master system
* targets.
*
Expand Down
288 changes: 150 additions & 138 deletions src/usr/isteps/istep14/call_host_mpipl_service.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@
#include <targeting/common/commontargeting.H>
#include <targeting/common/util.H>
#include <targeting/common/utilFilter.H>
#include <targeting/targplatutil.H>

#include <p9_mpipl_chip_cleanup.H>
#include <fapi2/plat_hwp_invoker.H>
#include <fapi2/plat_hwp_invoker.H>

#include <vfs/vfs.H>
#include <dump/dumpif.H>
Expand All @@ -58,191 +59,202 @@ void* call_host_mpipl_service (void *io_pArgs)

IStepError l_StepError;

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_mpipl_service entry" );

errlHndl_t l_err = NULL;
// call proc_mpipl_chip_cleanup.C
TARGETING::TargetHandleList l_procTargetList;
getAllChips(l_procTargetList, TYPE_PROC );
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_mpipl_service entry" );

// ---------------------------------------------------------------
// run proc_mpipl_chip_cleanup.C on all proc chips
// ---------------------------------------------------------------
for (const auto & l_pProcTarget : l_procTargetList)
if (!TARGETING::UTIL::isCurrentMasterNode())
{
// write HUID of target
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"target HUID %.8X", TARGETING::get_huid(l_pProcTarget));
"call_host_mpipl_service cannot run on slave node, skipping");
}
else
{
errlHndl_t l_err = NULL;
// call proc_mpipl_chip_cleanup.C
TARGETING::TargetHandleList l_procTargetList;
getAllChips(l_procTargetList, TYPE_PROC );

// ---------------------------------------------------------------
// run proc_mpipl_chip_cleanup.C on all proc chips
// ---------------------------------------------------------------
for (const auto & l_pProcTarget : l_procTargetList)
{
// write HUID of target
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"target HUID %.8X", TARGETING::get_huid(l_pProcTarget));

fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi_pProcTarget((const_cast<TARGETING::Target*> (l_pProcTarget)) );
fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi_pProcTarget((const_cast<TARGETING::Target*> (l_pProcTarget)) );

// call the HWP with each fapi::Target
FAPI_INVOKE_HWP(l_err, p9_mpipl_chip_cleanup, l_fapi_pProcTarget );
// call the HWP with each fapi::Target
FAPI_INVOKE_HWP(l_err, p9_mpipl_chip_cleanup, l_fapi_pProcTarget );

if ( l_err )
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from p9_mpipl_chip_cleanup" );
if ( l_err )
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from p9_mpipl_chip_cleanup" );

// capture the target data in the elog
ERRORLOG::ErrlUserDetailsTarget(l_pProcTarget).addToLog( l_err );
// capture the target data in the elog
ERRORLOG::ErrlUserDetailsTarget(l_pProcTarget).addToLog(l_err);

// since we are doing an mpipl break out, the mpipl has failed
break;
}
// since we are doing an mpipl break out, the mpipl has failed
break;
}

}
}

#ifdef CONFIG_DRTM

if(!l_err)
{
do {

bool drtmMpipl = false;
SECUREBOOT::DRTM::isDrtmMpipl(drtmMpipl);
if(drtmMpipl)
if(!l_err)
{
l_err = SECUREBOOT::DRTM::validateDrtmPayload();
if(l_err)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ERR_MRK
"call_host_mpipl_service: Failed in call to "
"validateDrtmPayload()");
break;
}
do {

l_err = SECUREBOOT::DRTM::completeDrtm();
if(l_err)
bool drtmMpipl = false;
SECUREBOOT::DRTM::isDrtmMpipl(drtmMpipl);
if(drtmMpipl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ERR_MRK
"call_host_mpipl_service: Failed in call to "
"completeDrtm()" );
break;
l_err = SECUREBOOT::DRTM::validateDrtmPayload();
if(l_err)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ERR_MRK
"call_host_mpipl_service: Failed in call to "
"validateDrtmPayload()");
break;
}

l_err = SECUREBOOT::DRTM::completeDrtm();
if(l_err)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ERR_MRK
"call_host_mpipl_service: Failed in call to "
"completeDrtm()" );
break;
}
}
}

} while(0);
}
} while(0);
}

#endif
// No error on the procedure.. proceed to collect the dump.
if (!l_err)
{

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"SUCCESS : proc_mpipl_ex_cleanup" );
// No error on the procedure.. proceed to collect the dump.
if (!l_err)
{

// currently according to Adriana, the dump calls should only cause an
// istep failure when the dump collect portion of this step fails.. We
// will not fail the istep on any mbox message failures. instead we will
// simply commit the errorlog and continue.
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"SUCCESS : proc_mpipl_ex_cleanup" );

errlHndl_t l_errMsg = NULL;
// currently according to Adriana, the dump calls should only cause
// an istep failure when the dump collect portion of this step
// fails.. We will not fail the istep on any mbox message failures.
// instead we will simply commit the errorlog and continue.

// Dump relies upon the runtime module
// Not declaring in istep DEP list cause if we load it
// we want it to stay loaded
if ( !VFS::module_is_loaded( "libruntime.so" ) )
{
l_err = VFS::module_load( "libruntime.so" );
errlHndl_t l_errMsg = NULL;

if ( l_err )
// Dump relies upon the runtime module
// Not declaring in istep DEP list cause if we load it
// we want it to stay loaded
if ( !VFS::module_is_loaded( "libruntime.so" ) )
{
// load module returned with errl set
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Could not load runtime module" );
l_err = VFS::module_load( "libruntime.so" );

if ( l_err )
{
// load module returned with errl set
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Could not load runtime module" );
}
}
}

// If dump module successfull loaded then continue with DumpCollect and
// messaging
if (!l_err)
{
do
// If dump module successfully loaded then continue with DumpCollect
// and messaging
if (!l_err)
{
// send the start message
l_errMsg = DUMP::sendMboxMsg(DUMP::DUMP_MSG_START_MSG_TYPE);

// If error, commit and send error message.
if (l_errMsg)
do
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
// send the start message
l_errMsg = DUMP::sendMboxMsg(DUMP::DUMP_MSG_START_MSG_TYPE);

// If error, commit and send error message.
if (l_errMsg)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from DUMP::sendMboxMsg - dump start" );

errlCommit( l_errMsg, HWPF_COMP_ID );
errlCommit( l_errMsg, HWPF_COMP_ID );

// don't break in this case because we not want to fail the
// istep on the dump collect so we will continue after we
// log the errhandle that we can't send a message.
}
// don't break in this case because we not want to fail
// the istep on the dump collect so we will continue
// after we log the errhandle that we can't send a
// message.
}

// Call the dump collect
l_err = DUMP::doDumpCollect();
// Call the dump collect
l_err = DUMP::doDumpCollect();

// Got a Dump Collect error.. Commit the dumpCollect
// errorlog and then send an dump Error mbox message
// and FSP will decide what to do.
// We do not want dump Collect failures to terminate the istep.
if (l_err)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from DUMP::HbDumpCopySrcToDest" );
// Got a Dump Collect error.. Commit the dumpCollect
// errorlog and then send an dump Error mbox message
// and FSP will decide what to do.
// We do not want dump Collect failures to terminate the
// istep.
if (l_err)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from DUMP::HbDumpCopySrcToDest");

break;
}
break;
}

} while(0);
} while(0);

DUMP::DUMP_MSG_TYPE msgType = DUMP::DUMP_MSG_END_MSG_TYPE;
DUMP::DUMP_MSG_TYPE msgType = DUMP::DUMP_MSG_END_MSG_TYPE;

// Send dumpCollect success trace
if (!l_err)
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"SUCCESS : doDumpCollect" );
}
// got an error that we need to send a ERROR message to FSP
// and commit the errorlog from dumpCollect.
else
{
msgType = DUMP::DUMP_MSG_ERROR_MSG_TYPE;
// Send dumpCollect success trace
if (!l_err)
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"SUCCESS : doDumpCollect" );
}
// got an error that we need to send a ERROR message to FSP
// and commit the errorlog from dumpCollect.
else
{
msgType = DUMP::DUMP_MSG_ERROR_MSG_TYPE;

// Commit the dumpCollect errorlog from above as
// we dont want dump collect to kill the istep
errlCommit( l_err, HWPF_COMP_ID );
// Commit the dumpCollect errorlog from above as
// we dont want dump collect to kill the istep
errlCommit( l_err, HWPF_COMP_ID );

}
}

// Send an Error mbox msg to FSP (either end or error)
l_errMsg = DUMP::sendMboxMsg(msgType);
// Send an Error mbox msg to FSP (either end or error)
l_errMsg = DUMP::sendMboxMsg(msgType);

if (l_errMsg)
if (l_errMsg)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from DUMP::sendMboxMsg" );

errlCommit( l_errMsg, HWPF_COMP_ID );
}

}
else
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from DUMP::sendMboxMsg" );

errlCommit( l_errMsg, HWPF_COMP_ID );
"ERROR : returned from VFS::module_load (libruntime.so)");
}

}
else
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from VFS::module_load (libruntime.so)" );
}
}

// If got an error in the procedure or collection of the dump kill the istep
if( l_err )
{
// Create IStep error log and cross reference to error that occurred
l_StepError.addErrorDetails( l_err );
// If got an error in the procedure or collection of the dump kill the
// istep
if( l_err )
{
// Create IStep error log and cross reference to error that occurred
l_StepError.addErrorDetails( l_err );

// Commit Error
errlCommit( l_err, HWPF_COMP_ID );
// Commit Error
errlCommit( l_err, HWPF_COMP_ID );
}
}

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
Expand Down
2 changes: 1 addition & 1 deletion src/usr/isteps/istep14/call_proc_htm_setup.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,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down

0 comments on commit a48f950

Please sign in to comment.