From 1ff9bbea76be1abe3a861706aa55ad1bd873a175 Mon Sep 17 00:00:00 2001 From: Benjamin Weisenbeck Date: Wed, 7 Sep 2016 14:38:13 -0500 Subject: PRD: Initial L3 Line Delete This commit performs L3 line deletes by setting the delete-on-next-ce bit. Change-Id: I542d9527b91640902c4d62a4fb2a4a2c69313819 RTC: 155327 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29338 Tested-by: Jenkins Server Reviewed-by: Caleb N. Palmer Reviewed-by: Brian J. Stegmiller Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29973 Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/usr/diag/prdf/common/plat/p9/p9_ex.rule | 4 +- .../diag/prdf/common/plat/p9/p9_ex_actions.rule | 8 ++ src/usr/diag/prdf/common/plat/p9/p9_ex_regs.rule | 35 +++++ src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C | 90 +++++++++++++ src/usr/diag/prdf/common/plat/p9/prdfLineDelete.H | 146 +++++++++++++++++++++ src/usr/diag/prdf/common/plat/p9/prdfP9Ex.C | 134 +++++++++++++++++++ .../diag/prdf/common/plat/p9/prdfP9ExDataBundle.H | 103 +++++++++++++++ .../diag/prdf/common/plat/p9/prdfP9ExExtraSig.H | 39 ++++++ src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk | 2 + .../diag/prdf/common/plat/pegasus/prdfLineDelete.C | 90 ------------- .../diag/prdf/common/plat/pegasus/prdfLineDelete.H | 146 --------------------- 11 files changed, 560 insertions(+), 237 deletions(-) create mode 100644 src/usr/diag/prdf/common/plat/p9/p9_ex_regs.rule create mode 100755 src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C create mode 100755 src/usr/diag/prdf/common/plat/p9/prdfLineDelete.H create mode 100644 src/usr/diag/prdf/common/plat/p9/prdfP9Ex.C create mode 100755 src/usr/diag/prdf/common/plat/p9/prdfP9ExDataBundle.H create mode 100644 src/usr/diag/prdf/common/plat/p9/prdfP9ExExtraSig.H delete mode 100755 src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C delete mode 100755 src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.H (limited to 'src') diff --git a/src/usr/diag/prdf/common/plat/p9/p9_ex.rule b/src/usr/diag/prdf/common/plat/p9/p9_ex.rule index ac67dea03..b01fb5d4e 100644 --- a/src/usr/diag/prdf/common/plat/p9/p9_ex.rule +++ b/src/usr/diag/prdf/common/plat/p9/p9_ex.rule @@ -31,6 +31,8 @@ chip p9_ex dump DUMP_CONTENT_HW; scomlen 64; +.include "prdfP9ExExtraSig.H"; + ############################################################################# # # # ###### # @@ -596,7 +598,7 @@ group gL3FIR filter singlebit /** L3FIR[4] * */ - (rL3FIR, bit(4)) ? defaultMaskedError; + (rL3FIR, bit(4)) ? l3_cache_ce; /** L3FIR[5] * diff --git a/src/usr/diag/prdf/common/plat/p9/p9_ex_actions.rule b/src/usr/diag/prdf/common/plat/p9/p9_ex_actions.rule index 674e40eca..628ff13c9 100644 --- a/src/usr/diag/prdf/common/plat/p9/p9_ex_actions.rule +++ b/src/usr/diag/prdf/common/plat/p9/p9_ex_actions.rule @@ -35,3 +35,11 @@ actionclass self_M_level2_L_th_1 callout2ndLvlLow; threshold1; }; + +actionclass l3_cache_ce +{ + calloutSelfHigh; + threshold( field(32 / day), mfg_file(ATTR_MNFG_TH_P8EX_L3_CACHE_CES) ); + funccall("L3CE"); +}; + diff --git a/src/usr/diag/prdf/common/plat/p9/p9_ex_regs.rule b/src/usr/diag/prdf/common/plat/p9/p9_ex_regs.rule new file mode 100644 index 000000000..f38639379 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/p9_ex_regs.rule @@ -0,0 +1,35 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/diag/prdf/common/plat/p9/p9_ex_regs.rule $ +# +# 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 +############################################################################### +# Additional registers for EX, not defined in XML +############################################################################### + + register L3_PURGE_REG + { + name "L3 PRD Purge Register"; + scomaddr 0x1001180E; + capture group never; + }; + diff --git a/src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C b/src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C new file mode 100755 index 000000000..f8099ceb0 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C @@ -0,0 +1,90 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2005,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 +#include +#include + +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/p9/prdfLineDelete.H b/src/usr/diag/prdf/common/plat/p9/prdfLineDelete.H new file mode 100755 index 000000000..8cad7dc9b --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfLineDelete.H @@ -0,0 +1,146 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfLineDelete.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2005,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 +#include +#include +#include + +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 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/p9/prdfP9Ex.C b/src/usr/diag/prdf/common/plat/p9/prdfP9Ex.C new file mode 100644 index 000000000..15a868b94 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9Ex.C @@ -0,0 +1,134 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9Ex.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 */ +// Framework includes +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace PRDF +{ +namespace p9_ex +{ + +/** + * @brief Plugin that initializes the EX data bundle. + * @param i_exChip An ex chip. + * @return SUCCESS + */ +int32_t Initialize( ExtensibleChip * i_exChip ) +{ + i_exChip->getDataBundle() = new P9ExDataBundle( i_exChip ); + return SUCCESS; +} +PRDF_PLUGIN_DEFINE( p9_ex, Initialize ); + +/** + * @brief Handle an L3 CE + * @param i_chip Ex chip. + * @param i_stepcode Step Code data struct + * @return PRD return code + */ +int32_t L3CE( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & i_stepcode ) +{ + P9ExDataBundle * l_bundle = getExDataBundle(i_chip); + uint16_t l_maxL3LineDelAllowed = 0; + + + l_maxL3LineDelAllowed = + MfgThresholdMgr::getInstance()->getThreshold(PlatServices::mfgMode() ? + TARGETING::ATTR_MNFG_TH_P8EX_L3_LINE_DELETES: + TARGETING::ATTR_FIELD_TH_P8EX_L3_LINE_DELETES); + + // MfgThresholdMgr treats 0 as a special value for infinite threshold + // For this threshold, we want 0 to really represent 0 repairs allowed + if (l_maxL3LineDelAllowed == MfgThreshold::INFINITE_LIMIT_THR) + l_maxL3LineDelAllowed = 0; + + // Ensure we're still allowed to issue repairs + if ((l_bundle->iv_L3LDCount < l_maxL3LineDelAllowed) && + (CHECK_STOP != i_stepcode.service_data->getPrimaryAttnType())) + { + // Add to CE table and Check if we need to issue a repair on this CE + bool l_doDelete = + l_bundle->iv_L3CETable->addAddress(l_bundle->iv_L3LDCount, + i_stepcode); + + if (l_doDelete) + { + l_bundle->iv_L3LDCount++; + + // Do Delete + PRDF_TRAC( "[L3CE] HUID: 0x%08x apply line delete", + i_chip->GetId()); + + SCAN_COMM_REGISTER_CLASS * prgReg = + i_chip->getRegister("L3_PURGE_REG"); + + prgReg->clearAllBits(); + prgReg->SetBit(5); + + if (SUCCESS != prgReg->Write() ) + { + PRDF_ERR( "[L3CE] HUID: 0x%08x l3LineDelete failed", + i_chip->GetId()); + // Set signature to indicate L3 Line Delete failed + i_stepcode.service_data->SetErrorSig( + PRDFSIG_P9EX_L3CE_LD_FAILURE); + } + else + { + // Set signature to indicate L3 Line Delete issued + i_stepcode.service_data->SetErrorSig( + PRDFSIG_P9EX_L3CE_LD_ISSUED); + } + } + } + else + { + PRDF_TRAC( "[L3CE] HUID: 0x%08x No more repairs allowed", + i_chip->GetId()); + + // MFG wants to be able to ignore these errors + // If they have LD and array repairs set to 0, wait for + // predictive threshold + if (!PlatServices::mfgMode() || + l_maxL3LineDelAllowed != 0 ) + { + i_stepcode.service_data->SetThresholdMaskId(0); + } + } + + return SUCCESS; +} PRDF_PLUGIN_DEFINE(p9_ex, L3CE); + +} +} diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9ExDataBundle.H b/src/usr/diag/prdf/common/plat/p9/prdfP9ExDataBundle.H new file mode 100755 index 000000000..9e23d8dc0 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9ExDataBundle.H @@ -0,0 +1,103 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9ExDataBundle.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2013,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 _PRDFP9EXDATABUNDLE_H +#define _PRDFP9EXDATABUNDLE_H + +/** @file prdfP9ExDataBundle.H + * @brief Contains the data bundle for a P9 Ex object. + */ + +#include +#include +#include +#include +#include +#include + +namespace PRDF +{ + +/** + * @brief The P9 EX data bundle. + */ +class P9ExDataBundle : public DataBundle +{ + public: // functions + + /** + * @brief Constructor. + * @param i_exChip The ex chip. + */ + explicit P9ExDataBundle( ExtensibleChip * i_exChip ) : + iv_L2LDCount(0), iv_L3LDCount(0), + iv_exChip(i_exChip) + { + // Set up thresholds for line deletes. + iv_L2CETable = new LineDelete::PrdfCacheCETable( + ThresholdResolution::ThresholdPolicy(PlatServices::mfgMode() ? 1 : 2, + ThresholdResolution::ONE_DAY)); + iv_L3CETable = new LineDelete::PrdfCacheCETable( + ThresholdResolution::ThresholdPolicy(PlatServices::mfgMode() ? 1 : 2, + ThresholdResolution::ONE_DAY)); + }; + + /** + * @brief Destructor. + */ + ~P9ExDataBundle() + { + delete iv_L2CETable; + delete iv_L3CETable; + }; + // Current counts for L2 line deletes. + uint8_t iv_L2LDCount; + LineDelete::PrdfCacheCETable * iv_L2CETable; + + // Current counts for L3 line deletes. + uint8_t iv_L3LDCount; + LineDelete::PrdfCacheCETable * iv_L3CETable; + + private: + ExtensibleChip * iv_exChip; ///< This ex chip + + P9ExDataBundle( const P9ExDataBundle & ); + const P9ExDataBundle & operator=( const P9ExDataBundle & ); + +}; + +/** + * @brief Wrapper function for the P9ExDataBundle. + * @param i_exChip The ex chip. + * @return This ex's data bundle. + */ +inline P9ExDataBundle * getExDataBundle( ExtensibleChip * i_exChip ) +{ + return static_cast(i_exChip->getDataBundle()); +} + +} // end namespace PRDF + +#endif /* _PRDFP9EXDATABUNDLE_H */ diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9ExExtraSig.H b/src/usr/diag/prdf/common/plat/p9/prdfP9ExExtraSig.H new file mode 100644 index 000000000..b12f8616e --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfP9ExExtraSig.H @@ -0,0 +1,39 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9ExExtraSig.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 __prdfP9ExExtraSig_H +#define __prdfP9ExExtraSig_H + +#include + +PRDR_ERROR_SIGNATURE( P9EX_L2CE_LD_ISSUED, 0x0fff0000, "L2FIR[0]", + "L2 Cache Read CE, Line Delete Issued"); +PRDR_ERROR_SIGNATURE( P9EX_L2CE_LD_FAILURE, 0x0fff0001, "L2FIR[0]", + "L2 Cache Read CE, Line Delete Failed"); +PRDR_ERROR_SIGNATURE( P9EX_L3CE_LD_ISSUED, 0x0fff0005, "L3FIR[4]", + "L3 Cache Read CE, Line Delete Issued"); +PRDR_ERROR_SIGNATURE( P9EX_L3CE_LD_FAILURE, 0x0fff0006, "L3FIR[4]", + "L3 Cache Read CE, Line Delete Failed"); +#endif // __prdfP9ExExtraSig_H + diff --git a/src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk b/src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk index da5d7b320..cc0cfba8e 100644 --- a/src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk +++ b/src/usr/diag/prdf/common/plat/p9/prdf_plat_p9.mk @@ -42,9 +42,11 @@ prd_obj += prdfP9Configurator.o prd_obj += prdfP9PllDomain.o prd_obj += prdfFsiCapUtil.o prd_obj += prdfP9ProcDomain.o +prd_obj += prdfLineDelete.o # rule plugin related prd_rule_plugin += prdfP9Proc.o prd_rule_plugin += prdfP9Pll.o prd_rule_plugin += prdfCommonPlugins.o +prd_rule_plugin += prdfP9Ex.o diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C b/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C deleted file mode 100755 index e94bab4a7..000000000 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.C +++ /dev/null @@ -1,90 +0,0 @@ -/* 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 -#include -#include - -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 deleted file mode 100755 index 4e0fbcb95..000000000 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfLineDelete.H +++ /dev/null @@ -1,146 +0,0 @@ -/* 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 -#include -#include -#include - -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 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 - -- cgit v1.2.1