From 11c79b261c9e99c227137a494bba3d3a816deb08 Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Wed, 25 Apr 2018 20:13:22 -0500 Subject: PRD: add MBA support for CE, UE, and RCE tables Change-Id: Icdf97f8ad417900d9381cb1ae89c07f5b5a9a772 RTC: 187480 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57854 Tested-by: Jenkins Server Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Matt Derksen Reviewed-by: Brian J. Stegmiller Reviewed-by: Caleb N. Palmer Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57930 CI-Ready: Zane C. Shelley Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins --- .../prdf/common/plat/mem/prdfCenMbaDataBundle.H | 9 +- .../diag/prdf/common/plat/mem/prdfMemCaptureData.C | 9 +- .../diag/prdf/common/plat/mem/prdfMemRceTable.C | 121 ++++++++++++++++++++ .../diag/prdf/common/plat/mem/prdfMemRceTable.H | 110 ++++++++++++++++++ src/usr/diag/prdf/common/plat/mem/prdf_plat_mem.mk | 1 + .../prdf/common/plat/pegasus/prdfCenMbaRceTable.C | 123 --------------------- .../prdf/common/plat/pegasus/prdfCenMbaRceTable.H | 108 ------------------ .../diag/prdf/common/plugins/prdfLogParse_common.C | 2 - src/usr/diag/prdf/common/plugins/prdfMemLogParse.C | 19 +--- 9 files changed, 247 insertions(+), 255 deletions(-) create mode 100644 src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.C create mode 100755 src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.H delete mode 100644 src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.C delete mode 100644 src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.H diff --git a/src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H b/src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H index 07fa0fd07..896ba1704 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H @@ -30,6 +30,8 @@ #include // Platform includes +#include +#include #include #include @@ -56,7 +58,8 @@ class MbaDataBundle : public DataBundle * @param i_chip The MBA chip. */ explicit MbaDataBundle( ExtensibleChip * i_chip ) : - iv_chip(i_chip), iv_ueTable(i_chip) + iv_chip(i_chip), iv_ceTable(i_chip), iv_ueTable(i_chip), + iv_rceTable(i_chip) {} /** @brief Destructor. */ @@ -154,7 +157,9 @@ class MbaDataBundle : public DataBundle public: // instance variables - MemUeTable iv_ueTable; ///< UE table for FFDC + MemCeTable iv_ceTable; ///< CE table for FFDC + MemUeTable iv_ueTable; ///< UE table for FFDC + MemRceTable iv_rceTable; ///< RCE table for FFDC #if defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C b/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C index ceab917c4..6a4c16964 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -36,6 +36,7 @@ #include // Platform includes +#include #include #include @@ -579,12 +580,11 @@ void addEccData( ExtensibleChip * i_chip, { PRDF_ASSERT( TYPE_MBA == i_chip->getType() ); -/* TODO: RTC 157888 CaptureData & cd = io_sc.service_data->GetCaptureData(); - CenMbaDataBundle * db = getMbaDataBundle( i_chip ); + MbaDataBundle * db = getMbaDataBundle( i_chip ); // Add UE table to capture data. - db->iv_ueTable.addCapData( i_chip, cd ); + db->iv_ueTable.addCapData( cd ); // Add CE table to capture data. db->iv_ceTable.addCapData( cd ); @@ -592,6 +592,7 @@ void addEccData( ExtensibleChip * i_chip, // Add RCE table to capture data. db->iv_rceTable.addCapData( cd ); +/* TODO: RTC 157888 // Add DRAM repairs data from hardware. captureDramRepairsData( i_chip->getTrgt(), cd ); diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.C b/src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.C new file mode 100644 index 000000000..9655db669 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.C @@ -0,0 +1,121 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2013,2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#include + +// Framwork includes +#include +#include +#include + +// Platform includes +#include + +using namespace TARGETING; + +namespace PRDF +{ + +using namespace RCE_TABLE; + +//------------------------------------------------------------------------------ + +bool MemRceTable::addEntry( const MemRank & i_rank, + STEP_CODE_DATA_STRUCT & i_sc, uint8_t i_count ) +{ + bool o_doTps = false; + + RceTable::iterator it = iv_table.find( i_rank ); + if ( iv_table.end() == it ) + { + TimeBasedThreshold entry( getRceThreshold() ); + + // Add a new rank entry to the table and get the iterator. + it = iv_table.insert( std::make_pair(i_rank, entry) ).first; + } + + o_doTps = it->second.inc( i_sc, i_count ); + + return o_doTps; +} + +//------------------------------------------------------------------------------ + +void MemRceTable::flushEntry( const MemRank & i_rank ) +{ + RceTable::iterator it = iv_table.find( i_rank ); + if ( iv_table.end() != it ) + it->second.reset(); +} +//------------------------------------------------------------------------------ + +void MemRceTable::addCapData( CaptureData & io_cd ) +{ + static const size_t sz_word = sizeof(CPU_WORD); + static const size_t sz_entryCnt = sizeof( uint8_t ); // entry count + + // Get the maximum capture data size and adjust the size for endianness. + const size_t sz_maxData = ((( iv_table.size() * ENTRY_SIZE + sz_entryCnt )+ + sz_word-1) / sz_word) * sz_word; + + // Initialize to 0. + uint8_t data[sz_maxData]; + memset( data, 0x00, sz_maxData ); + + // reserve first index for total entries + size_t sz_actData = sz_entryCnt; + + for ( RceTable::iterator it = iv_table.begin(); it != iv_table.end(); it++ ) + { + // skip if there is no RCE count + if ( 0 == it->second.getCount() ) + { + continue; + } + uint32_t mrnk = it->first.getMaster(); // 3-bit + uint32_t srnk = it->first.getSlave(); // 3-bit + + data[sz_actData] = (mrnk << 5) | (srnk << 2); + uint32_t count = it->second.getCount(); + data[sz_actData + 1] = ( count > 255 ) ? 255 : count; + sz_actData += ENTRY_SIZE; + } + + if ( 1 != sz_actData ) + { + data[0] = sz_actData / ENTRY_SIZE; + // Fix endianness issues with non PPC machines. + sz_actData = ((sz_actData + sz_word-1) / sz_word) * sz_word; + for ( uint32_t i = 0; i < (sz_actData/sz_word); i++ ) + ((CPU_WORD*)data)[i] = htonl(((CPU_WORD*)data)[i]); + + // Add data to capture data. + BitString bs ( sz_actData*8, (CPU_WORD *) &data ); + io_cd.Add( iv_chip->getTrgt(), Util::hashString("MEM_RCE_TABLE"), bs ); + } +} + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.H b/src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.H new file mode 100755 index 000000000..f475c38d4 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.H @@ -0,0 +1,110 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/mem/prdfMemRceTable.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2013,2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef __prdfMemRceTable_H +#define __prdfMemRceTable_H + +/** @file prdfMemRceTable.H */ + +// Framwork includes +#include +#include +#include + +// Platform includes +#include + +// Other includes +#include + +namespace PRDF +{ + +/** + * @brief A table of memory RCEs. + * @note Only one of these tables will exist per MBA. + * @note Will be used to determine when to do a TPS procedure for Targeted + * Diagnostics at runtime. Will be used for FFDC only during Hostboot. + */ +class MemRceTable +{ + + public: // functions + + /** + * @brief Constructor + * @param i_mbaTrgt An MBA target. + */ + explicit MemRceTable( ExtensibleChip * i_chip ) : + iv_chip( i_chip ) + {} + + /** + * @brief Will attempt to add a new entry to the table. + * + * If an entry already exists, the entry's count is incremented. Otherwise, + * a new entry is created. Will return TRUE if the RCE triggers TPS + * conditions: + * + * @param i_rank rank. + * @param i_sc The step code data struct. + * @param i_count RCE count. + * @return TRUE if TPS is required, FALSE otherwise. + */ + bool addEntry( const MemRank & i_rank, + STEP_CODE_DATA_STRUCT & i_sc, uint8_t i_count = 1 ); + + /** + * @brief Flush entry covered by a rank. + * @param i_rank The target rank. + */ + void flushEntry( const MemRank & i_rank ); + + /** + * @brief Gathers all table data to be stored in capture data. + * @param io_cd Capture data struct. + */ + void addCapData( CaptureData & io_cd ); + + /** Default Constructor */ + MemRceTable():iv_table(){} + + private: // structs, typedefs + + typedef std::map RceTable; + + private: // instance variables + + /** The chip associated with this table. */ + ExtensibleChip * iv_chip; + + /** A storage container for memory RCE errors. */ + RceTable iv_table; +}; + +} // end namespace PRDF + +#endif // __prdfMemRceTable_H + diff --git a/src/usr/diag/prdf/common/plat/mem/prdf_plat_mem.mk b/src/usr/diag/prdf/common/plat/mem/prdf_plat_mem.mk index 771f3359e..1a879a58b 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdf_plat_mem.mk +++ b/src/usr/diag/prdf/common/plat/mem/prdf_plat_mem.mk @@ -44,6 +44,7 @@ prd_obj += prdfMemCeTable.o prd_obj += prdfMemDqBitmap.o prd_obj += prdfMemEccAnalysis.o prd_obj += prdfMemMark.o +prd_obj += prdfMemRceTable.o prd_obj += prdfMemSymbol.o prd_obj += prdfMemoryMru.o prd_obj += prdfMemUeTable.o diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.C deleted file mode 100644 index 12c8776c5..000000000 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.C +++ /dev/null @@ -1,123 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2013,2017 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -#include - -// Framwork includes -#include -#include -#include - -// Pegasus includes -#include -#include - -using namespace TARGETING; - -namespace PRDF -{ - -using namespace RCE_TABLE; - -//------------------------------------------------------------------------------ - -bool CenMbaRceTable::addEntry( const CenRank & i_rank, - STEP_CODE_DATA_STRUCT & i_sc, uint8_t i_count ) -{ - bool o_doTps = false; - - RceTable::iterator it = iv_table.find( i_rank ); - if ( iv_table.end() == it ) - { - TimeBasedThreshold entry( getRceThreshold() ); - - // Add a new rank entry to the table and get the iterator. - it = iv_table.insert( std::make_pair(i_rank, entry) ).first; - } - - o_doTps = it->second.inc( i_sc, i_count ); - - return o_doTps; -} - -//------------------------------------------------------------------------------ - -void CenMbaRceTable::flushEntry( const CenRank & i_rank ) -{ - RceTable::iterator it = iv_table.find( i_rank ); - if ( iv_table.end() != it ) - it->second.reset(); -} -//------------------------------------------------------------------------------ - -void CenMbaRceTable::addCapData( CaptureData & io_cd ) -{ - static const size_t sz_word = sizeof(CPU_WORD); - static const size_t sz_entryCnt = sizeof( uint8_t ); // entry count - - // Get the maximum capture data size and adjust the size for endianness. - const size_t sz_maxData = ((( iv_table.size() * ENTRY_SIZE + sz_entryCnt )+ - sz_word-1) / sz_word) * sz_word; - - // Initialize to 0. - uint8_t data[sz_maxData]; - memset( data, 0x00, sz_maxData ); - - // reserve first index for total entries - size_t sz_actData = sz_entryCnt; - - for ( RceTable::iterator it = iv_table.begin(); it != iv_table.end(); it++ ) - { - // skip if there is no RCE count - if ( 0 == it->second.getCount() ) - { - continue; - } - uint32_t mrnk = it->first.getMaster(); // 3-bit - uint32_t srnk = it->first.getSlave(); // 3-bit - uint32_t svld = it->first.isSlaveValid() ? 1 : 0; // 1-bit - - data[sz_actData] = (mrnk << 5) | (srnk << 2) | (svld << 1); - uint32_t count = it->second.getCount(); - data[sz_actData + 1] = ( count > 255 ) ? 255 : count; - sz_actData += ENTRY_SIZE; - } - - if ( 1 != sz_actData ) - { - data[0] = sz_actData / ENTRY_SIZE; - // Fix endianness issues with non PPC machines. - sz_actData = ((sz_actData + sz_word-1) / sz_word) * sz_word; - for ( uint32_t i = 0; i < (sz_actData/sz_word); i++ ) - ((CPU_WORD*)data)[i] = htonl(((CPU_WORD*)data)[i]); - - // Add data to capture data. - BitString bs ( sz_actData*8, (CPU_WORD *) &data ); - io_cd.Add( iv_mbaTrgt, Util::hashString("MEM_RCE_TABLE"), bs ); - } -} - -} // end namespace PRDF - diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.H deleted file mode 100644 index ea3382b90..000000000 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.H +++ /dev/null @@ -1,108 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaRceTable.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ -/* [+] International Business Machines Corp. */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ - -#ifndef __prdfCenMbaRceTable_H -#define __prdfCenMbaRceTable_H - -/** @file prdfCenMbaRceTable.H */ - -// Framwork includes -#include -#include -#include - -// Other includes -#include - -namespace PRDF -{ -class CenRank; - -/** - * @brief A table of memory RCEs. - * @note Only one of these tables will exist per MBA. - * @note Will be used to determine when to do a TPS procedure for Targeted - * Diagnostics at runtime. Will be used for FFDC only during Hostboot. - */ -class CenMbaRceTable -{ - - public: // functions - - /** - * @brief Constructor - * @param i_mbaTrgt An MBA target. - */ - explicit CenMbaRceTable( TARGETING::TargetHandle_t i_mbaTrgt ) : - iv_mbaTrgt( i_mbaTrgt ) - {} - - /** - * @brief Will attempt to add a new entry to the table. - * - * If an entry already exists, the entry's count is incremented. Otherwise, - * a new entry is created. Will return TRUE if the RCE triggers TPS - * conditions: - * - * @param i_rank rank. - * @param i_sc The step code data struct. - * @param i_count RCE count. - * @return TRUE if TPS is required, FALSE otherwise. - */ - bool addEntry( const CenRank & i_rank, - STEP_CODE_DATA_STRUCT & i_sc, uint8_t i_count = 1 ); - - /** - * @brief Flush entry covered by a rank. - * @param i_rank The target rank. - */ - void flushEntry( const CenRank & i_rank ); - - /** - * @brief Gathers all table data to be stored in capture data. - * @param io_cd Capture data struct. - */ - void addCapData( CaptureData & io_cd ); - - /** Default Constructor */ - CenMbaRceTable():iv_table(){} - - private: // structs, typedefs - - typedef std::map RceTable; - - private: // instance variables - - /** MBA associated with this table. */ - TARGETING::TargetHandle_t iv_mbaTrgt; - - /** A storage container for memory RCE errors. */ - RceTable iv_table; -}; - -} // end namespace PRDF - -#endif // __prdfCenMbaRceTable_H - diff --git a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C index 66a3339b0..21355d8b4 100644 --- a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C +++ b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C @@ -453,12 +453,10 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen, { parseIueCounts( sigData, sigDataSize, i_parser ); } -/* TODO: RTC 157888 else if ( Util::hashString("MEM_RCE_TABLE") == sigId ) { parseMemRceTable( sigData, sigDataSize, i_parser ); } -*/ else if ( Util::hashString("DRAM_REPAIRS_DATA") == sigId ) { parseDramRepairsData( sigData, sigDataSize, i_parser ); diff --git a/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C b/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C index 8f71d5111..92eab3f01 100644 --- a/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C +++ b/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2017 */ +/* Contributors Listed Below - COPYRIGHT 2013,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -3229,7 +3229,6 @@ bool parseIueCounts( uint8_t * i_buffer, uint32_t i_buflen, //------------------------------------------------------------------------------ -/* TODO RTC 157888 bool parseMemRceTable( uint8_t * i_buffer, uint32_t i_buflen, ErrlUsrParser & i_parser ) { @@ -3249,23 +3248,12 @@ bool parseMemRceTable( uint8_t * i_buffer, uint32_t i_buflen, uint32_t mrnk = (i_buffer[idx ] >> 5) & 0x7; // 3-bit uint32_t srnk = (i_buffer[idx ] >> 2) & 0x7; // 3-bit - uint32_t svld = (i_buffer[idx ] >> 1) & 0x1; // 1-bit uint32_t count = i_buffer[idx+1]; // 8-bit - // Get the rank string. - char rank_str[DATA_SIZE] = ""; - if ( 1 == svld ) - { - snprintf( rank_str, DATA_SIZE, "m%ds%d", mrnk, srnk ); - } - else - { - snprintf( rank_str, DATA_SIZE, "m%d ", mrnk ); - } - // Build the data string. char data[DATA_SIZE] = ""; - snprintf( data, DATA_SIZE, "rank = %s count = %d", rank_str, count ); + snprintf( data, DATA_SIZE, "rank = m%ds%d count = %d", + mrnk, srnk, count ); // Print the line. i_parser.PrintString( "", data ); @@ -3273,7 +3261,6 @@ bool parseMemRceTable( uint8_t * i_buffer, uint32_t i_buflen, return rc; } -*/ //------------------------------------------------------------------------------ -- cgit v1.2.1