summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorMike Baiocchi <mbaiocch@us.ibm.com>2018-02-01 12:14:23 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-02-01 17:58:10 -0500
commit4046ab053d85e0a531532f1a40894efb9361c83c (patch)
treea7d8ba193e5d58b03bd7dedbdc893c2353d8d482 /src/usr
parent5320c4c323d2be26decc21d31aaafd010246fd07 (diff)
downloadtalos-hostboot-4046ab053d85e0a531532f1a40894efb9361c83c.tar.gz
talos-hostboot-4046ab053d85e0a531532f1a40894efb9361c83c.zip
On MPIPLs open up TCE windows for FSP to extract dump information
When the system is rebooting in a MPIPL, in istep 14.8 host_mpipl_service, if TCEs are enabled, a Read-Only TCE window will be opened for the FSP to read information about the dump. Change-Id: I1a32c9d4fe0027e795c14c50dfbd8782609b17e9 Backport: release-fips910 CQ:SW415585 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53204 Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-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')
-rw-r--r--src/usr/dump/dumpCollect.C47
-rw-r--r--src/usr/util/utiltcemgr.C17
-rw-r--r--src/usr/util/utiltcemgr.H9
3 files changed, 61 insertions, 12 deletions
diff --git a/src/usr/dump/dumpCollect.C b/src/usr/dump/dumpCollect.C
index 816963cf8..1e9ed819e 100644
--- a/src/usr/dump/dumpCollect.C
+++ b/src/usr/dump/dumpCollect.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -36,6 +38,7 @@
#include <util/align.H>
#include <sys/mm.h>
#include <dump/dumpif.H>
+#include <util/utiltce.H>
#include <sys/msg.h> // message Q's
#include <mbox/mbox_queues.H> //
@@ -833,7 +836,44 @@ errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
uint64_t l_mdrt_phys =
mm_virt_to_phys(
reinterpret_cast<void*>(resultsTableAddr));
- msg->data[0] = l_mdrt_phys;
+
+ // If TCEs are enabled setup TCEs in TCE Table to allow
+ // the FSP to read this memory
+ if (TCE::utilUseTcesForDmas())
+ {
+ // Align Physical addr down for TCE requirement
+ uint64_t mdrt_phyp_aligned =
+ ALIGN_PAGE_DOWN(l_mdrt_phys);
+
+ uint64_t offset = l_mdrt_phys - mdrt_phyp_aligned;
+
+ TRACFCOMP( g_trac_dump,"Setup TCEs for FSP to use for "
+ "l_mdrt_phys=0x%.16llX (virt=0x%.16llX, "
+ "aligned_phys=0x%.16llX, offset=0x%X)",
+ l_mdrt_phys, resultsTableAddr,
+ mdrt_phyp_aligned, offset);
+
+ uint32_t token = 0;
+ l_err = TCE::utilAllocateTces(mdrt_phyp_aligned,
+ resultsTableSize+offset,
+ token,
+ false); //Read-Only
+
+ if (l_err)
+ {
+ // Got an errorlog back from utilAllocateTces
+ TRACFCOMP(g_trac_dump, "HBDumpGetHostData utilAllocateTces failed rc=0x%X", l_err->reasonCode());
+ }
+ else
+ {
+ // Put the token with the offset into the msg
+ msg->data[0] = token + offset;
+ }
+ }
+ else
+ {
+ msg->data[0] = l_mdrt_phys;
+ }
// Number of bytes in the results table
msg->data[1] = resultsTableSize;
@@ -842,7 +882,8 @@ errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
msg->extra_data = NULL;
}
- else
+
+ if (l_err)
{
TRACFCOMP( g_trac_dump,
INFO_MRK"Got an error trying to send msg. %.8X,",
diff --git a/src/usr/util/utiltcemgr.C b/src/usr/util/utiltcemgr.C
index 0cf802cd4..e61ae4ca5 100644
--- a/src/usr/util/utiltcemgr.C
+++ b/src/usr/util/utiltcemgr.C
@@ -78,11 +78,13 @@ namespace TCE
/************************************************************************/
errlHndl_t utilAllocateTces(const uint64_t i_startingAddress,
const size_t i_size,
- uint32_t& o_startingToken)
+ uint32_t& o_startingToken,
+ const bool i_rwNotRO)
{
return Singleton<UtilTceMgr>::instance().allocateTces(i_startingAddress,
i_size,
- o_startingToken);
+ o_startingToken,
+ i_rwNotRO);
};
/************************************************************************/
@@ -583,7 +585,8 @@ errlHndl_t UtilTceMgr::initTceInHdw()
/************************************************************************/
errlHndl_t UtilTceMgr::allocateTces(const uint64_t i_startingAddress,
const size_t i_size,
- uint32_t& o_startingToken)
+ uint32_t& o_startingToken,
+ const bool i_rwNotRO)
{
errlHndl_t errl = nullptr;
uint32_t numTcesNeeded = 0;
@@ -591,7 +594,7 @@ errlHndl_t UtilTceMgr::allocateTces(const uint64_t i_startingAddress,
TceEntry_t *tablePtr = nullptr;
- TRACFCOMP(g_trac_tce,ENTER_MRK"UtilTceMgr::allocateTces: start for addr = 0x%.16llX and size = 0x%X", i_startingAddress, i_size);
+ TRACFCOMP(g_trac_tce,ENTER_MRK"UtilTceMgr::allocateTces: start for addr = 0x%.16llX , size = 0x%X, rwNorRO=%d", i_startingAddress, i_size, i_rwNotRO);
do
{
@@ -811,7 +814,11 @@ errlHndl_t UtilTceMgr::allocateTces(const uint64_t i_startingAddress,
{
tablePtr[index].realPageNumber = (i_startingAddress +
(i*PAGESIZE))/PAGESIZE;
- tablePtr[index].writeAccess = 1;
+
+ if (i_rwNotRO)
+ {
+ tablePtr[index].writeAccess = 1;
+ }
tablePtr[index].readAccess = 1;
TRACDCOMP(g_trac_tce,INFO_MRK"UtilTceMgr::allocateTces: TCE Entry/Token[%d] (hex) = 0x%llX", index, tablePtr[index]);
diff --git a/src/usr/util/utiltcemgr.H b/src/usr/util/utiltcemgr.H
index 9bb643dbf..490f10e2e 100644
--- a/src/usr/util/utiltcemgr.H
+++ b/src/usr/util/utiltcemgr.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2017 */
+/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -254,9 +254,10 @@ class UtilTceMgr
* - see utiltce.H for details
*
*/
- errlHndl_t allocateTces(uint64_t i_startingAddress,
- size_t i_size,
- uint32_t& o_startingToken);
+ errlHndl_t allocateTces(uint64_t i_startingAddress,
+ size_t i_size,
+ uint32_t& o_startingToken,
+ const bool i_rwNotRO);
/**
* @brief Responsible for deallocating TCEs
OpenPOWER on IntegriCloud