From 5c78bbd873e90210f862d863bca63f94ed169cc8 Mon Sep 17 00:00:00 2001 From: Prachi Gupta Date: Fri, 16 Feb 2018 15:58:53 -0600 Subject: checkHbResMemLimit -- change to check correctly on multi-node 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 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: ILYA SMIRNOV Reviewed-by: Richard J. Knight Reviewed-by: William G. Hoffa --- src/usr/runtime/populate_hbruntime.C | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C index d2e0e42ef..ae31ea9b0 100644 --- a/src/usr/runtime/populate_hbruntime.C +++ b/src/usr/runtime/populate_hbruntime.C @@ -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(); + + //get this hb instance + pTgt = NULL; + TARGETING::targetService().masterProcChipTargetHandle(pTgt); + auto epath = pTgt->getAttr(); + 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" -- cgit v1.2.1