diff options
| author | Prachi Gupta <pragupta@us.ibm.com> | 2018-03-02 13:27:37 -0600 |
|---|---|---|
| committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-03-07 16:50:29 -0500 |
| commit | fdbf7156982e6b32facd6e30b7e84475e47f1392 (patch) | |
| tree | 0955b0d6774b3d50d7ee0958dcf86da9c7d6cd5a /src/usr/targeting/runtime | |
| parent | d9cde7352d62d66ac7331f1506febf77206192ab (diff) | |
| download | blackbird-hostboot-fdbf7156982e6b32facd6e30b7e84475e47f1392.tar.gz blackbird-hostboot-fdbf7156982e6b32facd6e30b7e84475e47f1392.zip | |
HBRT: Fix targeting to work on multi-node
- Set MULTINODE_AWARE to true for HBRT so
our targeting iterators jump over nodes
when iterating over targets
- Add error checking when invalid node id
is passed in
Change-Id: I7cf4c7ff4bf06fd637935aeb9152f432dc9c0fde
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55146
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@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>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/runtime')
| -rw-r--r-- | src/usr/targeting/runtime/attrrp_rt.C | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/src/usr/targeting/runtime/attrrp_rt.C b/src/usr/targeting/runtime/attrrp_rt.C index f8d6ed9e2..0c384ab11 100644 --- a/src/usr/targeting/runtime/attrrp_rt.C +++ b/src/usr/targeting/runtime/attrrp_rt.C @@ -488,8 +488,7 @@ namespace TARGETING #undef TARG_FN } - void AttrRP::getNodeId(const Target* i_pTarget, - NODE_ID& o_nodeId) const + void AttrRP::getNodeId(const Target* i_pTarget, NODE_ID& o_nodeId) const { #define TARG_FN "getNodeId" @@ -526,58 +525,54 @@ namespace TARGETING break; } } + #undef TARG_FN } void* AttrRP::translateAddr(void* i_pAddress, const Target* i_pTarget) { - #define TARG_FN "translateAddr(..., Target*)" -// TARG_ENTER(); // Disabled due to number of traces created - - NODE_ID l_nodeId = NODE0; - + void* o_pTransAddr = nullptr; if(i_pTarget != NULL) { + NODE_ID l_nodeId = NODE0; getNodeId(i_pTarget, l_nodeId); + o_pTransAddr = translateAddr(i_pAddress, l_nodeId); } - - void* l_address = translateAddr(i_pAddress, l_nodeId); - -// TARG_EXIT(); // Disabled due to number of traces created - #undef TARG_FN - - return l_address; + return o_pTransAddr; } void* AttrRP::translateAddr(void* i_pAddress, const TARGETING::NODE_ID i_nodeId) { - #define TARG_FN "translateAddr(..., NODE_ID)" -// TARG_ENTER(); // Disabled due to number of traces created - - void* l_address = NULL; - - for (size_t i = 0; i < iv_nodeContainer[i_nodeId].sectionCount; ++i) + void* l_address = nullptr; + do { - if ((iv_nodeContainer[i_nodeId].pSections[i].vmmAddress + - iv_nodeContainer[i_nodeId].pSections[i].size) >= - reinterpret_cast<uint64_t>(i_pAddress)) + if (i_nodeId >= AttrRP::INVALID_NODE_ID) { - l_address = reinterpret_cast<void*>( - iv_nodeContainer[i_nodeId].pSections[i].pnorAddress + - reinterpret_cast<uint64_t>(i_pAddress) - - iv_nodeContainer[i_nodeId].pSections[i].vmmAddress); + TRACFCOMP(g_trac_targeting, "ERROR: invalid nodeid=%d" + " passed to translateAddr", i_nodeId); break; } - } + + for (size_t i = 0; i < iv_nodeContainer[i_nodeId].sectionCount; ++i) + { + if ((iv_nodeContainer[i_nodeId].pSections[i].vmmAddress + + iv_nodeContainer[i_nodeId].pSections[i].size) >= + reinterpret_cast<uint64_t>(i_pAddress)) + { + l_address = reinterpret_cast<void*>( + iv_nodeContainer[i_nodeId].pSections[i].pnorAddress + + reinterpret_cast<uint64_t>(i_pAddress) - + iv_nodeContainer[i_nodeId].pSections[i].vmmAddress); + break; + } + } + } while (0); TRACDCOMP(g_trac_targeting, "Translated 0x%p to 0x%p", i_pAddress, l_address); -// TARG_EXIT(); // Disabled due to number of traces created - #undef TARG_FN - return l_address; } } |

