Skip to content

Commit ae8ef5d

Browse files
Vasant HegdeNicholas E Bofferding
authored andcommitted
MPIPL: Make sure destination size does not cross 32GB
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>
1 parent a9774d7 commit ae8ef5d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/usr/dump/dumpCollect.C

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -939,13 +939,26 @@ errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
939939
curDestTableAddr = destTableEntry[curDestIndex].dataAddr;
940940
bytesLeftInDest = destTableEntry[curDestIndex].dataSize;
941941

942+
destOffset = curDestTableAddr
943+
- ALIGN_PAGE_DOWN(curDestTableAddr);
944+
942945
//check to see if there are contiguous destination addresses
943946
while ((destTableEntry[curDestIndex].dataAddr +
944947
destTableEntry[curDestIndex].dataSize) ==
945948
destTableEntry[curDestIndex+1].dataAddr)
946949
{
950+
uint64_t destSize = bytesLeftInDest + destOffset;
951+
952+
// dataSize in dumpEntry structure is defined as a uint32_t.
953+
// Also, DevMap currently limits the size to 32GB.
954+
destSize += destTableEntry[curDestIndex].dataSize;
955+
if (destSize >= THIRTYTWO_GB)
956+
{
957+
break;
958+
}
959+
947960
curDestIndex++;
948-
bytesLeftInDest +=destTableEntry[curDestIndex].dataSize;
961+
bytesLeftInDest += destTableEntry[curDestIndex].dataSize;
949962
}
950963

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

963977
/*@
964978
* @errortype
@@ -991,9 +1005,6 @@ errlHndl_t copySrcToDest(dumpEntry *srcTableEntry,
9911005
break;
9921006
}
9931007

994-
destOffset = curDestTableAddr
995-
- ALIGN_PAGE_DOWN(curDestTableAddr);
996-
9971008
// If the data size is less then 32GB after page alignment
9981009
if (bytesLeftInDest + destOffset > THIRTYTWO_GB)
9991010
{

0 commit comments

Comments
 (0)