Skip to content

Commit

Permalink
Use Attr to Save/Fetch MDRT Count
Browse files Browse the repository at this point in the history
MDRT count is saved out into an attribute in istep14 and the same
is fetched out in istep21 for Phyp as well as Opal(ZZ-L) system.

Added libruntime.so to istep14, Since Dump relies upon runtime module

Moved 'useRelocatedPayloadAddr' setting to call_host_mpipl_service(),
So that we have everything set before calling doDumpCollect()

Change-Id: I5d30135d86a1477a68509aaff0516efb4d620410
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/58636
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: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Raja Das authored and dcrowell77 committed Jul 20, 2018
1 parent 7f37a07 commit 529bf93
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 81 deletions.
1 change: 1 addition & 0 deletions src/include/usr/isteps/istep14list.H
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ const DepModInfo g_istep14Dependancies = {
{
DEP_LIB(libistep14.so),
DEP_LIB(libdump.so),
DEP_LIB(libruntime.so),
DEP_LIB(libisteps_mss.so),
DEP_LIB(libpm.so),
DEP_LIB(libimageprocs.so),
Expand Down
13 changes: 6 additions & 7 deletions src/usr/dump/dumpCollect.C
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ namespace DUMP
errlHndl_t doDumpCollect(void)
{
TRACFCOMP(g_trac_dump, "doDumpCollect - start ");

// Use relocated payload base to get MDST, MDDT, MDRT details
RUNTIME::useRelocatedPayloadAddr(true);

errlHndl_t l_err = NULL;

// Table Sizes
Expand Down Expand Up @@ -103,8 +99,6 @@ errlHndl_t doDumpCollect(void)

}while (0);

RUNTIME::useRelocatedPayloadAddr(false);

return (l_err);
}

Expand Down Expand Up @@ -608,11 +602,16 @@ errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
break;
}

// Update the MDRT Count to Attribute to be fetched in istep 21
TARGETING::TargetService& l_targetService = TARGETING::targetService();
TARGETING::Target* l_sys = NULL;
l_targetService.getTopLevelTarget(l_sys);
l_sys->setAttr<TARGETING::ATTR_MPIPL_HB_MDRT_COUNT>(l_resultCount);

//Update actual count in RUNTIME
RUNTIME::saveActualCount(RUNTIME::MS_DUMP_RESULTS_TBL,
l_resultCount);


//Write actual count into memory as well
// We know this will get whacked when FSP reloads the PHYP
// lid, but we want it to be valid before that to allow
Expand Down
131 changes: 57 additions & 74 deletions src/usr/isteps/istep14/call_host_mpipl_service.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <targeting/common/utilFilter.H>
#include <targeting/targplatutil.H>

#include <runtime/runtime.H>

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

Expand Down Expand Up @@ -150,99 +152,80 @@ void* call_host_mpipl_service (void *io_pArgs)

errlHndl_t l_errMsg = NULL;

// 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" );

if ( l_err )
{
// load module returned with errl set
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Could not load runtime module" );
}
}
// Use relocated payload base to get MDST, MDDT, MDRT details
RUNTIME::useRelocatedPayloadAddr(true);

// If dump module successfully loaded then continue with DumpCollect
// and messaging
if (!l_err)
do
{
do
{
// 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 );
// send the start message
l_errMsg = DUMP::sendMboxMsg(DUMP::DUMP_MSG_START_MSG_TYPE);

// 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();

// 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;
}

} while(0);

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
// If error, commit and send error message.
if (l_errMsg)
{
msgType = DUMP::DUMP_MSG_ERROR_MSG_TYPE;
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from DUMP::sendMboxMsg - dump start" );

// Commit the dumpCollect errorlog from above as
// we dont want dump collect to kill the istep
errlCommit( l_err, 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.
}

// Send an Error mbox msg to FSP (either end or error)
l_errMsg = DUMP::sendMboxMsg(msgType);
// Call the dump collect
l_err = DUMP::doDumpCollect();

if (l_errMsg)
// 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::sendMboxMsg" );
"ERROR : returned from DUMP::HbDumpCopySrcToDest");

errlCommit( l_errMsg, HWPF_COMP_ID );
break;
}

} while(0);

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;

// 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);

if (l_errMsg)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : returned from VFS::module_load (libruntime.so)");
"ERROR : returned from DUMP::sendMboxMsg" );

errlCommit( l_errMsg, HWPF_COMP_ID );
}

RUNTIME::useRelocatedPayloadAddr(false);
// Wipe out our cache of the NACA/SPIRA pointers
RUNTIME::rediscover_hdat();
}

// If got an error in the procedure or collection of the dump kill the
Expand Down
12 changes: 12 additions & 0 deletions src/usr/isteps/istep21/call_host_runtime_setup.C
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,18 @@ void* call_host_runtime_setup (void *io_pArgs)
break;
}
}

// Update the MDRT Count from Attribute
TargetService& l_targetService = targetService();
Target* l_sys = nullptr;
l_targetService.getTopLevelTarget(l_sys);
if(l_sys->getAttr<ATTR_IS_MPIPL_HB>())
{
uint32_t l_mdrtCount =
l_sys->getAttr<TARGETING::ATTR_MPIPL_HB_MDRT_COUNT>();
//Update actual count in RUNTIME
RUNTIME::saveActualCount(RUNTIME::MS_DUMP_RESULTS_TBL, l_mdrtCount);
}

//Update the MDRT value (for MS Dump)
l_err = RUNTIME::writeActualCount(RUNTIME::MS_DUMP_RESULTS_TBL);
Expand Down
14 changes: 14 additions & 0 deletions src/usr/targeting/common/xmltohb/attribute_types_hb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@
<hbOnly/>
</attribute>

<attribute>
<id>MPIPL_HB_MDRT_COUNT</id>
<description>Actual MDRT count in Memory Preserving IPL mode.</description>
<simpleType>
<uint32_t>
<default>0</default>
</uint32_t>
</simpleType>
<persistency>volatile-zeroed</persistency>
<readable/>
<writeable/>
<hbOnly/>
</attribute>

<attribute>
<id>IS_SLAVE_DRAWER</id>
<description>0 = is master node, 1 = is slave node</description>
Expand Down
1 change: 1 addition & 0 deletions src/usr/targeting/common/xmltohb/target_types_hb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<targetTypeExtension>
<id>sys-sys-power9</id>
<attribute><id>IS_MPIPL_HB</id></attribute>
<attribute><id>MPIPL_HB_MDRT_COUNT</id></attribute>
<attribute><id>IBSCOM_ENABLE_OVERRIDE</id></attribute>
<attribute><id>HB_MUTEX_TEST_LOCK</id></attribute>
<attribute><id>HB_EXISTING_IMAGE</id></attribute>
Expand Down

0 comments on commit 529bf93

Please sign in to comment.