diff options
author | Christian Geddes <crgeddes@us.ibm.com> | 2018-04-24 16:52:45 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-05-07 16:25:20 -0400 |
commit | 261c874fb2ddb5bd80b92be56d0bf38c02ad5876 (patch) | |
tree | 85c5ec0dd8e2e0705138dca46f1ffbe51a54cda8 /src/usr/targeting/runtime | |
parent | d2c360c9db83212d73b03f744635c5e8f611f0f9 (diff) | |
download | talos-hostboot-261c874fb2ddb5bd80b92be56d0bf38c02ad5876.tar.gz talos-hostboot-261c874fb2ddb5bd80b92be56d0bf38c02ad5876.zip |
Update targeting init during RT to set PEER_TARGET on OBUS targets
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>
Diffstat (limited to 'src/usr/targeting/runtime')
-rw-r--r-- | src/usr/targeting/runtime/start_rt.C | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/src/usr/targeting/runtime/start_rt.C b/src/usr/targeting/runtime/start_rt.C index a60180fd9..ea99db972 100644 --- a/src/usr/targeting/runtime/start_rt.C +++ b/src/usr/targeting/runtime/start_rt.C @@ -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(). @@ -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, |