diff options
| author | Ilya Smirnov <ismirno@us.ibm.com> | 2018-07-24 13:25:28 -0500 |
|---|---|---|
| committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-09-05 13:10:50 -0500 |
| commit | fd77849e3981e7a6e463d35c748ecb53b6a5dd81 (patch) | |
| tree | 39673ae6c9c634fe80077e3a21bbbf044f20e4a5 /src/usr/targeting/runtime | |
| parent | 4bff76ae17a525ce3459361d72e09999e6b0a2d4 (diff) | |
| download | talos-hostboot-fd77849e3981e7a6e463d35c748ecb53b6a5dd81.tar.gz talos-hostboot-fd77849e3981e7a6e463d35c748ecb53b6a5dd81.zip | |
Port System and Node Targets Stitching Code
HBRT's targeting doesn't map the System target to its
nodes correctly because the target stitching code, that
already exists on FSP, is not present in HBRT. This change ports
the abovementioned code to HBRT, so that the system
and node targets are correctly associated to each other
at the end of targeting init. Note that unstitching is required
during MPIPL to break the links between sys <-> node because
only one node on which hb is running is visible during the boot.
Change-Id: I9731144c480b3357ff7b4aff02d13623a1119dac
CQ: SW432119
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65494
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-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 | 83 | ||||
| -rw-r--r-- | src/usr/targeting/runtime/start_rt.C | 16 |
2 files changed, 93 insertions, 6 deletions
diff --git a/src/usr/targeting/runtime/attrrp_rt.C b/src/usr/targeting/runtime/attrrp_rt.C index 33d759ad5..256e391c5 100644 --- a/src/usr/targeting/runtime/attrrp_rt.C +++ b/src/usr/targeting/runtime/attrrp_rt.C @@ -39,6 +39,9 @@ using namespace ERRORLOG; namespace TARGETING { + + const uint64_t MASK_OFF_UPPER_BYTE = 0x00FFFFFFFFFFFFFFULL; + errlHndl_t AttrRP::checkHbExistingImage(TargetingHeader* i_header, uint8_t i_instance, NODE_ID &io_maxNodeId) @@ -580,7 +583,9 @@ namespace TARGETING void* AttrRP::translateAddr(void* i_pAddress, const TARGETING::NODE_ID i_nodeId) { - void* l_address = i_pAddress; + void* l_address = reinterpret_cast<void*>( + reinterpret_cast<uint64_t>(i_pAddress) & + MASK_OFF_UPPER_BYTE); do { if (i_nodeId >= AttrRP::INVALID_NODE_ID) @@ -594,12 +599,12 @@ namespace TARGETING { if ((iv_nodeContainer[i_nodeId].pSections[i].vmmAddress + iv_nodeContainer[i_nodeId].pSections[i].size) >= - reinterpret_cast<uint64_t>(i_pAddress)) + reinterpret_cast<uint64_t>(l_address)) { 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); + iv_nodeContainer[i_nodeId].pSections[i].pnorAddress + + reinterpret_cast<uint64_t>(l_address) - + iv_nodeContainer[i_nodeId].pSections[i].vmmAddress); break; } } @@ -610,4 +615,72 @@ namespace TARGETING return l_address; } + + #ifdef __HOSTBOOT_RUNTIME + errlHndl_t AttrRP::convertPlatTargAddrToCommonAddr( + const Target* const i_pTarget, + uint64_t& o_rawAddr) const + { + errlHndl_t pError = nullptr; + AbstractPointer<void> rawAddr; + rawAddr.raw = 0; + + NODE_ID nodeId = TARGETING::INVALID_NODE; + getNodeId(i_pTarget,nodeId); + if(nodeId != TARGETING::INVALID_NODE) + { + AttrRP_Section* l_pSection = iv_nodeContainer[nodeId].pSections; + for(size_t l_sectionCnt = 0; + l_sectionCnt < iv_nodeContainer[nodeId].sectionCount; + ++l_sectionCnt, ++l_pSection) + { + if(l_pSection->type == SECTION_TYPE_PNOR_RO) + { + TargetingHeader* l_pHeader = static_cast<TargetingHeader*>( + iv_nodeContainer[nodeId].pTargetMap); + uint64_t l_addr = reinterpret_cast<uint64_t>(i_pTarget) - + l_pSection->pnorAddress + + l_pHeader->vmmBaseAddress.raw; + o_rawAddr = l_addr; + break; + } + } + } + else + { + TARG_ERR("Invalid node ID of nodeId = 0x%02X when " + "trying to convert platform target address of %p to a " + "common address", + nodeId, + i_pTarget); + /*@ + * @errortype + * @moduleid TARG_MOD_ATTRRP_TO_COMMON_ADDR + * @reasoncode TARG_RC_INVALID_NODE + * @userdata1 Target's HUID + * @userdata2 Node ID + * + * @devdesc Invalid Node ID was returned for the passed + * target + * @custdesc A problem occurred during the IPL of the + * system. + */ + pError = new ErrlEntry( + ERRL_SEV_UNRECOVERABLE, + TARG_MOD_ATTRRP_TO_COMMON_ADDR, + TARG_RC_INVALID_NODE, + TARGETING::get_huid(i_pTarget), + nodeId + ); + } + + rawAddr.raw = o_rawAddr; + // Node count starts with 1, so increment the node ID here. + rawAddr.TranslationEncoded.nodeId = ++nodeId; + // Update the address with the node ID. + o_rawAddr = rawAddr.raw; + + return pError; + } + #endif } diff --git a/src/usr/targeting/runtime/start_rt.C b/src/usr/targeting/runtime/start_rt.C index d3edf9cb3..90e3892be 100644 --- a/src/usr/targeting/runtime/start_rt.C +++ b/src/usr/targeting/runtime/start_rt.C @@ -24,6 +24,7 @@ /* IBM_PROLOG_END_TAG */ #include <targeting/common/commontargeting.H> #include <targeting/common/targetservice.H> +#include <targeting/common/associationmanager.H> #include <targeting/attrrp.H> #include <util/misc.H> #include <targeting/common/trace.H> @@ -48,12 +49,25 @@ namespace RT_TARG } TargetService& l_targetService = targetService(); - l_targetService.init(Singleton<AttrRP>::instance().getNodeCount()); + size_t l_numNodes = Singleton<AttrRP>::instance().getNodeCount(); + l_targetService.init(l_numNodes); adjustTargetingForRuntime(); // set global that TARG is ready Util::setIsTargetingLoaded(); + + if(l_numNodes > 1) + { + l_errl = TARGETING::AssociationManager::reconnectSyAndNodeTargets(); + if(l_errl) + { + TRACFCOMP(g_trac_targeting, "initTargeting: could not" + " reconnectSyAndNodeTargets"); + errlCommit(l_errl, TARG_COMP_ID); + assert(false, "Could not reconnect system and node targets"); + } + } } // Make any adjustments needed to targeting for runtime |

