From 261c874fb2ddb5bd80b92be56d0bf38c02ad5876 Mon Sep 17 00:00:00 2001 From: Christian Geddes Date: Tue, 24 Apr 2018 16:52:45 -0500 Subject: 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 Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Martin Gloff Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Daniel M. Crowell --- src/usr/targeting/runtime/start_rt.C | 62 +++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) (limited to 'src/usr/targeting/runtime') 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(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::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(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, -- cgit v1.2.1