Skip to content

Commit

Permalink
PRD: runtime VCM support
Browse files Browse the repository at this point in the history
Change-Id: Ibeb45ceb1a2d0db1e3941b5b8ac5f9e2f5122770
RTC: 171913
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40942
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Squashed: I85a0240782b2985797a2ace1aa3eb9a9a18cb621
Squashed: I1663ee55509348cdaddf216d0b3c9ac527c21113
Squashed: Ib9a3bef7a4df3b1b2a5914cf4155dca569c11026
Squashed: I3739b49f17a5413a0ad9c3adfd555f74b91895cc
Squashed: Ifc2e4501775a09ad06381970ba47be5b953312d8
Squashed: Id7f5648ed810f9505acecea99cb27af2d832a669
Squashed: I0ec33104ac7920282482e79c2376d115a1274b46
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41040
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Jun 8, 2017
1 parent bf3f409 commit e1929d0
Show file tree
Hide file tree
Showing 12 changed files with 792 additions and 240 deletions.
8 changes: 7 additions & 1 deletion src/usr/diag/prdf/common/plat/mem/prdfMemRank.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -87,6 +87,12 @@ class MemRank
/** @return The master rank select. */
uint8_t getRankSlct() const { return iv_mrnk & 0x3; }

/** @return This value will mostly be used for traces. The first nibble will
* contain the master rank, including DIMM select. The second
* nibble will contain the slave rank. For example, 0x41 will be
* master rank 4, slave rank 1. */
uint8_t getKey() const { return getMaster() << 4 | getSlave(); }

/** @brief '==' operator */
bool operator==( const MemRank & i_rank ) const
{
Expand Down
1 change: 1 addition & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfP9McaExtraSig.H
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ PRDR_ERROR_SIGNATURE(MaintMPE, 0xffff0012, "", "Maintenance MPE");
PRDR_ERROR_SIGNATURE(MaintHARD_CTE, 0xffff0013, "", "Maintenance HARD CTE");
PRDR_ERROR_SIGNATURE(MaintSOFT_CTE, 0xffff0014, "", "Maintenance SOFT CTE");
PRDR_ERROR_SIGNATURE(MaintINTER_CTE, 0xffff0015, "", "Maintenance INTER CTE");
PRDR_ERROR_SIGNATURE(MaintRETRY_CTE, 0xffff0016, "", "Maintenance RETRY CTE");

PRDR_ERROR_SIGNATURE(VcmVerified, 0xffff0020, "", "VCM: verified");
PRDR_ERROR_SIGNATURE(VcmFalseAlarm, 0xffff0021, "", "VCM: false alarm");
Expand Down
95 changes: 95 additions & 0 deletions src/usr/diag/prdf/plat/mem/prdfMemTdFalseAlarm.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/plat/mem/prdfMemTdFalseAlarm.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 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 */

#ifndef __prdfMemTdFalseAlarm_H
#define __prdfMemTdFalseAlarm_H

#ifdef __HOSTBOOT_RUNTIME // All of this code is runtime only

// Framework includes
#include <iipServiceDataCollector.h>
#include <prdfThresholdUtils.H>

// Other includes
#include <map>

namespace PRDF
{

/**
* @brief At runtime, we have to keep a false alarm threshold for Targeted
* Diagnostics to avoid flooding of intermittent errors.
*
* This class is intented to be a static class variable for each TD event class
* that requires this type of thresholding. It will contain a map for each chip
* and unique key within each chip to the threshold container. Note that the key
* could be different per TD event class. For example, VCM events will use only
* the master rank, where TPS events will use both the master and slave rank.
*/
class TdFalseAlarm
{
public:

/**
* @brief Constructor.
* @param i_th Threshold value for all entries in the map.
* @param i_int Threshold interval for all entries in the map.
*/
TdFalseAlarm( uint8_t i_th, uint32_t i_int ) :
iv_thVal(i_th), iv_thInt(i_int)
{}

/**
* @brief Increments the false alarm count.
* @param i_chip Target chip.
* @param i_key Key relative to the chip.
* @param io_sc The step code data struct.
* @return True if false alarm count has reached threshold, false otherwise.
*/
bool inc( ExtensibleChip * i_chip, uint32_t i_key,
STEP_CODE_DATA_STRUCT & io_sc )
{
// Create a new entry if an entry does not exist.
if ( iv_map[i_chip].end() == iv_map[i_chip].find(i_key) )
iv_map[i_chip][i_key] = TimeBasedThreshold( iv_thVal, iv_thInt );

return iv_map[i_chip][i_key].inc( io_sc );
}

private:

const uint8_t iv_thVal; ///< Threshold value for all entries in the map.
const uint32_t iv_thInt; ///< Threshold interval for all entries in the map.

/** A nested map containing the thresholds for each chip and key. */
std::map< ExtensibleChip *, std::map<uint32_t,TimeBasedThreshold> > iv_map;
};

} // end namespace PRDF

#endif // __HOSTBOOT_RUNTIME

#endif // __prdfMemTdFalseAlarm_H

34 changes: 19 additions & 15 deletions src/usr/diag/prdf/plat/mem/prdfMemTdQueue.H
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,25 @@ class TdEntry
* @brief Each entry will have a set of steps that need to be performed.
* This function tells the procedure to move onto the next step.
* @param io_sc The step code data struct.
* @param o_done Returns true if this procedure is complete, false
* @param o_done True if the procedure is complete or has aborted, false
* otherwise.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
virtual uint32_t nextStep( STEP_CODE_DATA_STRUCT & io_sc,
bool & o_done ) = 0;

/** @return Each event type will have a unique key identifier used for each
* procedure. The value is arbitrary. The only requirement is that
* it is unique to the hardware it is targeting. For example, VCM
* events will use only the master rank, where TPS events will use
* both the master and slave rank. */
virtual uint32_t getKey() const = 0;

/** @brief '==' operator */
bool operator==( const TdEntry & i_e ) const
{
return ( this->iv_chip == i_e.iv_chip &&
this->iv_tdType == i_e.iv_tdType &&
this->iv_rank == i_e.iv_rank );
return ( this->iv_tdType == i_e.iv_tdType &&
this->getKey() == i_e.getKey() );
}

/**
Expand Down Expand Up @@ -126,21 +132,19 @@ class TdEntry
* @param i_rank Target rank
*/
TdEntry( TdType i_tdType, ExtensibleChip * i_chip, MemRank i_rank ) :
iv_chip(i_chip), iv_tdType(i_tdType), iv_rank(i_rank)
{
PRDF_ASSERT( (TARGETING::TYPE_MCA == iv_chip->getType()) ||
(TARGETING::TYPE_MBA == iv_chip->getType()) );
}
iv_tdType(i_tdType), iv_chip(i_chip), iv_rank(i_rank)
{}

protected: // instance variables

/** The chip associated with this entry. This isn't used for any
* comparisons, but is needed for every TD procedure. */
ExtensibleChip * const iv_chip;

const TdType iv_tdType; ///< The event type (see enum TdType).
const MemRank iv_rank; ///< The rank in which this event occurred.
const TdType iv_tdType; ///< The event type (see enum TdType).
Phase iv_phase = TD_PHASE_0; ///< The event phase (see enum Phase).

// These are not used for comparisons, but used by all procedures and also
// used for displaying FFDC in the TD controller.
ExtensibleChip * const iv_chip; ///< The chip in which this event occurred.
const MemRank iv_rank; ///< The rank in which this event occurred.

};

//------------------------------------------------------------------------------
Expand Down
9 changes: 8 additions & 1 deletion src/usr/diag/prdf/plat/mem/prdfMemTps.H
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ class TpsEvent : public TdEntry
*/
TpsEvent<T>( ExtensibleChip * i_chip, MemRank i_rank, bool i_ban = false ) :
TdEntry(TPS_EVENT, i_chip, i_rank)
{}
{
PRDF_ASSERT( nullptr != i_chip );
PRDF_ASSERT( T == i_chip->getType() );
}

public: // overloaded functions from parent class

uint32_t nextStep( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done );

uint32_t getKey() const { return iv_rank.getKey(); } // Master and slave

};

} // end namespace PRDF
Expand Down

0 comments on commit e1929d0

Please sign in to comment.