diff options
author | Caleb Palmer <cnpalmer@us.ibm.com> | 2017-11-06 14:19:01 -0600 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2017-11-13 10:14:52 -0500 |
commit | d2f72e803860554769516382d0a7b3fa76d6456f (patch) | |
tree | d1f41bbd84aac35f32c8ae4d1249297ef7ab42f7 /src/usr | |
parent | b1f4e911b9b7408b968469826db5ffb78c978c80 (diff) | |
download | talos-hostboot-d2f72e803860554769516382d0a7b3fa76d6456f.tar.gz talos-hostboot-d2f72e803860554769516382d0a7b3fa76d6456f.zip |
PRD: Fix sym count overflow in runtime TPS
Change-Id: I69bea5ad79555c79543abf664fcae570bf3ce665
CQ: SW407268
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49315
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/49560
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C index f9e732325..324ace8f9 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C @@ -107,7 +107,13 @@ bool __badDqCount<TYPE_MCA>( MemUtils::MaintSymbols i_nibbleStats, for ( auto sumCheck : i_nibbleStats) { if ( !(symData.symbol == sumCheck.symbol) ) - sum += sumCheck.count; + { + // Check for overflow. + if ( (sum + sumCheck.count) > 0xFF ) + sum = 0xFF; + else + sum += sumCheck.count; + } } if ( sum <= 1 ) { @@ -140,7 +146,12 @@ bool __badChipCount<TYPE_MCA>( MemUtils::MaintSymbols i_nibbleStats, for ( auto symData : i_nibbleStats ) { - sum += symData.count; + // Check for overflow. + if ( (sum + symData.count) > 0xFF ) + sum = 0xFF; + else + sum += symData.count; + if ( symData.count > 0 ) nonZeroCount++; if ( symData.count >= 2 ) @@ -182,7 +193,11 @@ void __sumAboveOneCount<TYPE_MCA>( MemUtils::MaintSymbols i_nibbleStats, { if ( symData.count > 0 ) { - sum += symData.count; + if ( (sum + symData.count) > 0xFF ) + sum = 0xFF; + else + sum += symData.count; + symList.push_back(symData); } } |