summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2014-01-24 17:30:26 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-02-06 17:59:14 -0600
commit13f9e39136ff2351bf4d9c6d0e52c4295683ebf5 (patch)
tree072157d5b5720f23e9be438b70fbb8f8a6a23c09
parenta2c2b1d976850d8cc58a870c4fd1316b0cf86334 (diff)
downloadtalos-hostboot-13f9e39136ff2351bf4d9c6d0e52c4295683ebf5.tar.gz
talos-hostboot-13f9e39136ff2351bf4d9c6d0e52c4295683ebf5.zip
Handle relative dump addresses
PHYP can fill the dump tables (MDST,MDDT) with relative addresses instead of physical ones. In that case, we need to offset the values by the PHYP base address to get to the real memory. Change-Id: I83ed94b3b59e18c71cc0d99d6d2ad1cf5b556ab8 CQ: SW242249 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8381 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/usr/dump/dumpCollect.C807
-rw-r--r--src/usr/dump/dumpCollect.H7
-rw-r--r--src/usr/dump/test/dumptest.H92
3 files changed, 474 insertions, 432 deletions
diff --git a/src/usr/dump/dumpCollect.C b/src/usr/dump/dumpCollect.C
index 1d712b719..972803c10 100644
--- a/src/usr/dump/dumpCollect.C
+++ b/src/usr/dump/dumpCollect.C
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -39,6 +39,7 @@
#include <sys/msg.h> // message Q's
#include <mbox/mbox_queues.H> //
+#include <kernel/vmmmgr.H>
// Trace definition
trace_desc_t* g_trac_dump = NULL;
@@ -99,469 +100,510 @@ errlHndl_t doDumpCollect(void)
return (l_err);
}
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+// Returns the physical address corresponding to a PHYP MDST/MDRT entry
+void* getPhysAddr( uint64_t i_phypAddr )
+{
+ uint64_t phys_addr = 0;
- ///////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////
-
- errlHndl_t copySrcToDest(dumpEntry *srcTableEntry, uint64_t srcTableSize,
- dumpEntry *destTableEntry, uint64_t destTableSize,
- resultsEntry *resultsTableEntry, uint64_t resultsTableSize)
+ // Physical Address
+ if( VmmManager::FORCE_PHYS_ADDR & i_phypAddr )
+ {
+ // lop off the top bit so our vmm code works
+ phys_addr = (i_phypAddr & ~VmmManager::FORCE_PHYS_ADDR);
+ }
+ // Relative to PHYP HRMOR
+ else
{
- TRACFCOMP(g_trac_dump, "copySrcToDest - start ");
+ TARGETING::Target * sys = NULL;
+ TARGETING::targetService().getTopLevelTarget( sys );
+ assert(sys != NULL);
+
+ // add the hrmor/payload_base to the value in the table
+ TARGETING::ATTR_PAYLOAD_BASE_type payload_base
+ = sys->getAttr<TARGETING::ATTR_PAYLOAD_BASE>();
+ phys_addr = payload_base*MEGABYTE + i_phypAddr;
+ }
- errlHndl_t l_err = NULL;
- int rc = 0;
- bool invalidSrcSize = false;
- bool invalidDestSize = false;
- uint32_t l_resultCount = 0x0;
+ return reinterpret_cast<void*>(ALIGN_PAGE_DOWN(phys_addr));
+}
- // local src table info
- uint64_t *vaSrcTableAddr = 0;
- uint64_t *vaMapSrcTableAddr = 0;
- uint64_t curSrcTableAddr = 0;
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
- // destination table info
- uint64_t *vaDestTableAddr = 0;
- uint64_t *vaMapDestTableAddr = 0;
- uint64_t curDestTableAddr = 0;
+errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
+ uint64_t srcTableSize,
+ dumpEntry *destTableEntry,
+ uint64_t destTableSize,
+ resultsEntry *resultsTableEntry,
+ uint64_t resultsTableSize)
+{
+ TRACFCOMP(g_trac_dump, "copySrcToDest - start ");
- // Data sizes
- uint64_t sizeToCopy = 0;
- uint64_t bytesLeftInSrc = 0;
- uint64_t bytesLeftInDest = 0;
+ errlHndl_t l_err = NULL;
+ int rc = 0;
+ bool invalidSrcSize = false;
+ bool invalidDestSize = false;
+ uint32_t l_resultCount = 0x0;
+
+ // local src table info
+ uint64_t *vaSrcTableAddr = 0;
+ uint64_t *vaMapSrcTableAddr = 0;
+ uint64_t curSrcTableAddr = 0;
+
+ // destination table info
+ uint64_t *vaDestTableAddr = 0;
+ uint64_t *vaMapDestTableAddr = 0;
+ uint64_t curDestTableAddr = 0;
+
+ // Data sizes
+ uint64_t sizeToCopy = 0;
+ uint64_t bytesLeftInSrc = 0;
+ uint64_t bytesLeftInDest = 0;
- do
- {
+ do
+ {
- // Need to loop through all the source entries.. Copying into a
- // destination entry. Note the src could be larger than the
- // destination size and could require multiple copies.. In addition
- // the size of the destination could be larger than 1 source entry.
- // These entries need to be packed into the destination.. so 1
- // destination entry could have multiple source entries in it.
- // After each copy need to write an entry into the results table
- // source/destination/size.
-
- // Figure out the num of entries in the src table
- uint64_t maxSrcEntries = srcTableSize/(sizeof (dumpEntry));
-
- // Figure out the num of entries in the dest table
- uint64_t maxDestEntries = destTableSize/(sizeof (dumpEntry));
-
- // Figure out the max result entires
- uint64_t maxResultEntries = resultsTableSize/(sizeof
- (resultsEntry));
-
- // Index into each Dump table
- uint64_t curSourceIndex = 0;
- uint64_t curDestIndex = 0;
- uint64_t curResultIndex = 0;
-
- // Map in the first source and destination entries from their
- // corresponding tables.
- // NOTE: When mapping a device the address we are mapping needs to
- // be page aligned. In addition the VA returned is page
- // aligned so we need to add the offset of the page aligned address
- // to the VA returned
-
- // Get the first Source address and size
- curSrcTableAddr = srcTableEntry[curSourceIndex].dataAddr;
- bytesLeftInSrc = srcTableEntry[curSourceIndex].dataSize;
-
- // Get the first destination address and size.
- curDestTableAddr = destTableEntry[curDestIndex].dataAddr;
- bytesLeftInDest = destTableEntry[curDestIndex].dataSize;
-
- // Determine the src and destination offset.
- uint64_t destOffset = curDestTableAddr - ALIGN_PAGE_DOWN(curDestTableAddr);
- uint64_t srcOffset = curSrcTableAddr - ALIGN_PAGE_DOWN(curSrcTableAddr);
-
- // If the data size is greater then 32GB after page alignment
- // create an error. Current limitation on DevMap is 32GB in size.
- // Not sure yet if we will ever see a table entry > 3GB.
- if (bytesLeftInSrc + srcOffset > THIRTYTWO_GB)
- {
- invalidSrcSize = true;
- break;
- }
- else if ((bytesLeftInDest + destOffset > THIRTYTWO_GB))
- {
- invalidDestSize = true;
- break;
- }
+ // Need to loop through all the source entries.. Copying into a
+ // destination entry. Note the src could be larger than the
+ // destination size and could require multiple copies.. In addition
+ // the size of the destination could be larger than 1 source entry.
+ // These entries need to be packed into the destination.. so 1
+ // destination entry could have multiple source entries in it.
+ // After each copy need to write an entry into the results table
+ // source/destination/size.
+
+ // Figure out the num of entries in the src table
+ uint64_t maxSrcEntries = srcTableSize/(sizeof (dumpEntry));
+
+ // Figure out the num of entries in the dest table
+ uint64_t maxDestEntries = destTableSize/(sizeof (dumpEntry));
+
+ // Figure out the max result entires
+ uint64_t maxResultEntries = resultsTableSize/(sizeof
+ (resultsEntry));
+
+ // Index into each Dump table
+ uint64_t curSourceIndex = 0;
+ uint64_t curDestIndex = 0;
+ uint64_t curResultIndex = 0;
+
+ // Map in the first source and destination entries from their
+ // corresponding tables.
+ // NOTE: When mapping a device the address we are mapping needs to
+ // be page aligned. In addition the VA returned is page
+ // aligned so we need to add the offset of the page aligned address
+ // to the VA returned
+
+ // Get the first Source address and size
+ curSrcTableAddr = srcTableEntry[curSourceIndex].dataAddr;
+ bytesLeftInSrc = srcTableEntry[curSourceIndex].dataSize;
+
+ // Get the first destination address and size.
+ curDestTableAddr = destTableEntry[curDestIndex].dataAddr;
+ bytesLeftInDest = destTableEntry[curDestIndex].dataSize;
+
+ // Determine the src and destination offset.
+ uint64_t destOffset = curDestTableAddr
+ - ALIGN_PAGE_DOWN(curDestTableAddr);
+ uint64_t srcOffset = curSrcTableAddr
+ - ALIGN_PAGE_DOWN(curSrcTableAddr);
+
+ // If the data size is greater then 32GB after page alignment
+ // create an error. Current limitation on DevMap is 32GB in size.
+ // Not sure yet if we will ever see a table entry > 3GB.
+ if (bytesLeftInSrc + srcOffset > THIRTYTWO_GB)
+ {
+ invalidSrcSize = true;
+ break;
+ }
+ else if ((bytesLeftInDest + destOffset > THIRTYTWO_GB))
+ {
+ invalidDestSize = true;
+ break;
+ }
- vaMapSrcTableAddr =
- (static_cast<uint64_t*>(mm_block_map(
- reinterpret_cast<void*>(ALIGN_PAGE_DOWN
- (curSrcTableAddr & RM_TOP_NIBBLE_MASK)),
- THIRTYTWO_GB)));
+ vaMapSrcTableAddr = (static_cast<uint64_t*>(mm_block_map(
+ getPhysAddr(curSrcTableAddr),
+ THIRTYTWO_GB)));
- vaSrcTableAddr = vaMapSrcTableAddr;
+ vaSrcTableAddr = vaMapSrcTableAddr;
- vaMapDestTableAddr =
- (static_cast<uint64_t*>(mm_block_map(
- reinterpret_cast<void*>(ALIGN_PAGE_DOWN
- (curDestTableAddr & RM_TOP_NIBBLE_MASK)),
- THIRTYTWO_GB)));
+ vaMapDestTableAddr = (static_cast<uint64_t*>(mm_block_map(
+ getPhysAddr(curDestTableAddr),
+ THIRTYTWO_GB)));
- vaDestTableAddr = vaMapDestTableAddr;
+ vaDestTableAddr = vaMapDestTableAddr;
- // add the offset to the src and destination VAs,
- vaSrcTableAddr += (srcOffset/(sizeof (uint64_t)));
+ // add the offset to the src and destination VAs,
+ vaSrcTableAddr += (srcOffset/(sizeof (uint64_t)));
- vaDestTableAddr += (destOffset/(sizeof (uint64_t)));
+ vaDestTableAddr += (destOffset/(sizeof (uint64_t)));
- // Current Source physical and Va address
- TRACFCOMP(g_trac_dump, "copySrcToDest SrcTableIndex = %d, srcTableAddr = %.16X, VA = %.16X", curSourceIndex, curSrcTableAddr, vaSrcTableAddr);
+ // Current Source physical and Va address
+ TRACFCOMP(g_trac_dump, "copySrcToDest SrcTableIndex = %d, srcTableAddr = %.16X, VA = %.16X", curSourceIndex, curSrcTableAddr, vaSrcTableAddr);
- // Current Destination physical and Va address
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest DestTableIndex = %d, DestTableAddr = %.16X, VA = %.16X", curDestIndex, curDestTableAddr, vaDestTableAddr);
+ // Current Destination physical and Va address
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest DestTableIndex = %d, DestTableAddr = %.16X, VA = %.16X", curDestIndex, curDestTableAddr, vaDestTableAddr);
- resultsTableEntry->dataSize = 0x0;
+ resultsTableEntry->dataSize = 0x0;
- while(1)
+ while(1)
+ {
+ // If we have copied all the bytes in the src entry
+ if (bytesLeftInSrc == 0)
{
- // If we have copied all the bytes in the src entry
- if (bytesLeftInSrc == 0)
+ // unmap the previous src entry
+ rc = mm_block_unmap(
+ reinterpret_cast<void*>(vaMapSrcTableAddr));
+
+ if (rc != 0)
{
- // unmap the previous src entry
- rc = mm_block_unmap(
- reinterpret_cast<void*>(vaMapSrcTableAddr));
+ /*@
+ * @errortype
+ * @moduleid DUMP::DUMP_COLLECT
+ * @reasoncode DUMP::DUMP_CANNOT_UNMAP_SRC
+ * @userdata1 VA address of the MDST to unmap
+ * @userdata2 rc value from unmap
+ * @devdesc Cannot unmap the source table section
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ DUMP_COLLECT,
+ DUMP_CANNOT_UNMAP_SRC,
+ (uint64_t)vaMapSrcTableAddr,
+ rc);
- if (rc != 0)
- {
- /*@
- * @errortype
- * @moduleid DUMP::DUMP_COLLECT
- * @reasoncode DUMP::DUMP_CANNOT_UNMAP_SRC
- * @userdata1 VA address of the MDST to unmap
- * @userdata2 rc value from unmap
- * @devdesc Cannot unmap the source table section
- */
- l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- DUMP_COLLECT,
- DUMP_CANNOT_UNMAP_SRC,
- (uint64_t)vaMapSrcTableAddr,
- rc);
+ // commit the error and continue.
+ // Leave the devices unmapped for now.
+ errlCommit(l_err,DUMP_COMP_ID);
- // commit the error and continue. Leave the devices unmapped for now.
- errlCommit(l_err,DUMP_COMP_ID);
+ l_err = NULL;
- l_err = NULL;
+ }
- }
+ // increment to the next src entry
+ curSourceIndex++;
- // increment to the next src entry
- curSourceIndex++;
+ // if we have reach all entries
+ if (curSourceIndex >= maxSrcEntries)
+ {
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest - through all src entries");
+ break;
+ }
- // if we have reach all entries
- if (curSourceIndex >= maxSrcEntries)
- {
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest - through all src entries");
- break;
- }
+ curSrcTableAddr = srcTableEntry[curSourceIndex].dataAddr;
+ bytesLeftInSrc = srcTableEntry[curSourceIndex].dataSize;
- curSrcTableAddr = srcTableEntry[curSourceIndex].dataAddr;
- bytesLeftInSrc = srcTableEntry[curSourceIndex].dataSize;
+ // If the current Src table Address is 0 we are done
+ if (curSrcTableAddr == 0)
+ {
+ break;
+ }
- // If the current Src table Address is 0 we are done
- if (curSrcTableAddr == 0)
- {
- break;
- }
+ srcOffset = curSrcTableAddr -
+ ALIGN_PAGE_DOWN(curSrcTableAddr);
- srcOffset = curSrcTableAddr - ALIGN_PAGE_DOWN(curSrcTableAddr);
+ // If the data size is less then 32GB after page alignment
+ if (bytesLeftInSrc + srcOffset > THIRTYTWO_GB)
+ {
+ invalidSrcSize = true;
+ break;
+ }
- // If the data size is less then 32GB after page alignment
- if (bytesLeftInSrc + srcOffset > THIRTYTWO_GB)
- {
- invalidSrcSize = true;
- break;
- }
+ // map the MDST entry to a device such that we can read and
+ // write from that memory address
+ vaMapSrcTableAddr = (static_cast<uint64_t*>(mm_block_map(
+ getPhysAddr(curSrcTableAddr),
+ THIRTYTWO_GB)));
- // map the MDST entry to a device such that we can read and write from that memory
- // address
- vaMapSrcTableAddr =
- (static_cast<uint64_t*>(mm_block_map(
- reinterpret_cast<void*>(ALIGN_PAGE_DOWN
- (curSrcTableAddr & RM_TOP_NIBBLE_MASK)),
- THIRTYTWO_GB)));
+ vaSrcTableAddr = vaMapSrcTableAddr;
- vaSrcTableAddr = vaMapSrcTableAddr;
+ vaSrcTableAddr += (srcOffset/(sizeof (uint64_t)));
- vaSrcTableAddr += (srcOffset/(sizeof (uint64_t)));
+ // Current Source physical and Va address
+ TRACFCOMP(g_trac_dump, "copySrcToDest SrcTableIndex = %d, srcTableAddr = %.16X, VA = %.16X", curSourceIndex, curSrcTableAddr, vaSrcTableAddr);
- // Current Source physical and Va address
- TRACFCOMP(g_trac_dump, "copySrcToDest SrcTableIndex = %d, srcTableAddr = %.16X, VA = %.16X", curSourceIndex, curSrcTableAddr, vaSrcTableAddr);
+ }
+
+ // If there is no more space in the destination area
+ if (bytesLeftInDest == 0)
+ {
+ // unmap the previous dest entry
+ rc = mm_block_unmap(
+ reinterpret_cast<void*>(vaMapDestTableAddr));
+ if (rc != 0)
+ {
+ /*@
+ * @errortype
+ * @moduleid DUMP::DUMP_COLLECT
+ * @reasoncode DUMP::DUMP_CANNOT_UNMAP_DEST
+ * @userdata1 VA address of the MDDT to unmap
+ * @userdata2 rc value from unmap
+ * @devdesc Cannot unmap the source table section
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ DUMP_COLLECT,
+ DUMP_CANNOT_UNMAP_DEST,
+ (uint64_t)vaMapDestTableAddr,
+ rc);
+ // commit the error and continue.
+ // Leave the devices unmapped?
+ errlCommit(l_err,DUMP_COMP_ID);
+
+ l_err = NULL;
}
- // If there is no more space in the destination area
- if (bytesLeftInDest == 0)
+ // increment to the next dest entry
+ curDestIndex++;
+
+ // if made it through all dest entries.
+ if (curDestIndex >= maxDestEntries)
{
- // unmap the previous dest entry
- rc = mm_block_unmap(
- reinterpret_cast<void*>(vaMapDestTableAddr));
- if (rc != 0)
+ // need to check here to see if we still have SRC
+ // entries not copied.
+ if (bytesLeftInSrc != 0)
{
+ // Write an error because we have more src entries
+ // then destination space available.
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: not enough Destination table entries");
+
/*@
* @errortype
* @moduleid DUMP::DUMP_COLLECT
- * @reasoncode DUMP::DUMP_CANNOT_UNMAP_DEST
- * @userdata1 VA address of the MDDT to unmap
- * @userdata2 rc value from unmap
- * @devdesc Cannot unmap the source table section
+ * @reasoncode DUMP::DUMP_MDDT_INSUFFICIENT_ENTRIES
+ * @userdata1 Source Entires bytes left to copy
+ * @userdata2 Index into the MDST table
+ * @devdesc MDDT table is not big enough to
+ * hold all src entries
*/
- l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- DUMP_COLLECT,
- DUMP_CANNOT_UNMAP_DEST,
- (uint64_t)vaMapDestTableAddr,
- rc);
-
- // commit the error and continue. Leave the devices unmapped?
- errlCommit(l_err,DUMP_COMP_ID);
-
- l_err = NULL;
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ DUMP_COLLECT,
+ DUMP_MDDT_INSUFFICIENT_ENTRIES,
+ bytesLeftInSrc,
+ curSourceIndex);
+
+ // do not commit this errorlog error as this is a
+ // real problem.
+
+ // TODO: RTC: 64399
+ // Need to add the src entries and sizes? that did
+ // not get copied to the destination. This error
+ // condition is such that the table entries are
+ // exceeded.
}
- // increment to the next dest entry
- curDestIndex++;
+ break;
+ }
- // if made it through all dest entries.
- if (curDestIndex >= maxDestEntries)
- {
- // need to check here to see if we still have SRC
- // entries not copied.
- if (bytesLeftInSrc != 0)
- {
- // Write an error because we have more src entries
- // then destination space available.
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: not enough Destination table entries");
-
- /*@
- * @errortype
- * @moduleid DUMP::DUMP_COLLECT
- * @reasoncode DUMP::DUMP_MDDT_INSUFFICIENT_ENTRIES
- * @userdata1 Source Entires bytes left to copy
- * @userdata2 Index into the MDST table
- * @devdesc MDDT table is not big enough to hold all src entries
- */
- l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- DUMP_COLLECT,
- DUMP_MDDT_INSUFFICIENT_ENTRIES,
- bytesLeftInSrc,
- curSourceIndex);
-
- // do not commit this errorlog error as this is a
- // real problem.
-
- // TODO: RTC: 64399
- // Need to add the src entries and sizes? that did
- // not get copied to the destination. This error
- // condition is such that the table entries are exceeded.
- }
-
- break;
- }
+ curDestTableAddr = destTableEntry[curDestIndex].dataAddr;
+ bytesLeftInDest = destTableEntry[curDestIndex].dataSize;
- curDestTableAddr = destTableEntry[curDestIndex].dataAddr;
- bytesLeftInDest = destTableEntry[curDestIndex].dataSize;
+ //check to see if there are contiguous destination addresses
+ while ((destTableEntry[curDestIndex].dataAddr +
+ destTableEntry[curDestIndex].dataSize) ==
+ destTableEntry[curDestIndex+1].dataAddr)
+ {
+ curDestIndex++;
+ bytesLeftInDest +=destTableEntry[curDestIndex].dataSize;
+ }
- //check to see if there are contiguous destination addresses
- while ((destTableEntry[curDestIndex].dataAddr +
- destTableEntry[curDestIndex].dataSize) ==
- destTableEntry[curDestIndex+1].dataAddr)
- {
- curDestIndex++;
- bytesLeftInDest +=destTableEntry[curDestIndex].dataSize;
- }
+ // If the current dest addr or the size to copy are zero.
+ if ((curDestTableAddr == 0) || (bytesLeftInDest == 0))
+ {
- // If the current dest addr or the size to copy are zero.
- if ((curDestTableAddr == 0) || (bytesLeftInDest == 0))
+ // If there are still SRC entries to copy with no
+ // destination send an error back.
+ if (bytesLeftInSrc != 0)
{
+ // Write an error because we have more src entries
+ // then destination space available.
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: not enough Destination table space");
- // If there are still SRC entries to copy with no
- // destination send an error back.
- if (bytesLeftInSrc != 0)
- {
- // Write an error because we have more src entries
- // then destination space available.
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: not enough Destination table space");
-
- /*@
- * @errortype
- * @moduleid DUMP::DUMP_COLLECT
- * @reasoncode DUMP::DUMP_MDDT_INSUFFICIENT_SPACE
- * @userdata1 Source Entires bytes left to copy
- * @userdata2 Index into the MDST table
- * @devdesc MDDT table is not big enough to hold all src entries
- */
- l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- DUMP_COLLECT,
- DUMP_MDDT_INSUFFICIENT_SPACE,
- bytesLeftInSrc,
- curSourceIndex);
-
- // do not commit this errorlog error as this is a
- // real problem.
-
- // TODO: RTC: 64399
- // Need to add the src entries and sizes? that did
- // not get copied to the destination. This
- // condition is such that we have a destination
- // entry that either has a zero address or zero
- // size.. Perhaps put the bad destination entry
- // there as well
- }
-
- break;
- }
-
- destOffset = curDestTableAddr - ALIGN_PAGE_DOWN(curDestTableAddr);
-
- // If the data size is less then 32GB after page alignment
- if (bytesLeftInDest + destOffset > THIRTYTWO_GB)
- {
- invalidDestSize = true;
- break;
+ /*@
+ * @errortype
+ * @moduleid DUMP::DUMP_COLLECT
+ * @reasoncode DUMP::DUMP_MDDT_INSUFFICIENT_SPACE
+ * @userdata1 Source Entires bytes left to copy
+ * @userdata2 Index into the MDST table
+ * @devdesc MDDT table is not big enough to
+ * hold all src entries
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ DUMP_COLLECT,
+ DUMP_MDDT_INSUFFICIENT_SPACE,
+ bytesLeftInSrc,
+ curSourceIndex);
+
+ // do not commit this errorlog error as this is a
+ // real problem.
+
+ // TODO: RTC: 64399
+ // Need to add the src entries and sizes? that did
+ // not get copied to the destination. This
+ // condition is such that we have a destination
+ // entry that either has a zero address or zero
+ // size.. Perhaps put the bad destination entry
+ // there as well
}
- // map the MDDT to a VA addresss
- vaMapDestTableAddr =
- (static_cast<uint64_t*>(mm_block_map(
- reinterpret_cast<void*>(ALIGN_PAGE_DOWN
- (curDestTableAddr & RM_TOP_NIBBLE_MASK)),
- THIRTYTWO_GB)));
-
- vaDestTableAddr = vaMapDestTableAddr;
-
- vaDestTableAddr += (destOffset/(sizeof(uint64_t)));
-
- // Current Destination physical and Va address
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest DestTableIndex = %d, DestTableAddr = %.16X, VA = %.16X", curDestIndex, curDestTableAddr, vaDestTableAddr);
-
+ break;
}
+ destOffset = curDestTableAddr
+ - ALIGN_PAGE_DOWN(curDestTableAddr);
- // Determine how much to copy..
- sizeToCopy = std::min(bytesLeftInSrc, bytesLeftInDest);
-
- // Do the copy of the data from the source to the destination
- mm_tolerate_ue(1);
- memcpy( vaDestTableAddr,vaSrcTableAddr, sizeToCopy);
- mm_tolerate_ue(0);
-
- if (curResultIndex < maxResultEntries)
+ // If the data size is less then 32GB after page alignment
+ if (bytesLeftInDest + destOffset > THIRTYTWO_GB)
{
- // Update the results table
- resultsTableEntry->srcAddr = curSrcTableAddr;
- resultsTableEntry->destAddr = curDestTableAddr;
- resultsTableEntry->dataSize = sizeToCopy;
- resultsTableEntry++;
- l_resultCount++;
- curResultIndex++;
+ invalidDestSize = true;
+ break;
}
- else
- {
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: not enough result table space");
- /*@
- * @errortype
- * @moduleid DUMP::DUMP_COLLECT
- * @reasoncode DUMP::DUMP_MDRT_INSUFFICIENT_SPACE
- * @userdata1 Index into the MDRT
- * @userdata2 max entries allowed given space allocated
- * @devdesc MDRT table is not big enough to hold all entries
- */
- l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- DUMP_COLLECT,
- DUMP_MDRT_INSUFFICIENT_SPACE,
- curResultIndex,
- maxResultEntries);
+ // map the MDDT to a VA addresss
+ vaMapDestTableAddr = (static_cast<uint64_t*>(mm_block_map(
+ getPhysAddr(curDestTableAddr),
+ THIRTYTWO_GB)));
- // commit the error and continue.
- errlCommit(l_err,DUMP_COMP_ID);
+ vaDestTableAddr = vaMapDestTableAddr;
- l_err = NULL;
- }
+ vaDestTableAddr += (destOffset/(sizeof(uint64_t)));
- // decrement the amount copied from the source and destination
- bytesLeftInSrc -= sizeToCopy;
- bytesLeftInDest -= sizeToCopy;
+ // Current Destination physical and Va address
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest DestTableIndex = %d, DestTableAddr = %.16X, VA = %.16X", curDestIndex, curDestTableAddr, vaDestTableAddr);
- uint64_t addrOffset = sizeToCopy/(sizeof (uint64_t));
+ }
- // increment the current src and dest addresses in both the
- // physical and virtual addresses.
- curSrcTableAddr += sizeToCopy;
- curDestTableAddr += sizeToCopy;
- vaSrcTableAddr += addrOffset;
- vaDestTableAddr += addrOffset;
- } // end of while loop
+ // Determine how much to copy..
+ sizeToCopy = std::min(bytesLeftInSrc, bytesLeftInDest);
- if (invalidSrcSize)
- {
- // Write an error because we have more src entries
- // then destination space available.
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: Source TableSize > 32GB");
-
- /*@
- * @errortype
- * @moduleid DUMP::DUMP_COLLECT
- * @reasoncode DUMP::DUMP_MDST_INVALID_TABLE_SIZE
- * @userdata1 Size of Source Table Entry
- * @userdata2 Size of Page Aligned Source Table Entry
- * @devdesc MDST table entry with page aligned is greater than 32GB
- */
- l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- DUMP_COLLECT,
- DUMP_MDST_INVALID_TABLE_SIZE,
- bytesLeftInSrc,
- bytesLeftInSrc + srcOffset);
- break;
+ // Do the copy of the data from the source to the destination
+ mm_tolerate_ue(1);
+ memcpy( vaDestTableAddr,vaSrcTableAddr, sizeToCopy);
+ mm_tolerate_ue(0);
+ if (curResultIndex < maxResultEntries)
+ {
+ // Update the results table
+ resultsTableEntry->srcAddr =
+ VmmManager::FORCE_PHYS_ADDR|curSrcTableAddr;
+ resultsTableEntry->destAddr =
+ VmmManager::FORCE_PHYS_ADDR|curDestTableAddr;
+ resultsTableEntry->dataSize = sizeToCopy;
+ resultsTableEntry++;
+ l_resultCount++;
+ curResultIndex++;
}
- if (invalidDestSize)
+ else
{
- // Write an error because we have more src entries
- // then destination space available.
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: Destination TableSize > 32GB");
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: not enough result table space");
/*@
* @errortype
* @moduleid DUMP::DUMP_COLLECT
- * @reasoncode DUMP::DUMP_MDDT_INVALID_TABLE_SIZE
- * @userdata1 Size of Destination Table Entry
- * @userdata2 Size of Page Aligned Destination Table Entry
- * @devdesc MDDT table entry with page aligned is greater than 32GB
+ * @reasoncode DUMP::DUMP_MDRT_INSUFFICIENT_SPACE
+ * @userdata1 Index into the MDRT
+ * @userdata2 max entries allowed given space allocated
+ * @devdesc MDRT table is not big enough to hold all
+ * entries
*/
l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
DUMP_COLLECT,
- DUMP_MDDT_INVALID_TABLE_SIZE,
- bytesLeftInDest,
- bytesLeftInDest + destOffset);
+ DUMP_MDRT_INSUFFICIENT_SPACE,
+ curResultIndex,
+ maxResultEntries);
- break;
+ // commit the error and continue.
+ errlCommit(l_err,DUMP_COMP_ID);
+
+ l_err = NULL;
}
- //Update actual count in RUNTIME
- RUNTIME::saveActualCount(RUNTIME::MS_DUMP_RESULTS_TBL,
- l_resultCount);
+ // decrement the amount copied from the source and destination
+ bytesLeftInSrc -= sizeToCopy;
+ bytesLeftInDest -= sizeToCopy;
+ uint64_t addrOffset = sizeToCopy/(sizeof (uint64_t));
- //Write actual count into memory as well
- // We know this will get whacked when FSP reloads the PHYP
- // lid, but we want it to be valid before that to allow
- // FSP code to consume the data from mainstore
- RUNTIME::writeActualCount(RUNTIME::MS_DUMP_RESULTS_TBL);
- }while(0);// end of do-while loop
+ // increment the current src and dest addresses in both the
+ // physical and virtual addresses.
+ curSrcTableAddr += sizeToCopy;
+ curDestTableAddr += sizeToCopy;
+ vaSrcTableAddr += addrOffset;
+ vaDestTableAddr += addrOffset;
+ } // end of while loop
- // Got an errorlog back from get_host_data_sections
- TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest - COMPLETE ");
- return l_err;
- }
+ if (invalidSrcSize)
+ {
+ // Write an error because we have more src entries
+ // then destination space available.
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: Source TableSize > 32GB");
+
+ /*@
+ * @errortype
+ * @moduleid DUMP::DUMP_COLLECT
+ * @reasoncode DUMP::DUMP_MDST_INVALID_TABLE_SIZE
+ * @userdata1 Size of Source Table Entry
+ * @userdata2 Size of Page Aligned Source Table Entry
+ * @devdesc MDST table entry with page aligned is
+ * greater than 32GB
+ */
+ l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ DUMP_COLLECT,
+ DUMP_MDST_INVALID_TABLE_SIZE,
+ bytesLeftInSrc,
+ bytesLeftInSrc + srcOffset);
+ break;
+
+ }
+ if (invalidDestSize)
+ {
+ // Write an error because we have more src entries
+ // then destination space available.
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: Destination TableSize > 32GB");
+
+ /*@
+ * @errortype
+ * @moduleid DUMP::DUMP_COLLECT
+ * @reasoncode DUMP::DUMP_MDDT_INVALID_TABLE_SIZE
+ * @userdata1 Size of Destination Table Entry
+ * @userdata2 Size of Page Aligned Destination Table Entry
+ * @devdesc MDDT table entry with page aligned is
+ * greater than 32GB
+ */
+ l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ DUMP_COLLECT,
+ DUMP_MDDT_INVALID_TABLE_SIZE,
+ bytesLeftInDest,
+ bytesLeftInDest + destOffset);
+
+ break;
+ }
+
+ //Update actual count in RUNTIME
+ RUNTIME::saveActualCount(RUNTIME::MS_DUMP_RESULTS_TBL,
+ l_resultCount);
+
+
+ //Write actual count into memory as well
+ // We know this will get whacked when FSP reloads the PHYP
+ // lid, but we want it to be valid before that to allow
+ // FSP code to consume the data from mainstore
+ RUNTIME::writeActualCount(RUNTIME::MS_DUMP_RESULTS_TBL);
+ }while(0);// end of do-while loop
+
+ // Got an errorlog back from get_host_data_sections
+ TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest - COMPLETE ");
+
+ return l_err;
+}
@@ -685,7 +727,8 @@ errlHndl_t doDumpCollect(void)
// Each results table entry has the Source,Destination and Size for
// each copy that is done from source to destination
- resultsTableEntry = reinterpret_cast<resultsEntry *>(resultsTableAddr);
+ resultsTableEntry =
+ reinterpret_cast<resultsEntry *>(resultsTableAddr);
TRACFCOMP(g_trac_dump,
"gethostDataPtrs SrcTableAddr = %.16x, DestTableAddr = %.16X, resultTableAddr = %.16X",
diff --git a/src/usr/dump/dumpCollect.H b/src/usr/dump/dumpCollect.H
index b7bf59c6f..6fbca9faa 100644
--- a/src/usr/dump/dumpCollect.H
+++ b/src/usr/dump/dumpCollect.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -32,11 +32,6 @@
namespace DUMP
{
- enum
- {
- RM_TOP_NIBBLE_MASK = 0x0FFFFFFFFFFFFFFFULL,
- };
-
/**
* @brief This routine retrieves first entry of the MDST, MDDT and
* MDRT and the size of each of those tables.
diff --git a/src/usr/dump/test/dumptest.H b/src/usr/dump/test/dumptest.H
index edf9a37aa..63a5f7442 100644
--- a/src/usr/dump/test/dumptest.H
+++ b/src/usr/dump/test/dumptest.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
/* */
/* p1 */
/* */
@@ -122,12 +122,14 @@ class DumpTest: public CxxTest::TestSuite
uint64_t src_data[8] = {DUMP_TEST_SRC_DATA_AREA, 64, // 450000
DUMP_TEST_SRC_DATA_AREA + 64, 64,
- DUMP_TEST_SRC_DATA_AREA + 192, 64,
+ (0x8000000000000000 | DUMP_TEST_SRC_DATA_AREA)
+ + 192, 64,
DUMP_TEST_SRC_DATA_AREA + 256, 64};
uint64_t dst_data[8] = {DUMP_TEST_DST_DATA_AREA, 64, // 460000
- DUMP_TEST_DST_DATA_AREA + 64, 64,
+ (0x8000000000000000 | DUMP_TEST_DST_DATA_AREA)
+ + 64, 64,
DUMP_TEST_DST_DATA_AREA + 256, 64,
DUMP_TEST_DST_DATA_AREA + 512, 64};
@@ -164,21 +166,21 @@ class DumpTest: public CxxTest::TestSuite
// results output data expected
uint64_t result_data[] = {
- DUMP_TEST_SRC_DATA_AREA,
- DUMP_TEST_DST_DATA_AREA,
- 64, 0,
+ 0x8000000000000000|DUMP_TEST_SRC_DATA_AREA,
+ 0x8000000000000000|DUMP_TEST_DST_DATA_AREA,
+ 64, 0,
- DUMP_TEST_SRC_DATA_AREA +64,
- DUMP_TEST_DST_DATA_AREA +64,
- 64, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA) +64,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA) +64,
+ 64, 0,
- DUMP_TEST_SRC_DATA_AREA+192,
- DUMP_TEST_DST_DATA_AREA+256,
- 64, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+192,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+256,
+ 64, 0,
- DUMP_TEST_SRC_DATA_AREA+256,
- DUMP_TEST_DST_DATA_AREA+512,
- 64, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+256,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+512,
+ 64, 0,
};
uint64_t *va_mapsrcTableAddr = 0;
@@ -389,20 +391,20 @@ class DumpTest: public CxxTest::TestSuite
// results output data expected
uint64_t result_data[] = {
- DUMP_TEST_SRC_DATA_AREA+256,
- DUMP_TEST_DST_DATA_AREA+1024, 64, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+256,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+1024, 64, 0,
- DUMP_TEST_SRC_DATA_AREA+256+64,
- DUMP_TEST_DST_DATA_AREA+1024+64, 32, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+256+64,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+1024+64, 32, 0,
- DUMP_TEST_SRC_DATA_AREA+256+64+32,
- DUMP_TEST_DST_DATA_AREA+1024+256, 32, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+256+64+32,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+1024+256, 32, 0,
- DUMP_TEST_SRC_DATA_AREA+256+128,
- DUMP_TEST_DST_DATA_AREA+1024+128, 64, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+256+128,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+1024+128, 64, 0,
- DUMP_TEST_SRC_DATA_AREA+256+128+64,
- DUMP_TEST_DST_DATA_AREA+1024+128+64, 64, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+256+128+64,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+1024+128+64, 64, 0,
};
uint64_t *va_mapsrcTableAddr = 0;
@@ -710,27 +712,27 @@ class DumpTest: public CxxTest::TestSuite
// results output data expected
- uint64_t result_data[] = {
- DUMP_TEST_SRC_DATA_AREA+1024,
- DUMP_TEST_DST_DATA_AREA+2048,
- 16, 0,
+ uint64_t result_data[] = {
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+1024,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+2048,
+ 16, 0,
- DUMP_TEST_SRC_DATA_AREA+2048,
- DUMP_TEST_DST_DATA_AREA+2048+16,
- 48, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+2048,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+2048+16,
+ 48, 0,
- DUMP_TEST_SRC_DATA_AREA+3072,
- DUMP_TEST_DST_DATA_AREA+2048+128,
- 32, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+3072,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+2048+128,
+ 32, 0,
- DUMP_TEST_SRC_DATA_AREA+4096,
- DUMP_TEST_DST_DATA_AREA+3072,
- 32, 0,
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+4096,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+3072,
+ 32, 0,
- DUMP_TEST_SRC_DATA_AREA+4096+32,
- DUMP_TEST_DST_DATA_AREA+3072+64,
- 128, 0,
- };
+ (0x8000000000000000|DUMP_TEST_SRC_DATA_AREA)+4096+32,
+ (0x8000000000000000|DUMP_TEST_DST_DATA_AREA)+3072+64,
+ 128, 0,
+ };
do
{
@@ -1184,14 +1186,16 @@ class DumpTest: public CxxTest::TestSuite
uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(destTable);
uint64_t src_data[8] = {DUMP_TEST_SRC_DATA_AREA, 64, // 450000
- DUMP_TEST_SRC_DATA_AREA + 64, 64,
+ (0x8000000000000000 | DUMP_TEST_SRC_DATA_AREA)
+ + 64, 64,
DUMP_TEST_SRC_DATA_AREA + 128, 64,
DUMP_TEST_SRC_DATA_AREA + 192, 64};
uint64_t dst_data[8] = {DUMP_TEST_DST_DATA_AREA+4096, 64, // 4601000
DUMP_TEST_DST_DATA_AREA + 4096 + 64, 64,
- DUMP_TEST_DST_DATA_AREA + 4096 + 128, 64,
+ (0x8000000000000000 | DUMP_TEST_DST_DATA_AREA)
+ + 4096 + 128, 64,
DUMP_TEST_DST_DATA_AREA + 4096 + 192, 32}; // NOTE>> TOO SMALL of a space..
OpenPOWER on IntegriCloud