summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/runtime/interface.h4
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C6
-rwxr-xr-xsrc/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C70
-rw-r--r--src/usr/diag/prdf/runtime/prdfPlatServices_rt.C51
4 files changed, 113 insertions, 18 deletions
diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h
index 66c992591..26d5f6b6a 100644
--- a/src/include/runtime/interface.h
+++ b/src/include/runtime/interface.h
@@ -298,8 +298,8 @@ typedef struct hostInterfaces
* immediately. It should not wait for the request to be applied. See
* note above.
*/
- int32_t memory_error( uint64_t i_startAddr, uint64_t i_endAddr,
- MemoryError_t i_errorType );
+ int32_t (*memory_error)( uint64_t i_startAddr, uint64_t i_endAddr,
+ MemoryError_t i_errorType );
// Reserve some space for future growth.
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C
index b68d6a416..dff8a9bbf 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C
@@ -48,7 +48,7 @@
#include <prdfCenMembufExtraSig.H>
#include <prdfLaneRepair.H>
#include <prdfCenMemUtils.H>
-#ifndef __HOSTBOOT_MODULE
+#if !defined(__HOSTBOOT_MODULE) || defined(__HOSTBOOT_RUNTIME)
#include <prdfCenMbaDynMemDealloc_rt.H>
#endif
@@ -833,8 +833,8 @@ int32_t AnalyzeFetchUe( ExtensibleChip * i_membChip,
// of handleTdEvent result, add the code judicially.
}
- #ifndef __HOSTBOOT_MODULE
- // Send lmb gard message to PHYP.
+ #if !defined(__HOSTBOOT_MODULE) || defined(__HOSTBOOT_RUNTIME)
+ // Send lmb gard message to hypervisor.
int32_t lmbRc = DEALLOC::lmbGard( mbaChip, addr );
if ( SUCCESS != lmbRc )
{
diff --git a/src/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C b/src/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C
index f1693a650..a2b941fb8 100755
--- a/src/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C
+++ b/src/usr/diag/prdf/common/runtime/prdfCenMbaDynMemDealloc_rt.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -350,6 +350,47 @@ int32_t getSystemAddr( ExtensibleChip * i_mbaChip, CenAddr i_addr,
//------------------------------------------------------------------------------
+int32_t rankGard( ExtensibleChip * i_mbaChip, CenRank i_rank )
+{
+ #define PRDF_FUNC "[DEALLOC::rankGard] "
+
+ int32_t o_rc = SUCCESS;
+ do
+ {
+ CenAddr startAddr, endAddr;
+ TargetHandle_t mba = i_mbaChip->GetChipHandle();
+ o_rc = getMemAddrRange( mba, i_rank, startAddr, endAddr );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC"getMemAddrRange() Failed. HUID:0x%08X",
+ i_mbaChip->GetId() );
+ break;
+ }
+
+ // Get the system addresses
+ uint64_t ssAddr = 0;
+ uint64_t seAddr = 0;
+ o_rc = getSystemAddr( i_mbaChip, startAddr, ssAddr);
+ o_rc |= getSystemAddr( i_mbaChip, endAddr, seAddr );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC"getSystemAddr() failed. HUID:0x%08X",
+ i_mbaChip->GetId() );
+ break;
+ }
+ // Send the address range to HV
+ sendDynMemDeallocRequest( ssAddr, seAddr );
+ PRDF_TRAC( PRDF_FUNC"Rank gard for Start Addr: 0x%016llx "
+ "End Addr: 0x%016llX", ssAddr, seAddr );
+
+ } while( 0 );
+
+ return o_rc;
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
int32_t pageGard( ExtensibleChip * i_mbaChip, CenAddr i_addr )
{
#define PRDF_FUNC "[DEALLOC::pageGard] "
@@ -385,16 +426,29 @@ int32_t lmbGard( ExtensibleChip * i_mbaChip, CenAddr i_addr, bool i_isFetch )
int32_t o_rc = SUCCESS;
do
{
- o_rc = getSystemAddr( i_mbaChip, i_addr, sysAddr);
- if( SUCCESS != o_rc )
+ if( isHyprConfigOpal() )
{
- PRDF_ERR( PRDF_FUNC"getSystemAddr() failed. HUID:0x%08X",
- i_mbaChip->GetId() );
- break;
+ o_rc = rankGard( i_mbaChip, i_addr.getRank() );
+ if( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC"rankGard() failed. HUID:0x%08X",
+ i_mbaChip->GetId() );
+ break;
+ }
}
+ else
+ {
+ o_rc = getSystemAddr( i_mbaChip, i_addr, sysAddr);
+ if( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC"getSystemAddr() failed. HUID:0x%08X",
+ i_mbaChip->GetId() );
+ break;
+ }
- sendLmbGardRequest( sysAddr, i_isFetch );
- PRDF_TRAC( PRDF_FUNC"LMB gard for address: 0x%016llX", sysAddr );
+ sendLmbGardRequest( sysAddr, i_isFetch );
+ PRDF_TRAC( PRDF_FUNC"LMB gard for address: 0x%016llX", sysAddr );
+ }
} while( 0 );
diff --git a/src/usr/diag/prdf/runtime/prdfPlatServices_rt.C b/src/usr/diag/prdf/runtime/prdfPlatServices_rt.C
index 450655dbb..2a50aa5af 100644
--- a/src/usr/diag/prdf/runtime/prdfPlatServices_rt.C
+++ b/src/usr/diag/prdf/runtime/prdfPlatServices_rt.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -32,6 +32,8 @@
*/
#include <prdfPlatServices.H>
+#include <prdfTrace.H>
+#include <runtime/interface.h>
//------------------------------------------------------------------------------
@@ -47,21 +49,60 @@ namespace PlatServices
void sendPageGardRequest( uint64_t i_systemAddress )
{
- // TODO: RTC 118920 need to create and call OPAL interfaces
+ #define PRDF_FUNC "[PlatServices::sendPageGardRequest] "
+
+ do
+ {
+ if( !g_hostInterfaces || !g_hostInterfaces->memory_error )
+ {
+ PRDF_ERR(PRDF_FUNC" memory_error() interface is not defined");
+ break;
+ }
+
+ int32_t rc = g_hostInterfaces->memory_error( i_systemAddress,
+ i_systemAddress,
+ MEMORY_ERROR_CE );
+ if( SUCCESS != rc )
+ {
+ PRDF_ERR(PRDF_FUNC" memory_error() failed");
+ break;
+ }
+ }while(0);
+
+ #undef PRDF_FUNC
}
//------------------------------------------------------------------------------
void sendLmbGardRequest( uint64_t i_systemAddress, bool i_isFetchUE )
{
- // TODO: RTC 118920 need to create and call OPAL interfaces
+ //NO-OP for OPAL
}
-
//------------------------------------------------------------------------------
void sendDynMemDeallocRequest( uint64_t i_startAddr, uint64_t i_endAddr )
{
- // TODO: RTC 118920 need to create and call OPAL interfaces
+ #define PRDF_FUNC "[PlatServices::sendDynMemDeallocRequest] "
+
+ do
+ {
+ if( !g_hostInterfaces || !g_hostInterfaces->memory_error )
+ {
+ PRDF_ERR(PRDF_FUNC" memory_error() interface is not defined");
+ break;
+ }
+
+ int32_t rc = g_hostInterfaces->memory_error( i_startAddr,
+ i_startAddr,
+ MEMORY_ERROR_UE );
+ if( SUCCESS != rc )
+ {
+ PRDF_ERR(PRDF_FUNC" memory_error() failed");
+ break;
+ }
+ }while(0);
+
+ #undef PRDF_FUNC
}
//------------------------------------------------------------------------------
OpenPOWER on IntegriCloud