summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2018-04-15 16:18:39 -0500
committerZane C. Shelley <zshelle@us.ibm.com>2018-04-20 10:32:55 -0400
commit7f725513b8aba2d9017b053415d86ece2e39af85 (patch)
treec71798227ebe998ca5539152e13f59b6c8143e50 /src/usr
parent2516009b101a31e33bd0881fcf6c02186c8fe834 (diff)
downloadtalos-hostboot-7f725513b8aba2d9017b053415d86ece2e39af85.tar.gz
talos-hostboot-7f725513b8aba2d9017b053415d86ece2e39af85.zip
PRD: simplified MemEcc::handleMpe() interface
Change-Id: Iaedd4a3f82b04430c9df7609ef92742afbbe277a RTC: 191195 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57235 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: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57503 CI-Ready: Zane C. Shelley <zshelle@us.ibm.com> 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>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H31
-rw-r--r--src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C53
-rw-r--r--src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H22
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C3
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C7
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C20
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C4
7 files changed, 89 insertions, 51 deletions
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H b/src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H
index 46d3a7a66..e267c03c0 100644
--- a/src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H
+++ b/src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H
@@ -36,6 +36,37 @@ namespace MemDbUtils
{
//##############################################################################
+// Generic wrappers
+//##############################################################################
+
+/**
+ * @brief Generic wrapper to add an entry to the UE table.
+ * @param i_chip MCA or MBA.
+ * @param i_type UE table entry type.
+ * @param i_addr UE address.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+template<TARGETING::TYPE T>
+void addUeTableEntry( ExtensibleChip * i_chip, UE_TABLE::Type i_type,
+ const MemAddr & i_addr );
+
+template<> inline
+void addUeTableEntry<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip,
+ UE_TABLE::Type i_type,
+ const MemAddr & i_addr )
+{
+ getMcaDataBundle(i_chip)->iv_ueTable.addEntry( i_type, i_addr );
+}
+
+template<> inline
+void addUeTableEntry<TARGETING::TYPE_MBA>( ExtensibleChip * i_chip,
+ UE_TABLE::Type i_type,
+ const MemAddr & i_addr )
+{
+ getMbaDataBundle(i_chip)->iv_ueTable.addEntry( i_type, i_addr );
+}
+
+//##############################################################################
// Hostboot IPL/Runtime wrappers
//##############################################################################
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C
index 8f6b2a875..472bb829f 100644
--- a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C
+++ b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C
@@ -67,8 +67,7 @@ uint32_t __handleMemUe( ExtensibleChip * i_chip, const MemAddr & i_addr,
io_sc.service_data->setServiceCall();
// Add entry to UE table.
- D db = static_cast<D>(i_chip->getDataBundle());
- db->iv_ueTable.addEntry( i_type, i_addr );
+ MemDbUtils::addUeTableEntry<T>( i_chip, i_type, i_addr );
#ifdef __HOSTBOOT_RUNTIME
@@ -206,9 +205,7 @@ uint32_t handleMemUe<TYPE_MBA>( ExtensibleChip * i_chip, const MemAddr & i_addr,
io_sc.service_data->setServiceCall();
// Add entry to UE table.
- MbaDataBundle * db =
- static_cast<MbaDataBundle *>(i_chip->getDataBundle());
- db->iv_ueTable.addEntry( i_type, i_addr );
+ MemDbUtils::addUeTableEntry<TYPE_MBA>( i_chip, i_type, i_addr );
#else
@@ -392,9 +389,9 @@ bool queryIueTh<TYPE_MCA>( ExtensibleChip * i_chip,
//------------------------------------------------------------------------------
-template<TARGETING::TYPE T, typename D>
-uint32_t handleMpe( ExtensibleChip * i_chip, const MemRank & i_rank,
- STEP_CODE_DATA_STRUCT & io_sc, bool i_isFetch )
+template<TARGETING::TYPE T>
+uint32_t handleMpe( ExtensibleChip * i_chip, const MemAddr & i_addr,
+ UE_TABLE::Type i_type, STEP_CODE_DATA_STRUCT & io_sc )
{
#define PRDF_FUNC "[MemEcc::handleMpe] "
@@ -402,15 +399,17 @@ uint32_t handleMpe( ExtensibleChip * i_chip, const MemRank & i_rank,
uint32_t o_rc = SUCCESS;
+ MemRank rank = i_addr.getRank();
+
do
{
// Read the chip mark from markstore.
MemMark chipMark;
- o_rc = MarkStore::readChipMark<T>( i_chip, i_rank, chipMark );
+ o_rc = MarkStore::readChipMark<T>( i_chip, rank, chipMark );
if ( SUCCESS != o_rc )
{
- PRDF_ERR( PRDF_FUNC "readChipMark<T>(0x%08x,%d) failed",
- i_chip->getHuid(), i_rank.getMaster() );
+ PRDF_ERR( PRDF_FUNC "readChipMark<T>(0x%08x,0x%02x) failed",
+ i_chip->getHuid(), rank.getKey() );
break;
}
@@ -420,9 +419,12 @@ uint32_t handleMpe( ExtensibleChip * i_chip, const MemRank & i_rank,
PRDF_ASSERT( chipMark.isValid() );
// Add the mark to the callout list.
- MemoryMru mm { i_chip->getTrgt(), i_rank, chipMark.getSymbol() };
+ MemoryMru mm { i_chip->getTrgt(), rank, chipMark.getSymbol() };
io_sc.service_data->SetCallout( mm );
+ // Add entry to UE table.
+ MemDbUtils::addUeTableEntry<T>( i_chip, i_type, i_addr );
+
// Add a VCM request to the TD queue if at runtime or at memdiags.
#ifdef __HOSTBOOT_MODULE
@@ -431,7 +433,7 @@ uint32_t handleMpe( ExtensibleChip * i_chip, const MemRank & i_rank,
{
#endif
- TdEntry * entry = new VcmEvent<T>( i_chip, i_rank, chipMark );
+ TdEntry * entry = new VcmEvent<T>( i_chip, rank, chipMark );
MemDbUtils::pushToQueue<T>( i_chip, entry );
#ifndef __HOSTBOOT_RUNTIME
@@ -449,11 +451,13 @@ uint32_t handleMpe( ExtensibleChip * i_chip, const MemRank & i_rank,
// To resolve template linker errors.
template
-uint32_t handleMpe<TYPE_MCA, McaDataBundle *>( ExtensibleChip * i_chip,
- const MemRank & i_rank, STEP_CODE_DATA_STRUCT & io_sc, bool i_isFetch );
+uint32_t handleMpe<TYPE_MCA>( ExtensibleChip * i_chip, const MemAddr & i_addr,
+ UE_TABLE::Type i_type,
+ STEP_CODE_DATA_STRUCT & io_sc );
template
-uint32_t handleMpe<TYPE_MBA, MbaDataBundle *>( ExtensibleChip * i_chip,
- const MemRank & i_rank, STEP_CODE_DATA_STRUCT & io_sc, bool i_isFetch );
+uint32_t handleMpe<TYPE_MBA>( ExtensibleChip * i_chip, const MemAddr & i_addr,
+ UE_TABLE::Type i_type,
+ STEP_CODE_DATA_STRUCT & io_sc );
//------------------------------------------------------------------------------
@@ -492,15 +496,14 @@ uint32_t analyzeFetchMpe( ExtensibleChip * i_chip, const MemRank & i_rank,
// simply fake an address with the correct rank and move on.
if ( i_rank != addr.getRank() )
{
- addr = MemAddr ( i_rank, 0, 0, 0 );
+ o_rc = MemEcc::handleMpe<T>( i_chip, i_rank, UE_TABLE::FETCH_MPE,
+ io_sc );
+ }
+ else
+ {
+ o_rc = MemEcc::handleMpe<T>( i_chip, addr, UE_TABLE::FETCH_MPE,
+ io_sc );
}
-
- // Add address to UE table.
- D db = static_cast<D>(i_chip->getDataBundle());
- db->iv_ueTable.addEntry( UE_TABLE::FETCH_MPE, addr );
-
- // Get callouts, etc., and add the chip mark to the queue.
- o_rc = MemEcc::handleMpe<T,D>( i_chip, i_rank, io_sc, true );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "handleMpe<T>(0x%08x, 0x%02x) failed",
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H
index 1cc49b95a..5995ad834 100644
--- a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H
+++ b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H
@@ -107,15 +107,31 @@ uint32_t handleMemIue( ExtensibleChip * i_chip, const MemRank & i_rank,
/**
* @brief Handles a MPE attention.
+ * @param i_chip MCA or MBA.
+ * @param i_addr Failed address.
+ * @param i_type The type of UE.
+ * @param io_sc The step code data struct.
+ * @return Non-SUCCESS if an interal function fails, SUCCESS otherwise.
+ */
+template<TARGETING::TYPE T>
+uint32_t handleMpe( ExtensibleChip * i_chip, const MemAddr & i_addr,
+ UE_TABLE::Type i_type, STEP_CODE_DATA_STRUCT & io_sc );
+
+/**
+ * @brief Handles a MPE attention.
* @param i_chip MCA or MBA.
* @param i_rank Target rank.
+ * @param i_type The type of UE.
* @param io_sc The step code data struct.
- * @param i_isFetch Whether this is a fetch attn or not.
* @return Non-SUCCESS if an interal function fails, SUCCESS otherwise.
*/
-template<TARGETING::TYPE T, typename D>
+template<TARGETING::TYPE T>
uint32_t handleMpe( ExtensibleChip * i_chip, const MemRank & i_rank,
- STEP_CODE_DATA_STRUCT & io_sc, bool i_isFetch = false );
+ UE_TABLE::Type i_type, STEP_CODE_DATA_STRUCT & io_sc )
+{
+ MemAddr addr { i_rank, 0, 0, 0 };
+ return handleMpe<T>( i_chip, addr, i_type, io_sc );
+}
/**
* @brief Analyzes a fetch MPE attention.
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C
index 1d25a9ecd..af271ea40 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C
@@ -191,7 +191,8 @@ uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
{
io_sc.service_data->AddSignatureList( trgt, PRDFSIG_MaintMPE );
- o_rc = MemEcc::handleMpe<T,D>( i_chip, rank, io_sc );
+ o_rc = MemEcc::handleMpe<T>( i_chip, i_addr, UE_TABLE::SCRUB_MPE,
+ io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "handleMpe<T>(0x%08x, 0x%02x) failed",
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C
index a028f5b86..f697b668b 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C
@@ -663,11 +663,8 @@ uint32_t __checkEcc( ExtensibleChip * i_chip, TdQueue & io_queue,
o_errorsFound = true;
io_sc.service_data->AddSignatureList( trgt, PRDFSIG_MaintMPE );
- // Add entry to UE table.
- D db = static_cast<D>(i_chip->getDataBundle());
- db->iv_ueTable.addEntry( UE_TABLE::SCRUB_MPE, i_addr );
-
- o_rc = MemEcc::handleMpe<T,D>( i_chip, rank, io_sc );
+ o_rc = MemEcc::handleMpe<T>( i_chip, i_addr, UE_TABLE::SCRUB_MPE,
+ io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "handleMpe<T>(0x%08x, 0x%02x) failed",
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C b/src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C
index 993216f9f..71cda0b65 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C
@@ -143,26 +143,16 @@ uint32_t TpsEvent<TYPE_MCA>::nextStep( STEP_CODE_DATA_STRUCT & io_sc,
//else if there was an MPE
else if ( eccAttns & MAINT_MPE )
{
- //Add the mark to the callout list
- MemMark chipMark;
- o_rc = MarkStore::readChipMark<TYPE_MCA>( iv_chip, iv_rank,
- chipMark );
+ // Do memory MPE handling.
+ o_rc = MemEcc::handleMpe<TYPE_MCA>( iv_chip, iv_rank,
+ UE_TABLE::SCRUB_MPE, io_sc);
if ( SUCCESS != o_rc )
{
- PRDF_ERR( PRDF_FUNC "readChipMark<T>(0x%08x,%d) failed",
- iv_chip->getHuid(), iv_rank.getMaster() );
+ PRDF_ERR( PRDF_FUNC "handleMpe(0x%08x,0x%02x) failed",
+ iv_chip->getHuid(), getKey() );
break;
}
- MemoryMru memmru( iv_chip->getTrgt(), iv_rank,
- chipMark.getSymbol() );
- io_sc.service_data->SetCallout( memmru );
-
- // Add a VCM procedure to the queue.
- TdEntry * entry = new VcmEvent<TYPE_MCA> { iv_chip, iv_rank,
- chipMark };
- MemDbUtils::pushToQueue<TYPE_MCA>( iv_chip, entry );
-
//Abort this procedure
o_done = true;
}
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C
index 480d02839..698768208 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemTps_rt.C
@@ -446,8 +446,8 @@ uint32_t TpsEvent<TYPE_MCA>::analyzeEcc( const uint32_t & i_eccAttns,
io_sc.service_data->setSignature( iv_chip->getHuid(),
PRDFSIG_MaintMPE );
- o_rc = MemEcc::handleMpe<TYPE_MCA, McaDataBundle *>( iv_chip,
- iv_rank, io_sc );
+ o_rc = MemEcc::handleMpe<TYPE_MCA>( iv_chip, iv_rank,
+ UE_TABLE::SCRUB_MPE, io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "handleMpe<T>(0x%08x, 0x%02x) failed",
OpenPOWER on IntegriCloud