Skip to content

Commit

Permalink
MPIPL: Make sure destination size does not cross 32GB
Browse files Browse the repository at this point in the history
Hostboot cannot handle MDST/MDDT entry with data size greater than 32GB
after alignment.

If destination addresses are contiguous then hostboot calculates total
destination size so that it can skip reading individual entry in destination
table. But forgot to check destination size is crossing 32GB or not. Hence in
some corner cases data collection is failing.

This patch introduces new check to make sure its not crossing 32GB
limit.

Change-Id: Ia6022fffbbda5bcd3f86c907f0b8d09158806064
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/94938
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>
  • Loading branch information
Vasant Hegde authored and Nicholas E Bofferding committed Apr 24, 2020
1 parent a9774d7 commit ae8ef5d
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/usr/dump/dumpCollect.C
Expand Up @@ -939,13 +939,26 @@ errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
curDestTableAddr = destTableEntry[curDestIndex].dataAddr;
bytesLeftInDest = destTableEntry[curDestIndex].dataSize;

destOffset = curDestTableAddr
- ALIGN_PAGE_DOWN(curDestTableAddr);

//check to see if there are contiguous destination addresses
while ((destTableEntry[curDestIndex].dataAddr +
destTableEntry[curDestIndex].dataSize) ==
destTableEntry[curDestIndex+1].dataAddr)
{
uint64_t destSize = bytesLeftInDest + destOffset;

// dataSize in dumpEntry structure is defined as a uint32_t.
// Also, DevMap currently limits the size to 32GB.
destSize += destTableEntry[curDestIndex].dataSize;
if (destSize >= THIRTYTWO_GB)
{
break;
}

curDestIndex++;
bytesLeftInDest +=destTableEntry[curDestIndex].dataSize;
bytesLeftInDest += destTableEntry[curDestIndex].dataSize;
}

// If the current dest addr or the size to copy are zero.
Expand All @@ -958,7 +971,8 @@ errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
{
// Write an error because we have more src entries
// then destination space available.
TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: not enough Destination table space");
TRACFCOMP(g_trac_dump, "HBDumpCopySrcToDest: not enough"
"Destination table space");

/*@
* @errortype
Expand Down Expand Up @@ -991,9 +1005,6 @@ errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
break;
}

destOffset = curDestTableAddr
- ALIGN_PAGE_DOWN(curDestTableAddr);

// If the data size is less then 32GB after page alignment
if (bytesLeftInDest + destOffset > THIRTYTWO_GB)
{
Expand Down

0 comments on commit ae8ef5d

Please sign in to comment.