Skip to content

Commit

Permalink
Update targeting init during RT to set PEER_TARGET on OBUS targets
Browse files Browse the repository at this point in the history
During IPL time hostboot does not know about OBUS targets on other
processors. Because of this we cannot set the PEER_TARGET attribute
on the OBUS targets because we don't know about their peers. During
HBRT however, we do know this information. In this commit support is
added to look at the attribute PEER_PATH for targets whose PEER_TARGET
attribute is null. This will allow use to target and OBUS's peer
during HBRT.

Change-Id: I249bc8c60297eedb7282ecc8dc717973e81e5cc3
CQ: SW425530
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57782
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: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed May 7, 2018
1 parent d2c360c commit 261c874
Showing 1 changed file with 58 additions and 4 deletions.
62 changes: 58 additions & 4 deletions src/usr/targeting/runtime/start_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ namespace RT_TARG
bool l_hasPeer = l_target->tryGetAttr<ATTR_PEER_TARGET>(l_peer);
if (l_hasPeer && (l_peer != nullptr))
{
TRACFCOMP(g_trac_targeting,
"translate peer target for=%p %x",
l_target, get_huid(l_target));
TRACDCOMP(g_trac_targeting,
"translate the peer target %p for HUID %x",
l_peer, get_huid(l_target));

ATTR_PEER_TARGET_type l_xlated = (TARGETING::Target *)
Singleton<AttrRP>::instance().
Expand All @@ -116,10 +116,64 @@ namespace RT_TARG
else
{
TRACFCOMP(g_trac_targeting,
"failed to translate peer target HUID=0x%x",
"failed to translate peer target for HUID=0x%x",
get_huid(l_target));
}
}
else if(l_hasPeer && l_peer == nullptr)
{
TRACDCOMP(g_trac_targeting,
"looking up peer path and target for HUID %x",
get_huid(l_target));
// Create variables entity path variable to write PEER_PATH into
// as well as a Target pointer to set once we get the PEER_PATH
TARGETING::EntityPath l_peerPath;
TARGETING::Target * l_newTargPtr;

// Look up the PEER_PATH attribute if it exists on the target
bool l_hasPeerPath = l_target->tryGetAttr<ATTR_PEER_PATH>(l_peerPath);

//If we find a PEER_PATH we need to next look up the PEER_TARGET
if(l_hasPeerPath)
{
TRACDCOMP(g_trac_targeting,
"Found peer path for HUID %x",get_huid(l_target));
// Look up the PEER_TARGET based on what the PEER_PATH is
l_newTargPtr = targetService().toTarget(l_peerPath);

bool l_fixed = false;

// If the pointer returned from toTarget isn't null then
// we will try to set PEER_TARGET with that value
if(l_newTargPtr != nullptr)
{
l_fixed = l_target->_trySetAttr(ATTR_PEER_TARGET,
sizeof(l_newTargPtr),
&l_newTargPtr);
}

if (l_fixed)
{
TRACDCOMP(g_trac_targeting, "Peer target for HUID %x found to be %p",
get_huid(l_target), l_newTargPtr);
l_xlateCnt++;
}
// Not good if could not be fixed. But might not be
// referenced. A segment fault will occur if used.
else
{
TRACFCOMP(g_trac_targeting,
"failed to find peer target for HUID=0x%x",
get_huid(l_target));
}
}
else
{
TRACFCOMP(g_trac_targeting,
"Failed to find peer path for HUID=0x%x",
get_huid(l_target));
}
}
}
}
TRACFCOMP(g_trac_targeting,
Expand Down

0 comments on commit 261c874

Please sign in to comment.