summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Baiocchi <mbaiocch@us.ibm.com>2018-04-17 13:41:18 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-18 17:22:11 -0400
commit2d3cfebc29cc581d61719bf778fe06804024f0b3 (patch)
tree2bd85d03cdc7aa6cf9394088faa10753ec70a1bf
parent48b001dafc539b10ac830cb82dad59875419b66b (diff)
downloadtalos-hostboot-2d3cfebc29cc581d61719bf778fe06804024f0b3.tar.gz
talos-hostboot-2d3cfebc29cc581d61719bf778fe06804024f0b3.zip
Use HRMOR-relative addresses for temporary PAYLOAD and HDAT memory
The FSP DMAs-via-TCEs the PAYLOAD and HDAT sections into HRMOR-relative memory on the master node. However, istep21's verifyAndMove() function was not using HRMOR-relative physical addresses and failed when node0 was not configured. These changes should address this and similar code using these address spaces. Change-Id: Idba95a97de9906ba6c0203f797b526eab694b8cf CQ:SW425130 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57357 CI-Ready: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: ILYA SMIRNOV <ismirno@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: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/usr/isteps/istep21/call_host_runtime_setup.C15
-rw-r--r--src/usr/util/utilmclmgr.C26
-rw-r--r--src/usr/util/utiltcemgr.C4
3 files changed, 29 insertions, 16 deletions
diff --git a/src/usr/isteps/istep21/call_host_runtime_setup.C b/src/usr/isteps/istep21/call_host_runtime_setup.C
index cbab56501..77648b9fd 100644
--- a/src/usr/isteps/istep21/call_host_runtime_setup.C
+++ b/src/usr/isteps/istep21/call_host_runtime_setup.C
@@ -238,7 +238,9 @@ errlHndl_t verifyAndMovePayload(void)
MCL::compIdToString(l_compId, l_IdStr);
// Get Temporary Virtual Address To Payload
- uint64_t payload_tmp_phys_addr = MCL_TMP_ADDR;
+ // - Need to make Memory spaces HRMOR-relative
+ uint64_t hrmorVal = cpu_spr_value(CPU_SPR_HRMOR);
+ uint64_t payload_tmp_phys_addr = hrmorVal - VMM_HRMOR_OFFSET + MCL_TMP_ADDR;
uint64_t payload_size = MCL_TMP_SIZE;
payload_tmp_virt_addr = mm_block_map(
@@ -374,9 +376,11 @@ errlHndl_t verifyAndMovePayload(void)
// Move HDAT into its proper place after it was temporarily put into
- // HDAT_TMP_ADDR (HDAT_TMP_SIZE) by the FSP via TCEs
+ // HDAT_TMP_ADDR-relative-to-HRMOR (HDAT_TMP_SIZE) by the FSP via TCEs
+ uint64_t hdat_tmp_phys_addr = hrmorVal - VMM_HRMOR_OFFSET + HDAT_TMP_ADDR;
+
hdat_tmp_virt_addr = mm_block_map(
- reinterpret_cast<void*>(HDAT_TMP_ADDR),
+ reinterpret_cast<void*>(hdat_tmp_phys_addr),
HDAT_TMP_SIZE);
// Check for nullptr being returned
@@ -431,9 +435,8 @@ errlHndl_t verifyAndMovePayload(void)
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"verifyAndMovePayload(): Copy HDAT from 0x%.16llX (va="
"0x%llX) to HDAT_FINAL = 0x%.16llX (va=0x%llX), size=0x%llX",
- HDAT_TMP_ADDR, hdat_tmp_virt_addr, payloadBase+hdat_cpy_offset,
- hdat_final_virt_addr,
- HDAT_TMP_SIZE);
+ hdat_tmp_phys_addr, hdat_tmp_virt_addr,
+ payloadBase+hdat_cpy_offset, hdat_final_virt_addr, HDAT_TMP_SIZE);
memcpy(hdat_final_virt_addr,
hdat_tmp_virt_addr,
diff --git a/src/usr/util/utilmclmgr.C b/src/usr/util/utilmclmgr.C
index a89c124b8..5df056299 100644
--- a/src/usr/util/utilmclmgr.C
+++ b/src/usr/util/utilmclmgr.C
@@ -27,6 +27,7 @@
#include <util/util_reasoncodes.H>
#include "utilbase.H"
#include <sys/mm.h>
+#include <sys/misc.h>
#include <errl/errlentry.H>
#include <errl/errlmanager.H>
#include <initservice/initserviceif.H>
@@ -94,21 +95,30 @@ void CompInfo::print() const
////////////////////////////////////////////////////////////////////////////////
MasterContainerLidMgr::MasterContainerLidMgr()
-: iv_mclAddr(MCL_ADDR), iv_mclSize(MCL_SIZE), iv_tmpAddr(MCL_TMP_ADDR),
- iv_tmpSize(MCL_TMP_SIZE), iv_maxSize(0), iv_pMclVaddr(nullptr),
- iv_pTempVaddr(nullptr), iv_pVaddr(nullptr), iv_compInfoCache{},
- iv_hasHeader(true)
+: iv_mclSize(MCL_SIZE), iv_tmpSize(MCL_TMP_SIZE), iv_maxSize(0),
+ iv_pMclVaddr(nullptr), iv_pTempVaddr(nullptr), iv_pVaddr(nullptr),
+ iv_compInfoCache{}, iv_hasHeader(true)
{
+ // Need to make Memory spaces HRMOR-relative
+ uint64_t hrmorVal = cpu_spr_value(CPU_SPR_HRMOR);
+ iv_mclAddr = hrmorVal - VMM_HRMOR_OFFSET + MCL_ADDR;
+ iv_tmpAddr = hrmorVal - VMM_HRMOR_OFFSET + MCL_TMP_ADDR;
+
initMcl();
}
MasterContainerLidMgr::MasterContainerLidMgr(const void* i_pMcl,
const size_t i_size)
-: iv_mclAddr(MCL_ADDR), iv_mclSize(MCL_SIZE), iv_tmpAddr(MCL_TMP_ADDR),
- iv_tmpSize(MCL_TMP_SIZE), iv_maxSize(0), iv_pMclVaddr(nullptr),
- iv_pTempVaddr(nullptr), iv_pVaddr(nullptr), iv_compInfoCache{},
- iv_hasHeader(false)
+: iv_mclSize(MCL_SIZE), iv_tmpSize(MCL_TMP_SIZE), iv_maxSize(0),
+ iv_pMclVaddr(nullptr), iv_pTempVaddr(nullptr), iv_pVaddr(nullptr),
+ iv_compInfoCache{}, iv_hasHeader(false)
{
+ // Need to make Memory spaces HRMOR-relative
+ uint64_t hrmorVal = cpu_spr_value(CPU_SPR_HRMOR);
+ iv_mclAddr = hrmorVal - VMM_HRMOR_OFFSET + MCL_ADDR;
+ iv_tmpAddr = hrmorVal - VMM_HRMOR_OFFSET + MCL_TMP_ADDR;
+
+
initMcl(i_pMcl, i_size);
}
diff --git a/src/usr/util/utiltcemgr.C b/src/usr/util/utiltcemgr.C
index d925c332a..a0a2d58d5 100644
--- a/src/usr/util/utiltcemgr.C
+++ b/src/usr/util/utiltcemgr.C
@@ -201,7 +201,7 @@ errlHndl_t utilSetupPayloadTces(void)
errl = utilAllocateTces(addr, size, token);
if (errl)
{
- TRACFCOMP(g_trac_tce,"utilSetupPayloadTces(): ERROR back from utilAllocateTces() for HDAT using addr=0x%.16llX, size=0x%llX", HDAT_TMP_ADDR, HDAT_TMP_SIZE);
+ TRACFCOMP(g_trac_tce,"utilSetupPayloadTces(): ERROR back from utilAllocateTces() for HDAT using addr=0x%.16llX, size=0x%llX", addr, size);
break;
}
else
@@ -262,7 +262,7 @@ errlHndl_t utilClosePayloadTces(void)
nullptr); //Master Processor
if(errl)
{
- TRACFCOMP(g_trac_tce,"utilClosePayloadTces(): ERROR back from closeUnsecureMemRegion() using start address=0x%016llX",MCL_TMP_ADDR);
+ TRACFCOMP(g_trac_tce,"utilClosePayloadTces(): ERROR back from closeUnsecureMemRegion() using start address=0x%016llX",addr);
break;
}
OpenPOWER on IntegriCloud