diff options
author | Richard J. Knight <rjknight@us.ibm.com> | 2017-07-26 14:50:20 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-08-04 10:32:23 -0400 |
commit | 3fdc193a8ad53116ec675c71c720bec15b519290 (patch) | |
tree | c789950b66886f955d940756e7186ee151446f74 /src/import/hwpf/fapi2/include/error_info_defs.H | |
parent | cf6eacecbd87f3227c059a028cdb2455a77cec2f (diff) | |
download | talos-hostboot-3fdc193a8ad53116ec675c71c720bec15b519290.tar.gz talos-hostboot-3fdc193a8ad53116ec675c71c720bec15b519290.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/43710
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: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/hwpf/fapi2/include/error_info_defs.H')
-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 12198e499..c4264d107 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 /// |