Skip to content

Commit 261c874

Browse files
crgeddesdcrowell77
authored andcommitted
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>
1 parent d2c360c commit 261c874

File tree

1 file changed

+58
-4
lines changed

1 file changed

+58
-4
lines changed

src/usr/targeting/runtime/start_rt.C

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ namespace RT_TARG
9595
bool l_hasPeer = l_target->tryGetAttr<ATTR_PEER_TARGET>(l_peer);
9696
if (l_hasPeer && (l_peer != nullptr))
9797
{
98-
TRACFCOMP(g_trac_targeting,
99-
"translate peer target for=%p %x",
100-
l_target, get_huid(l_target));
98+
TRACDCOMP(g_trac_targeting,
99+
"translate the peer target %p for HUID %x",
100+
l_peer, get_huid(l_target));
101101

102102
ATTR_PEER_TARGET_type l_xlated = (TARGETING::Target *)
103103
Singleton<AttrRP>::instance().
@@ -116,10 +116,64 @@ namespace RT_TARG
116116
else
117117
{
118118
TRACFCOMP(g_trac_targeting,
119-
"failed to translate peer target HUID=0x%x",
119+
"failed to translate peer target for HUID=0x%x",
120120
get_huid(l_target));
121121
}
122122
}
123+
else if(l_hasPeer && l_peer == nullptr)
124+
{
125+
TRACDCOMP(g_trac_targeting,
126+
"looking up peer path and target for HUID %x",
127+
get_huid(l_target));
128+
// Create variables entity path variable to write PEER_PATH into
129+
// as well as a Target pointer to set once we get the PEER_PATH
130+
TARGETING::EntityPath l_peerPath;
131+
TARGETING::Target * l_newTargPtr;
132+
133+
// Look up the PEER_PATH attribute if it exists on the target
134+
bool l_hasPeerPath = l_target->tryGetAttr<ATTR_PEER_PATH>(l_peerPath);
135+
136+
//If we find a PEER_PATH we need to next look up the PEER_TARGET
137+
if(l_hasPeerPath)
138+
{
139+
TRACDCOMP(g_trac_targeting,
140+
"Found peer path for HUID %x",get_huid(l_target));
141+
// Look up the PEER_TARGET based on what the PEER_PATH is
142+
l_newTargPtr = targetService().toTarget(l_peerPath);
143+
144+
bool l_fixed = false;
145+
146+
// If the pointer returned from toTarget isn't null then
147+
// we will try to set PEER_TARGET with that value
148+
if(l_newTargPtr != nullptr)
149+
{
150+
l_fixed = l_target->_trySetAttr(ATTR_PEER_TARGET,
151+
sizeof(l_newTargPtr),
152+
&l_newTargPtr);
153+
}
154+
155+
if (l_fixed)
156+
{
157+
TRACDCOMP(g_trac_targeting, "Peer target for HUID %x found to be %p",
158+
get_huid(l_target), l_newTargPtr);
159+
l_xlateCnt++;
160+
}
161+
// Not good if could not be fixed. But might not be
162+
// referenced. A segment fault will occur if used.
163+
else
164+
{
165+
TRACFCOMP(g_trac_targeting,
166+
"failed to find peer target for HUID=0x%x",
167+
get_huid(l_target));
168+
}
169+
}
170+
else
171+
{
172+
TRACFCOMP(g_trac_targeting,
173+
"Failed to find peer path for HUID=0x%x",
174+
get_huid(l_target));
175+
}
176+
}
123177
}
124178
}
125179
TRACFCOMP(g_trac_targeting,

0 commit comments

Comments
 (0)