summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2018-05-31 16:31:01 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-06-06 13:59:44 -0400
commit27bf395be2cd9025abc1a48ad74a0b3bc5da97f8 (patch)
tree29bb599328e3ab98e1e105a285c9f213cf040871 /src/usr/targeting
parent1db54dcc27d4061114c9466ec5fb72121420c5eb (diff)
downloadtalos-hostboot-27bf395be2cd9025abc1a48ad74a0b3bc5da97f8.tar.gz
talos-hostboot-27bf395be2cd9025abc1a48ad74a0b3bc5da97f8.zip
missing memory: istep 7 and 14 changes
There are two cases where hostboot's attention is required in istep7: - If HRMOR we booted with doesn't fall in the range of proc_mem_to_use's memory, then the SBE is old. HB will do an sbe update and request re-ipl - If HB deconfigured a bunch of dimms in istep7 and ran out of memory, then we will request a reconfig loop Then, in istep14, we added another sanity check to make sure we have memory as expected to prevent unexpected failure after exiting cache contained mode. Change-Id: I018f4ce862cc79b5d7bacbe01cc28d1d2b4fc788 CQ:SW430015 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59696 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> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting')
-rw-r--r--src/usr/targeting/common/util.C92
1 files changed, 58 insertions, 34 deletions
diff --git a/src/usr/targeting/common/util.C b/src/usr/targeting/common/util.C
index c1be41203..26b63966e 100644
--- a/src/usr/targeting/common/util.C
+++ b/src/usr/targeting/common/util.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -36,6 +36,7 @@
#include <targeting/common/attributes.H>
#include <targeting/common/targetservice.H>
#include <targeting/common/utilFilter.H>
+#include <targeting/common/trace.H>
namespace TARGETING
{
@@ -216,24 +217,36 @@ uint64_t get_top_mem_addr(void)
for ( size_t proc = 0; proc < l_cpuTargetList.size(); proc++ )
{
TARGETING::Target * l_pProc = l_cpuTargetList[proc];
+ top_addr = std::max(top_addr,get_top_mem_addr(l_pProc));
+ }
- //Not checking success here as fail results in no change to
- // top_addr
- uint64_t l_mem_bases[8] = {0,};
- uint64_t l_mem_sizes[8] = {0,};
- l_pProc->tryGetAttr<TARGETING::ATTR_PROC_MEM_BASES>(l_mem_bases);
- l_pProc->tryGetAttr<TARGETING::ATTR_PROC_MEM_SIZES>(l_mem_sizes);
+ } while(0);
- for (size_t i=0; i< 8; i++)
- {
- if(l_mem_sizes[i]) //non zero means that there is memory present
- {
- top_addr = std::max(top_addr,
- l_mem_bases[i] + l_mem_sizes[i]);
- }
- }
+ return top_addr;
+}
+
+/**
+ * @brief Utility function to obtain the highest known address in a given proc
+ */
+uint64_t get_top_mem_addr(TargetHandle_t i_proc)
+{
+ uint64_t top_addr = 0;
+
+ //Not checking success here as fail results in no change to
+ // top_addr
+ uint64_t l_mem_bases[8] = {0,};
+ uint64_t l_mem_sizes[8] = {0,};
+ i_proc->tryGetAttr<TARGETING::ATTR_PROC_MEM_BASES>(l_mem_bases);
+ i_proc->tryGetAttr<TARGETING::ATTR_PROC_MEM_SIZES>(l_mem_sizes);
+
+ for (size_t i=0; i< 8; i++)
+ {
+ if(l_mem_sizes[i]) //non zero means that there is memory present
+ {
+ top_addr = std::max(top_addr,
+ l_mem_bases[i] + l_mem_sizes[i]);
}
- }while(0);
+ }
return top_addr;
}
@@ -254,24 +267,7 @@ uint64_t get_bottom_mem_addr(void)
for ( size_t proc = 0; proc < l_cpuTargetList.size(); proc++ )
{
TARGETING::Target * l_pProc = l_cpuTargetList[proc];
-
- uint64_t l_mem_bases[8] = {};
- uint64_t l_mem_sizes[8] = {};
- TARG_ASSERT(
- l_pProc->tryGetAttr<TARGETING::ATTR_PROC_MEM_BASES>(l_mem_bases),
- "Unable to get ATTR_PROC_MEM_BASES attribute");
-
- TARG_ASSERT(
- l_pProc->tryGetAttr<TARGETING::ATTR_PROC_MEM_SIZES>(l_mem_sizes),
- "Unable to get ATTR_PROC_MEM_SIZES attribute");
-
- for (size_t i=0; i< 8; i++)
- {
- if(l_mem_sizes[i]) //non zero means that there is memory present
- {
- bottom_addr = std::min(bottom_addr, l_mem_bases[i]);
- }
- }
+ bottom_addr = std::min(bottom_addr, get_bottom_mem_addr(l_pProc));
}
}while(0);
@@ -285,6 +281,34 @@ uint64_t get_bottom_mem_addr(void)
}
+/**
+ * @brief Utility function to obtain the lowest known address in a given proc
+ */
+uint64_t get_bottom_mem_addr(TargetHandle_t i_proc)
+{
+ uint64_t bottom_addr = UINT64_MAX;
+
+ uint64_t l_mem_bases[8] = {};
+ uint64_t l_mem_sizes[8] = {};
+ TARG_ASSERT(
+ i_proc->tryGetAttr<TARGETING::ATTR_PROC_MEM_BASES>(l_mem_bases),
+ "Unable to get ATTR_PROC_MEM_BASES attribute");
+
+ TARG_ASSERT(
+ i_proc->tryGetAttr<TARGETING::ATTR_PROC_MEM_SIZES>(l_mem_sizes),
+ "Unable to get ATTR_PROC_MEM_SIZES attribute");
+
+ for (size_t i=0; i< 8; i++)
+ {
+ if(l_mem_sizes[i]) //non zero means that there is memory present
+ {
+ bottom_addr = std::min(bottom_addr, l_mem_bases[i]);
+ }
+ }
+
+ return bottom_addr;
+}
+
bool orderByNodeAndPosition( Target* i_firstProc,
Target* i_secondProc)
{
OpenPOWER on IntegriCloud