diff options
author | Richard J. Knight <rjknight@us.ibm.com> | 2017-07-26 14:50:20 -0500 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2017-08-02 09:07:39 -0400 |
commit | 56eafd6a08054a09d8f816536dcbbcc0d6f9b6cf (patch) | |
tree | 286dd918c59ffdb9b2f5e90e547d826ff06ce061 /src/import/hwpf/fapi2/include | |
parent | 212481e66df41326941344daf29ebcc25f2a759e (diff) | |
download | talos-sbe-56eafd6a08054a09d8f816536dcbbcc0d6f9b6cf.tar.gz talos-sbe-56eafd6a08054a09d8f816536dcbbcc0d6f9b6cf.zip |
B1814616 - hwsvd sig:11 core dump on zzfp247
-Modified collectRegFfdc to skip register data if the passed
in target pointer is null.
-Added new RC to be used when we detect an invalid SBE
ffdc buffer.
-Updated parseErrorInfo.pl to genrate code to support logging
the new error when an invalid pointer is detected
Change-Id: I436de31738af3f2b93b5776d7ce1459c8664ebf1
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43707
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: MURULIDHAR NATARAJU <murulidhar@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43900
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import/hwpf/fapi2/include')
-rw-r--r-- | src/import/hwpf/fapi2/include/error_info_defs.H | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/src/import/hwpf/fapi2/include/error_info_defs.H b/src/import/hwpf/fapi2/include/error_info_defs.H index 7e1803d0..2f6db98c 100644 --- a/src/import/hwpf/fapi2/include/error_info_defs.H +++ b/src/import/hwpf/fapi2/include/error_info_defs.H @@ -254,30 +254,56 @@ enum CollectTrace // NOTE - this assumes no buffer_t or variable_buffers are passed // data is converted to a uint64_t when placed into the sbe ffdc // buffer -inline fapi2::ffdc_t getFfdcData( sbeFfdc_t& i_sbeFfdc ) +inline fapi2::ffdc_t getFfdcData( sbeFfdc_t& i_sbeFfdc, bool& invalid_data ) { - fapi2::ffdc_t temp; + fapi2::ffdc_t l_ffdc; - temp.size() = static_cast<size_t>(i_sbeFfdc.size); + l_ffdc.size() = static_cast<size_t>(i_sbeFfdc.size); - if(temp.size() == EI_FFDC_SIZE_TARGET) + if(l_ffdc.size() == EI_FFDC_SIZE_TARGET) { #ifdef FAPI2_ENABLE_PLATFORM_GET_TARGET uint64_t targetData = i_sbeFfdc.data; fapi2::TargetType type = static_cast<fapi2::TargetType>(targetData >> 32); uint8_t instance = static_cast<uint8_t>(targetData & 0xFFFFFFFF); // call hostboot to get the fapi2 target reference - temp.ptr() = static_cast<void*>(getTarget<TARGET_TYPE_ALL>(type, instance)); + l_ffdc.ptr() = static_cast<void*>(getTarget<TARGET_TYPE_ALL>(type, instance)); + + if(l_ffdc.ptr() == nullptr ) + { + invalid_data = true; + } + #endif } else { - // adjust the pointer based on the data size. - temp.ptr() = static_cast<void*>(reinterpret_cast<uint8_t*>(&i_sbeFfdc.data) + - (sizeof(uint64_t) - i_sbeFfdc.size)); + // validate the size in the buffer - assumes no buffers are returned + // from sbe - + switch( i_sbeFfdc.size ) + { + // valid sizes are 1,2,4 and 8 bytes only. + case 1: + case 2: + case 4: + case 8: + // data is at least a reasonable size + break; + + default: + FAPI_ERR("Invalid data size in SBE FFDC buffer"); + invalid_data = true; + } + + if(!invalid_data) + { + // adjust the pointer based on the data size. + l_ffdc.ptr() = static_cast<void*>(reinterpret_cast<uint8_t*>(&i_sbeFfdc.data) + + (sizeof(uint64_t) - i_sbeFfdc.size)); + } } - return temp; + return l_ffdc; } #endif /// |