diff options
author | Martin Peschke <mpeschke@de.ibm.com> | 2017-03-01 18:21:45 +0100 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2017-03-07 06:26:01 -0500 |
commit | fa287293c9bd0cc7d5371a943c0288cc3af228a7 (patch) | |
tree | 4be1680b9a22ce11a3fbb19ae393982bbcf469ea /src/import/chips | |
parent | 935272f76f4c3dc7b92d789c21e4a3c8e181a2c5 (diff) | |
download | talos-sbe-fa287293c9bd0cc7d5371a943c0288cc3af228a7.tar.gz talos-sbe-fa287293c9bd0cc7d5371a943c0288cc3af228a7.zip |
p9_tor: fix some random bytes in TOR image
There are 4 padding bytes needed for an 8 byte alignment at the end
of the TOR slot array for PERV common rings, which sometimes
exhibited non-zero content. These could have been mistaken as
valid offsets pointing to rings that didn't exist in the image,
if a users assumed a 16th PERV common ring, which might be added
in the future.
The original code used an array and a loop - which didn't account
for padding bytes - to zero all slots. A following memcpy() - which
accounted for padding bytes - copied bytes beyound the array boundary.
This code was a total mess anyway, and hence it is replaced by single
memset(), which uses a corrected size value.
This problem was only found in the function used for ring slots.
Nevertheless, similar code has been cleaned up for two other
use cases.
Change-Id: I1c81518ff81a6af735240090cdbc7735f60f3edb
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37287
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Claus M. Olsen <cmolsen@us.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@de.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37292
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/chips')
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_tor.H | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/import/chips/p9/utils/imageProcs/p9_tor.H b/src/import/chips/p9/utils/imageProcs/p9_tor.H index 1ce024ad..ff4ecee7 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_tor.H +++ b/src/import/chips/p9/utils/imageProcs/p9_tor.H @@ -56,6 +56,12 @@ typedef struct uint32_t TorPpeBlockSize; } TorPpeBlock_t; +typedef struct +{ + uint32_t commonOffset; + uint32_t instanceOffset; +} TorCpltBlock_t; + typedef uint16_t TorRingOffset_t; // Ring offset value in TOR offset slot #define TOR_SUCCESS 0 |