Skip to content

Commit

Permalink
checkHbResMemLimit -- change to check correctly on multi-node
Browse files Browse the repository at this point in the history
checkHbResMemLimit function did not take HRMOR into account
when determining the LOWER and UPPER limits for hb reserved
memory section. This broke on a multi-node system. Changed
the function to take the HRMOR into account to pass on slave
nodes.

Change-Id: Ib16816ba8e7d9740f0ee402cdbc05531c4161362
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54272
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>
Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com>
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
Prachi Gupta authored and wghoffa committed Feb 19, 2018
1 parent f595ecf commit 5c78bbd
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/usr/runtime/populate_hbruntime.C
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,26 @@ void traceHbRsvMemRange(hdatMsVpdRhbAddrRange_t* & i_rngPtr )
errlHndl_t checkHbResMemLimit(const uint64_t i_addr, const uint64_t i_size)
{
errlHndl_t l_errl = nullptr;

//Get base HRMOR Base attribute
TARGETING::Target * pTgt = NULL;
TARGETING::targetService().getTopLevelTarget(pTgt);
assert(pTgt != NULL);
auto hrmor_base = pTgt->getAttr<TARGETING::ATTR_HB_HRMOR_NODAL_BASE>();

//get this hb instance
pTgt = NULL;
TARGETING::targetService().masterProcChipTargetHandle(pTgt);
auto epath = pTgt->getAttr<TARGETING::ATTR_PHYS_PATH>();
auto pe = epath.pathElementOfType(TARGETING::TYPE_NODE);
auto this_node = pe.instance;

auto hrmor = hrmor_base * this_node;
// Only check if PHYP is running or if running in standalone.
if(TARGETING::is_phyp_load() || TARGETING::is_no_load())
{
if((i_addr < HB_RES_MEM_LOWER_LIMIT) or
((i_addr + i_size - 1) > HB_RES_MEM_UPPER_LIMIT))
if((i_addr < (HB_RES_MEM_LOWER_LIMIT + hrmor)) or
((i_addr + i_size - 1) > (HB_RES_MEM_UPPER_LIMIT+hrmor)))
{
TRACFCOMP(g_trac_runtime, "checkHbResMemLimit> Attempt to write"
" to hostboot reserved memory outside of allowed hostboot address"
Expand Down

0 comments on commit 5c78bbd

Please sign in to comment.