From 57e84c7a1e4cc3127213f6fb48052361bb167dee Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Wed, 20 Jul 2016 19:52:11 -0500 Subject: PRD: Add support to stop background scrubbing Change-Id: I20acb278cb3c6c9dc2213f804554a31351ed004f RTC: 157894 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27915 Reviewed-by: Caleb N. Palmer Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Brian J. Stegmiller Tested-by: Jenkins Server Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28815 Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- .../prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C | 36 ++-------- .../diag/prdf/common/plat/prdfPlatServices_rt.H | 66 ------------------ src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C | 8 ++- src/usr/diag/prdf/plat/prdfPlatServices.H | 1 + src/usr/diag/prdf/plat/prdfPlatServices_rt.C | 78 +++++++++++++++++++++- src/usr/diag/prdf/plat/prdfPlatServices_rt.H | 78 ++++++++++++++++++++++ src/usr/diag/prdf/prdf_hb_only.mk | 14 ++-- src/usr/diag/prdf/test/prdf_hb_common_test.mk | 5 +- 8 files changed, 176 insertions(+), 110 deletions(-) delete mode 100644 src/usr/diag/prdf/common/plat/prdfPlatServices_rt.H create mode 100644 src/usr/diag/prdf/plat/prdfPlatServices_rt.H (limited to 'src/usr/diag') diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C index 51aba3c98..ea292c33a 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C @@ -200,39 +200,11 @@ int32_t CenMbaTdCtlr::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc, // Stop background scrubbing. Whether to start a new TD procedure or to // temporarily mask TPS triggers while TPS is banned to prevent // flooding. - if ( NULL == iv_mssCmd ) - { - // This scenario will only exist if there was a resest/reload or - // failover. It should be safe to just make a dummy command so that - // we can stop the current command. - iv_mssCmd = createMssCmd( mss_MaintCmdWrapper::TIMEBASE_SCRUB, - iv_mbaTrgt, CenRank(0), 0 ); - if ( NULL == iv_mssCmd ) - { - PRDF_ERR( PRDF_FUNC "createMssCmd() failed" ); - break; - } - - o_rc = iv_mssCmd->stopCmd(); - if ( SUCCESS != o_rc ) - { - PRDF_ERR( PRDF_FUNC "stopCmd() failed" ); - break; - } - - // We don't want to chance calling cleanupCmd() on this command - // since we created a temporary command object just to stop - // background scrubbing. Therefore, delete the object. - delete iv_mssCmd; iv_mssCmd = NULL; - } - else + o_rc = stopBgScrub( iv_mbaTrgt ); + if ( SUCCESS != o_rc ) { - o_rc = iv_mssCmd->stopCmd(); - if ( SUCCESS != o_rc ) - { - PRDF_ERR( PRDF_FUNC "stopCmd() failed" ); - break; - } + PRDF_ERR( PRDF_FUNC "stopBgScrub() failed" ); + break; } // If the queue is empty, there were no pending requests and the new diff --git a/src/usr/diag/prdf/common/plat/prdfPlatServices_rt.H b/src/usr/diag/prdf/common/plat/prdfPlatServices_rt.H deleted file mode 100644 index 7f5956c24..000000000 --- a/src/usr/diag/prdf/common/plat/prdfPlatServices_rt.H +++ /dev/null @@ -1,66 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/common/plat/prdfPlatServices_rt.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 __prdfPlatServices_rt_H -#define __prdfPlatServices_rt_H - -namespace PRDF -{ - -namespace PlatServices -{ - -//############################################################################## -//## Memory specific functions -//############################################################################## - -/** - * @brief Communicates a page gard request to the hypervisor. - * @param i_systemAddress Any address in the target page. - */ -void sendPageGardRequest( uint64_t i_systemAddress ); - -/** - * @brief Communicates an LMB gard request to the hypervisor. - * @param i_systemAddress Any address in the target LMB. - * @param i_isFetchUE True if cause attention is a fetch UE. False if cause - * attention is a scrub UE (only applicable to FSP code). - */ -void sendLmbGardRequest( uint64_t i_systemAddress, bool i_isFetchUE ); - -/** - * @brief Communicates to the hypervisor a range of address to remove from the - * available memory space. - * @param i_startAddr First address in the range. - * @param i_endAddr Last address in the range. - */ -void sendDynMemDeallocRequest( uint64_t i_startAddr, uint64_t i_endAddr ); - -} // end namespace PlatServices - -} // end namespace PRDF - -#endif // __prdfPlatServices_rt_H - diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C index c1ea99144..d4da567dc 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C @@ -132,7 +132,13 @@ uint32_t MemTdCtlr::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc, if ( nullptr != iv_curProcedure ) break; // Stop background scrubbing. - // TODO: RTC 136126 + o_rc = stopBgScrub( iv_chip->getTrgt() ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "stopBgScrub(0x%08x) failed", + iv_chip->getHuid() ); + break; + } // Move onto the next step in the state machine. o_rc = nextStep( io_sc ); diff --git a/src/usr/diag/prdf/plat/prdfPlatServices.H b/src/usr/diag/prdf/plat/prdfPlatServices.H index 6fc4c8cf7..66a8556e0 100644 --- a/src/usr/diag/prdf/plat/prdfPlatServices.H +++ b/src/usr/diag/prdf/plat/prdfPlatServices.H @@ -34,6 +34,7 @@ * is common between FSP and Hostboot should be in the respective common file. */ +#include ///< MCBIST command interfaces //#include TODO: RTC 136126 // This must be included after all Hostboot specific includes. This will take diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_rt.C b/src/usr/diag/prdf/plat/prdfPlatServices_rt.C index 7828c095c..423acb3ad 100644 --- a/src/usr/diag/prdf/plat/prdfPlatServices_rt.C +++ b/src/usr/diag/prdf/plat/prdfPlatServices_rt.C @@ -31,12 +31,20 @@ * is common between FSP and Hostboot should be in the respective common file. */ -#include +// Framework includes +#include #include + +// Platform includes +#include + +// Other includes #include //------------------------------------------------------------------------------ +using namespace TARGETING; + namespace PRDF { @@ -105,6 +113,74 @@ void sendDynMemDeallocRequest( uint64_t i_startAddr, uint64_t i_endAddr ) #undef PRDF_FUNC } +//############################################################################## +//## MCBIST Command wrappers +//############################################################################## + +template<> +uint32_t stopBgScrub( TargetHandle_t i_trgt ) +{ + #define PRDF_FUNC "[PlatServices::stopBgScrub] " + + PRDF_ASSERT( TYPE_MCBIST == getTargetType(i_trgt) ); + + uint32_t rc = SUCCESS; + + fapi2::Target fapiTrgt ( i_trgt ); + + fapi2::ReturnCode fapi_rc = memdiags::stop( fapiTrgt ); + + errlHndl_t errl = fapi2::rcToErrl( fapi_rc ); + if ( nullptr != errl ) + { + PRDF_ERR( PRDF_FUNC "memdiags::stop(0x%08x) failed", getHuid(i_trgt) ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + rc = FAIL; + } + + return rc; + + #undef PRDF_FUNC +} + +//############################################################################## +//## MBA Command wrappers +//############################################################################## + +template<> +uint32_t stopBgScrub( TargetHandle_t i_trgt ) +{ + #define PRDF_FUNC "[PlatServices::stopBgScrub] " + + PRDF_ASSERT( TYPE_MBA == getTargetType(i_trgt) ); + + uint32_t rc = SUCCESS; + + PRDF_ERR( PRDF_FUNC "function not implemented yet" ); +/* TODO RTC 136126 + // It is safe to create a dummy command object because runtime commands do + // not store anything for cleanupCmd() and the stopCmd() function is generic + // for all command types. Also, since we are only stopping the command, all + // of the parameters for the command object are junk except for the target. + ecmdDataBufferBase i_startAddr, i_endAddr; + mss_TimeBaseScrub cmd { getFapiTarget(i_trgt), i_startAddr, i_endAddr, + mss_MaintCmd::FAST_MAX_BW_IMPACT, 0, false }; + + errlHndl_t errl = fapi::fapiRcToErrl( cmd.stopCmd() ); + if ( nullptr != errl ) + { + PRDF_ERR( PRDF_FUNC "mss_TimeBaseScrub::stop(0x%08x) failed", + getHuid(i_trgt) ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + rc = FAIL; + } +*/ + + return rc; + + #undef PRDF_FUNC +} + //------------------------------------------------------------------------------ } // end namespace PlatServices diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_rt.H b/src/usr/diag/prdf/plat/prdfPlatServices_rt.H new file mode 100644 index 000000000..cf9312770 --- /dev/null +++ b/src/usr/diag/prdf/plat/prdfPlatServices_rt.H @@ -0,0 +1,78 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/plat/prdfPlatServices_rt.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 __prdfPlatServices_rt_H +#define __prdfPlatServices_rt_H + +namespace PRDF +{ + +namespace PlatServices +{ + +//############################################################################## +//## Memory specific functions +//############################################################################## + +/** + * @brief Communicates a page gard request to the hypervisor. + * @param i_systemAddress Any address in the target page. + */ +void sendPageGardRequest( uint64_t i_systemAddress ); + +/** + * @brief Communicates an LMB gard request to the hypervisor. + * @param i_systemAddress Any address in the target LMB. + * @param i_isFetchUE True if cause attention is a fetch UE. False if cause + * attention is a scrub UE (only applicable to FSP code). + */ +void sendLmbGardRequest( uint64_t i_systemAddress, bool i_isFetchUE ); + +/** + * @brief Communicates to the hypervisor a range of address to remove from the + * available memory space. + * @param i_startAddr First address in the range. + * @param i_endAddr Last address in the range. + */ +void sendDynMemDeallocRequest( uint64_t i_startAddr, uint64_t i_endAddr ); + +//############################################################################## +//## MCBIST/Maintenance Command wrappers +//############################################################################## + +/** + * @brief Stops Background Scrubbing. + * @param i_trgt MCBIST or MBA target. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ +template +uint32_t stopBgScrub( TARGETING::TargetHandle_t i_trgt ); + +} // end namespace PlatServices + +} // end namespace PRDF + +#endif // __prdfPlatServices_rt_H + diff --git a/src/usr/diag/prdf/prdf_hb_only.mk b/src/usr/diag/prdf/prdf_hb_only.mk index b0b9ddacb..0d972059e 100644 --- a/src/usr/diag/prdf/prdf_hb_only.mk +++ b/src/usr/diag/prdf/prdf_hb_only.mk @@ -51,13 +51,14 @@ prd_incpath += ${PRD_SRC_PATH}/plat # External header paths prd_incpath += ${ROOTPATH}/src/include/usr/ecmddatabuffer prd_incpath += ${ROOTPATH}/src/include/usr/errl -prd_incpath += ${ROOTPATH}/src/import/hwpf/fapi2/include prd_incpath += ${ROOTPATH}/src/include/usr/fapi2 prd_incpath += ${ROOTPATH}/src/include/usr/ibscom prd_incpath += ${ROOTPATH}/src/include/usr/util -#prd_incpath += ${ROOTPATH}/src/usr/hwpf/hwp/bus_training -#prd_incpath += ${ROOTPATH}/src/usr/hwpf/hwp/include -#prd_incpath += ${ROOTPATH}/src/usr/hwpf/hwp/slave_sbe/proc_check_slave_sbe_seeprom_complete +prd_incpath += ${ROOTPATH}/src/import/chips/p9/common/include/ +prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/ +prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ +prd_incpath += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ +prd_incpath += ${ROOTPATH}/src/import/hwpf/fapi2/include ################################################################################ # Hostboot only object files common to both IPL and runtime @@ -152,11 +153,6 @@ prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/eff_confi prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/ prd_vpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/lib/utils/ -prd_incpath += ${ROOTPATH}/src/import/chips/p9/common/include/ -prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory/ -prd_incpath += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ -prd_incpath += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ - prd_obj_no_sim += mcbist.o prd_obj_no_sim += sim.o prd_obj_no_sim += rank.o diff --git a/src/usr/diag/prdf/test/prdf_hb_common_test.mk b/src/usr/diag/prdf/test/prdf_hb_common_test.mk index 2bd0f5823..dd574a2c6 100755 --- a/src/usr/diag/prdf/test/prdf_hb_common_test.mk +++ b/src/usr/diag/prdf/test/prdf_hb_common_test.mk @@ -52,10 +52,13 @@ EXTRAINCDIR += ${PRD_USR_PATH}/test EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer EXTRAINCDIR += ${ROOTPATH}/src/include/usr/errl +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2 EXTRAINCDIR += ${ROOTPATH}/src/include/usr/util +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2 #------------------------------------------------------------------------------ # objects -- cgit v1.2.1