summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffa <wghoffa@us.ibm.com>2018-07-03 17:11:11 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-07-06 11:19:56 -0400
commitea5c84fe7741f94fb1198483f9e833fcaae202e5 (patch)
treefc3db09ba284c84896c9f98cc91d2c6a02734ab2
parent34e69d280e11d8a1ac8fcc89add6470e0cc058d4 (diff)
downloadtalos-hostboot-ea5c84fe7741f94fb1198483f9e833fcaae202e5.tar.gz
talos-hostboot-ea5c84fe7741f94fb1198483f9e833fcaae202e5.zip
Use PROC_MIRROR_BASES_ACK attribute in memory mirroring addr calculation
- There was a situation where the memory behind a proc was valid, but there was no valid mirrored memory - Using PROC_MIRROR_BASES_ACK in the address calculation fixes that problem Change-Id: Id7a134300f728d28cffeb62d9440c2301536d9ea CQ: SW436374 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61834 Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> 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: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61925
-rw-r--r--src/usr/isteps/istep14/call_proc_exit_cache_contained.C67
1 files changed, 61 insertions, 6 deletions
diff --git a/src/usr/isteps/istep14/call_proc_exit_cache_contained.C b/src/usr/isteps/istep14/call_proc_exit_cache_contained.C
index 7b5e86d46..a5cc132c1 100644
--- a/src/usr/isteps/istep14/call_proc_exit_cache_contained.C
+++ b/src/usr/isteps/istep14/call_proc_exit_cache_contained.C
@@ -212,13 +212,68 @@ void* call_proc_exit_cache_contained (void *io_pArgs)
ATTR_MIRROR_BASE_ADDRESS_type l_mirrorBaseAddr = 0;
if(!is_sapphire_load())
{
- //First get the Base Memory Mirroring Address
- l_mirrorBaseAddr =
- l_sys->getAttr<TARGETING::ATTR_MIRROR_BASE_ADDRESS>();
+ //Get all the proc chips
+ TARGETING::TargetHandleList l_cpuTargetList;
+ getAllChips(l_cpuTargetList, TYPE_PROC);
+
+ //Iterate through the proc chips, finding the smallest valid
+ // mirrored memory address
+ uint64_t l_mirrorSmallestAddr = 0;
+ for (const auto & l_cpu_target: l_cpuTargetList)
+ {
+ //Get the acknowledged memory mirror sizes attribute
+ // If this is 0, we should not consider this mirror region
+ uint64_t mirrorSizesAck[sizeof(fapi2::ATTR_PROC_MIRROR_SIZES_ACK_Type)/sizeof(uint64_t)];
+ bool rc = (l_cpu_target)->
+ tryGetAttr<TARGETING::ATTR_PROC_MIRROR_SIZES_ACK>(mirrorSizesAck);
+ if(false == rc)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Failed to get ATTR_PROC_MIRROR_SIZES_ACK");
+ assert(0);
+ }
+
+ //Get the acknowledged memory mirror bases attribute
+ uint64_t mirrorBasesAck[sizeof(fapi2::ATTR_PROC_MIRROR_BASES_ACK_Type)/sizeof(uint64_t)];
+ rc = (l_cpu_target)->
+ tryGetAttr<TARGETING::ATTR_PROC_MIRROR_BASES_ACK>(mirrorBasesAck);
+ if(false == rc)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Failed to get ATTR_PROC_MIRROR_BASES_ACK");
+ assert(0);
+ }
+
+ assert ((sizeof(fapi2::ATTR_PROC_MIRROR_SIZES_ACK_Type) ==
+ sizeof(fapi2::ATTR_PROC_MIRROR_BASES_ACK_Type)),
+ "sizeof(ATTRPROC_MIRROR_SIZES_ACK) != sizeof(ATTR_PROC_MIRROR_BASES_ACK)");
- //Add on the current HRMOR value being used
- l_mirrorBaseAddr += (cpu_spr_value(CPU_SPR_HRMOR)
- - VMM_HRMOR_OFFSET);
+ //Loop through each mirror region looking for the lowest
+ // valid memory value
+ for (uint8_t i=0;
+ i < sizeof(fapi2::ATTR_PROC_MIRROR_BASES_ACK_Type)/sizeof(uint64_t);
+ i++)
+ {
+ if (mirrorSizesAck[i] == 0)
+ {
+ //Mirrored memory region has a size of 0, do not consider
+ continue;
+ }
+
+ //Save the smallest address for later use
+ if (l_mirrorSmallestAddr == 0)
+ {
+ l_mirrorSmallestAddr = mirrorBasesAck[i];
+ }
+ else if (mirrorBasesAck[i] < l_mirrorBaseAddr &&
+ mirrorBasesAck[i] != 0)
+ {
+ l_mirrorSmallestAddr = mirrorBasesAck[i];
+ }
+ }
+ }
+ //Set the mirrored addr to the lowest valid memory value found
+ l_mirrorBaseAddr = l_mirrorSmallestAddr;
}
// Verify there is memory at the mirrored location
OpenPOWER on IntegriCloud