Skip to content

Commit

Permalink
Support multiple nodes in HBRT - Sync System Attribute Data
Browse files Browse the repository at this point in the history
Make sure that HBRT keeps system attribute data in sync between the
targeting images for the different nodes on a multiple node system.

Change-Id: I84c0a92b0f9d9621d11aea474d0d87b215df886a
RTC: 186581
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55204
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>
CI-Ready: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mgloff authored and dcrowell77 committed Mar 30, 2018
1 parent 713f7f0 commit bca54fb
Showing 1 changed file with 61 additions and 1 deletion.
62 changes: 61 additions & 1 deletion src/usr/targeting/common/target.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -148,6 +148,17 @@ bool Target::_trySetAttr(
{
#define TARG_FN "_trySetAttr()"

#ifdef __HOSTBOOT_RUNTIME
// Get AttrRP pointer
AttrRP *l_attrRP = &TARG_GET_SINGLETON(theAttrRP);
// Get the node ID associated with the input target
NODE_ID l_nodeId = NODE0;
l_attrRP->getNodeId(this, l_nodeId);
bool isSysTarget = ((this->getAttr<ATTR_CLASS>() == CLASS_SYS) &&
(this->getAttr<ATTR_TYPE>() == TYPE_SYS))
? true : false;
#endif

// Figure out if effort should be expended figuring out the target's type/
// position in order to clear any non-const attribute overrides and/or to
// store the attribute for syncing to Cronus
Expand Down Expand Up @@ -202,6 +213,55 @@ bool Target::_trySetAttr(
if (l_pAttrData)
{
memcpy(l_pAttrData, i_pAttrData, i_size);
#ifdef __HOSTBOOT_RUNTIME
if(isSysTarget)
{
for(NODE_ID l_nodeX = NODE0;
l_nodeX < l_attrRP->getNodeCount();
++l_nodeX)
{
if(l_nodeX == l_nodeId)
{
// Already set attribute for this node, so continue to next
continue;
}

// Get target map pointer for the node
void* l_pMap = l_attrRP->getTargetMapPtr(l_nodeX);

// Get pointer to targets
Target (*l_pTargets)[] = reinterpret_cast<Target(*)[]>(l_pMap);

// Get pointer to number of targets
uint32_t *l_pNumTargets =
reinterpret_cast<uint32_t*>(l_pMap) - 1;

// Walk through targets
for(uint32_t l_targetNum = 0;
l_targetNum < *l_pNumTargets;
++l_targetNum)
{
Target* l_pTarget = &(*(l_pTargets))[l_targetNum];

// Check for system target
if((l_pTarget->getAttr<ATTR_CLASS>() == CLASS_SYS) &&
(l_pTarget->getAttr<ATTR_TYPE>() == TYPE_SYS))
{
// Get pointer to the attribute being set
void* l_pAttrDataNodeX = NULL;
l_pTarget->_getAttrPtr(i_attr, l_pAttrDataNodeX);
if (l_pAttrData)
{
// Set the attribute for this node
memcpy(l_pAttrDataNodeX, i_pAttrData, i_size);
}

break;
}
}
}
}
#endif
if( unlikely(cv_pCallbackFuncPtr != NULL) )
{
cv_pCallbackFuncPtr(this, i_attr, i_size, i_pAttrData);
Expand Down

0 comments on commit bca54fb

Please sign in to comment.