diff options
Diffstat (limited to 'src/usr/diag/prdf/common/plat/pegasus')
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C | 90 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.H | 146 | ||||
-rwxr-xr-x | src/usr/diag/prdf/common/plat/pegasus/prdfTOD.H | 54 |
3 files changed, 290 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C b/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C new file mode 100755 index 000000000..e94bab4a7 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C @@ -0,0 +1,90 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 */ + +/** @file prdfLineDelete.C + * Contains the definitions needed for the line delete algorithms and the CE + * table. + */ + + +#include <prdfLineDelete.H> +#include <iipServiceDataCollector.h> +#include <prdfBitString.H> + +namespace PRDF +{ + +// See prdfLineDelete.H for full function documentation. +namespace LineDelete +{ + + /* PrdfCacheCETable::addAddress + * Insert address into CE table. + */ + bool PrdfCacheCETable::addAddress( PrdfCacheAddress i_addr, + STEP_CODE_DATA_STRUCT & i_sdc ) + { + // Get the time of the current error. + Timer timeOfError = i_sdc.service_data->GetTOE(); + + // Check if time interval has elapsed. If so, flush the table. + if ( (timeOfError > cv_flushTimer) || !cv_flushTimerInited ) + { + this->flushTable(); + cv_flushTimer = timeOfError + iv_thPolicy.interval; + cv_flushTimerInited = true; + } + + // Increment address hit count. + uint32_t count = ++cv_ceTable[i_addr]; + + // Return whether the address threshold has been reached or not. + return ( iv_thPolicy.threshold <= count ); + } + + /* PrdfCacheCETable::isIntervalElapsed() + */ + bool PrdfCacheCETable::isIntervalElapsed( STEP_CODE_DATA_STRUCT & i_sdc ) + { + bool o_rc = false; + if ( cv_flushTimerInited ) + o_rc = ( i_sdc.service_data->GetTOE() > cv_flushTimer ); + return o_rc; + } + + /* PrdfCacheCETable::flushTable() + * Clear all entries from CE table. + */ + void PrdfCacheCETable::flushTable() + { + // wipe interval timer and clear all hits. + cv_flushTimerInited = false; + cv_ceTable.clear(); + } + +}; + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.H b/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.H new file mode 100755 index 000000000..4e0fbcb95 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.H @@ -0,0 +1,146 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 */ + +/** @file prdfLineDelete.H + * Contains the definitions needed for the line delete algorithms and the CE + * table. + */ + +#ifndef __PRDFLINEDELETE_H +#define __PRDFLINEDELETE_H + +#include <UtilSMap.H> +#include <prdfThresholdResolutions.H> +#include <iipstep.h> +#include <iipCaptureData.h> + +namespace PRDF +{ + +/** @namespace LineDelete + * Namespace to encapsulate all of the LineDelete specific classes and enums. + */ +namespace LineDelete +{ + + /** @enum CacheType + * Used to express where a cache error occurred. + */ + enum CacheType + { + L3 = 0, + L3_DIR = 1, + L2 = 2, + L2_DIR = 4, + CACHE_MASK = L3 | L3_DIR | L2 | L2_DIR, + + SLICE_A = 8, + SLICE_B = 16, + SLICE_MASK = SLICE_A | SLICE_B + }; + + /** @enum CacheErrorType + * Used to express the types of cache errors that can occur. + */ + enum CacheErrorType + { + UE, CE + }; + + /** @typedef PrdfCacheAddress + * Used to index cache error hits in the CE table. + */ + typedef uint32_t PrdfCacheAddress; + + /** @typedef PrdfCacheAddressTable + * Maps Cache Addresses to hit counts. + */ + typedef UtilSMap<PrdfCacheAddress, uint32_t> PrdfCacheAddressTable; + + /** @class PrdfCacheCETable + * Used to store and threshold cache CE errors. + * + * Takes a threshold policy (such as "2 per day") and allows that many hits + * per address before signalling "at threshold". (the 2nd occurrence would + * be the at threshold). + * + * @note This is now being used for eRepair as well as cache CEs. + */ + class PrdfCacheCETable + { + public: + + /** Default constructor */ + PrdfCacheCETable() {} + + /** + * @brief Constructor from ThresholdPolicy struct. + * @param i_thPolicy A pointer to a ThresholdPolicy struct. + */ + explicit PrdfCacheCETable( + const ThresholdResolution::ThresholdPolicy i_thPolicy ) : + iv_thPolicy(i_thPolicy), cv_flushTimerInited(false) + {} + + // NOTE: iv_thPolicy should never be deleted in this class so the + // default destructor will be sufficient. + + /** @fn addAddress + * Insert an address into the CE table. + * + * @param The CE address. + * @param The Service Data Collector to get the current time. + * + * @return true - if the threshold policy has been reached. + * @return false - if the threshold policy has not been reached. + */ + bool addAddress(PrdfCacheAddress, STEP_CODE_DATA_STRUCT &); + + /** @fn PrdfCacheCETable::isIntervalElapsed() + * @param STEP_CODE_DATA_STRUCT & i_sdc + * @return TRUE if the interval time has elapsed. + */ + bool isIntervalElapsed( STEP_CODE_DATA_STRUCT & i_sdc ); + + /** @fn flushTable + * Clear all CE hits from the table and reset timer to 0. + */ + void flushTable(); + + private: + + ThresholdResolution::ThresholdPolicy iv_thPolicy; + PrdfCacheAddressTable cv_ceTable; + Timer cv_flushTimer; + bool cv_flushTimerInited; + + }; + +}; + +} // end namespace PRDF + +#endif + diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfTOD.H b/src/usr/diag/prdf/common/plat/pegasus/prdfTOD.H new file mode 100755 index 000000000..38ad4dc5e --- /dev/null +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfTOD.H @@ -0,0 +1,54 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfTOD.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] 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 PRDFTOD_H +#define PRDFTOD_H + +namespace PRDF +{ + +/** @struct PrdfTodFaultData + * TOD Fault isolation information from a chip. + */ +struct PrdfTodFaultData +{ + TARGETING::TargetHandle_t source_chipHandle; + bool phyp_fault; + bool topo_fault[2]; // 0 is active, 1 is backup + bool topo_fault_clock[2]; + TARGETING::TargetHandle_t topo_fault_chip[2]; +}; + +int32_t prdfP7_TodCaptureRegisters(STEP_CODE_DATA_STRUCT & i_stepcode); +int32_t prdfP7_TodCleanUpErrors(STEP_CODE_DATA_STRUCT & i_stepcode); +int32_t prdfP7_TodCollectFaultDataSys(vector<PrdfTodFaultData> & o_faults, + STEP_CODE_DATA_STRUCT & i_stepcode); +int32_t prdfP7_TodCollectFaultDataChip(ExtensibleChip * i_chip, + vector<PrdfTodFaultData> & o_faults, + STEP_CODE_DATA_STRUCT & i_stepcode); + +} // end namespace PRDF + +#endif //PRDFTOD_H |