diff options
author | Brian Horton <brianh@linux.ibm.com> | 2013-03-13 16:59:00 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-04-09 14:32:26 -0500 |
commit | 84d81bdda49213dcde23c604a2d6ab7ace90f1d6 (patch) | |
tree | c0877db67c5f7a727d39afdcb353cdc1fc844833 /src | |
parent | a728b65edde0f26251ee262be89b00d9461379e6 (diff) | |
download | talos-hostboot-84d81bdda49213dcde23c604a2d6ab7ace90f1d6.tar.gz talos-hostboot-84d81bdda49213dcde23c604a2d6ab7ace90f1d6.zip |
handle MASTER_PROCESSOR_CHIP_TARGET_SENTINEL as approporiate
. create new errl->callout function to handle calling
hwas::processCallout, so that can be done in proper
order (after commit, save to PNOR and send to FSP of
errl)
. in callout code, convert SENTINEL target to masterProc
. a deconfigure of the masterProc means that we can't
continue, so return flag so that doShutdown() will
be called to halt the IPL (TI).
Change-Id: Ie43b8caf28d3aea20c15827e035dd890378dbcee
RTC: 45780
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3695
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/errl/errlentry.H | 12 | ||||
-rw-r--r-- | src/include/usr/hwas/common/hwasCallout.H | 6 | ||||
-rw-r--r-- | src/usr/errl/errlentry.C | 47 | ||||
-rw-r--r-- | src/usr/errl/errlmanager.C | 34 | ||||
-rw-r--r-- | src/usr/hwas/common/deconfigGard.C | 3 | ||||
-rw-r--r-- | src/usr/hwas/common/hwasCallout.C | 110 |
6 files changed, 149 insertions, 63 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H index e92a362b9..cb7fac99a 100644 --- a/src/include/usr/errl/errlentry.H +++ b/src/include/usr/errl/errlentry.H @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ /* */ /* p1 */ /* */ @@ -484,6 +484,16 @@ private: /** + * @brief The ErrlManager will call here to ask the + * ErrlEntry to handle deconfigure and GARD callouts + * The ErrlManager is the primary user of this call. + * + * @return plid if we need to shutdown, zero if no action + */ + uint32_t callout(); + + + /** * @brief Compute the flattened size of an error log. It is typical * to call this function for the size of buffer required, then * allocate a buffer, then call flatten(). diff --git a/src/include/usr/hwas/common/hwasCallout.H b/src/include/usr/hwas/common/hwasCallout.H index 439b79fdd..5c279c4be 100644 --- a/src/include/usr/hwas/common/hwasCallout.H +++ b/src/include/usr/hwas/common/hwasCallout.H @@ -132,14 +132,14 @@ enum callOutPriority * @param[in] i_pData Pointer to the callout bundle * @param[in] i_Size size of the data in the callout bundle * - * @return void + * @return true if shutdown required, false otherwise */ -void processCallout(const uint32_t i_errlPlid, +bool processCallout(const uint32_t i_errlPlid, uint8_t *i_pData, uint64_t i_Size); // typedef for function pointer that the errlog class will use. -typedef void (*processCalloutFn)(const uint32_t, uint8_t *, uint64_t); +typedef bool (*processCalloutFn)(const uint32_t, uint8_t *, uint64_t); #endif // not PARSER // diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index e6d248f76..f7ecefc4e 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -268,13 +268,13 @@ void ErrlEntry::addHwCallout(const TARGETING::Target *i_target, ErrlUserDetailsCallout(&ep, sizeof(ep), i_priority, i_deconfigState, i_gardErrorType).addToLog(this); - } - if (i_deconfigState == HWAS::DELAYED_DECONFIG) - { - // call HWAS function to register this action. - HWAS::theDeconfigGard().registerDelayedDeconfigure( - *i_target, plid()); + if (i_deconfigState == HWAS::DELAYED_DECONFIG) + { + // call HWAS function to register this action. + HWAS::theDeconfigGard().registerDelayedDeconfigure( + *i_target, plid()); + } } } // addHwCallout @@ -304,6 +304,23 @@ void ErrlEntry::commit( compId_t i_committerComponent ) // User header contains the component ID of the committer. iv_User.setComponentId( i_committerComponent ); + // Add the captured backtrace to the error log + if (iv_pBackTrace) + { + iv_pBackTrace->addToLog(this); + delete iv_pBackTrace; + iv_pBackTrace = NULL; + } +} + + +/////////////////////////////////////////////////////////////////////////////// +// for use by ErrlManager +uint32_t ErrlEntry::callout() +{ + uint32_t l_rc = 0; + TRACFCOMP(g_trac_errl, INFO_MRK"errlEntry::callout"); + // see if HWAS has been loaded and has set the processCallout function HWAS::processCalloutFn pFn; pFn = ERRORLOG::theErrlManager::instance().getHwasProcessCalloutFn(); @@ -316,11 +333,16 @@ void ErrlEntry::commit( compId_t i_committerComponent ) { // if this is a CALLOUT if ((ERRL_COMP_ID == (*it)->iv_header.iv_compId) && - (1 == (*it)->iv_header.iv_ver) && + (1 == (*it)->iv_header.iv_ver) && (ERRL_UDT_CALLOUT == (*it)->iv_header.iv_sst)) { // call HWAS to have this processed - (*pFn)(plid(),(*it)->iv_pData, (*it)->iv_Size); + if ((*pFn)(plid(),(*it)->iv_pData, (*it)->iv_Size)) + { + // if it returned true, we need to return the plid + // to indicate that we need to shutdown + l_rc = plid(); + } } } // for each SectionVector } // if HWAS module loaded @@ -329,13 +351,8 @@ void ErrlEntry::commit( compId_t i_committerComponent ) TRACFCOMP(g_trac_errl, INFO_MRK"hwas processCalloutFn not set!"); } - // Add the captured backtrace to the error log - if (iv_pBackTrace) - { - iv_pBackTrace->addToLog(this); - delete iv_pBackTrace; - iv_pBackTrace = NULL; - } + TRACFCOMP(g_trac_errl, INFO_MRK"errlEntry::callout returning 0x%X", l_rc); + return l_rc; } diff --git a/src/usr/errl/errlmanager.C b/src/usr/errl/errlmanager.C index 4cce80016..075d738c3 100644 --- a/src/usr/errl/errlmanager.C +++ b/src/usr/errl/errlmanager.C @@ -208,13 +208,13 @@ void ErrlManager::errlogMsgHndlr ( void ) switch( theMsg->type ) { case ERRLOG_NEEDS_TO_BE_COMMITTED_TYPE: + { //Extract error log handle from the message. We need the error //log handle to pass along to saveErrlogEntry and sendMboxMsg l_err = (errlHndl_t) theMsg->extra_data; //Ask the ErrlEntry to assign commit component, commit time - //and callout information l_err->commit( (compId_t) theMsg->data[0] ); //Write the error log to L3 memory till PNOR is implemented @@ -227,16 +227,31 @@ void ErrlManager::errlogMsgHndlr ( void ) { sendMboxMsg ( l_err ); } - + + //Ask the ErrlEntry to process any callouts + uint32_t calloutPlid = l_err->callout(); + //We are done with the error log handle so delete it. delete l_err; l_err = NULL; - //We are done with the msg so go back and wait for a next one + //We are done with the msg msg_free(theMsg); - - break; + // done cleaning up, see if we need to exit. + if (calloutPlid != 0) + { + // non-zero means that we need to shutdown! + TRACFCOMP( g_trac_errl, INFO_MRK + "callout says Shutdown due to plid 0x%X", + calloutPlid ); + errlogShutdown(); + INITSERVICE::doShutdown(calloutPlid); + } + + // else go back and wait for a next msg + break; + } case ERRLOG_COMMITTED_ACK_RESPONSE_TYPE: //Hostboot must keep track and clean up hostboot error //logs in PNOR after it is committed by FSP. @@ -490,7 +505,8 @@ void ErrlManager::errlogShutdown(void) // Ensure that all the error logs are pushed out to PNOR // prior to the PNOR resource provider shutting down. - l_err = PNOR::getSectionInfo(PNOR::HB_ERRLOGS, PNOR::CURRENT_SIDE, l_section); + l_err = PNOR::getSectionInfo(PNOR::HB_ERRLOGS, PNOR::CURRENT_SIDE, + l_section); if(l_err) { @@ -512,9 +528,15 @@ void ErrlManager::errlogShutdown(void) } } + // Un-register error log message queue from the shutdown + INITSERVICE::unregisterShutdownEvent( iv_msgQ); + // Un-register error log message queue from the mailbox service MBOX::msgq_unregister( MBOX::HB_ERROR_MSGQ ); + // destroy the queue + msg_q_destroy(iv_msgQ); + return; } diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C index 40dfba897..7de1d5520 100644 --- a/src/usr/hwas/common/deconfigGard.C +++ b/src/usr/hwas/common/deconfigGard.C @@ -820,15 +820,12 @@ void DeconfigGard::_GardRecordIdSetup(uint32_t i_size) bool DeconfigGard::_processDelayedDeconfig() { - HWAS_INF("_processDelayedDeconfig entry. "); - // we're going to return the current setting bool rc = iv_delayedDeconfig; // for now, clear the mark on the wall. iv_delayedDeconfig = false; - HWAS_INF("_processDelayedDeconfig exit rc %d", rc); return rc; } // _processDelayedDeconfig diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C index eecacac2b..3eb884270 100644 --- a/src/usr/hwas/common/hwasCallout.C +++ b/src/usr/hwas/common/hwasCallout.C @@ -42,13 +42,14 @@ namespace HWAS { -void processCallout(const uint32_t i_errlPlid, +bool processCallout(const uint32_t i_errlPlid, uint8_t *i_pData, uint64_t i_Size) { - HWAS_INF("processCallout entry. plid 0x%x data %p %lld", + HWAS_INF("processCallout entry. plid 0x%x data %p size %lld", i_errlPlid, i_pData, i_Size); + bool l_rc = false; // default is no shutdown required callout_ud_t *pCalloutUD = (callout_ud_t *)i_pData; errlHndl_t errl = NULL; switch (pCalloutUD->type) @@ -56,40 +57,39 @@ void processCallout(const uint32_t i_errlPlid, case (HW_CALLOUT): { TARGETING::Target *pTarget; + // data after the pCalloutUD structure is either a token // indicating it's the MASTER_PROCESSOR_CHIP_TARGET_SENTINEL // or it's the EntityPath - getAttr<TARGETING::ATTR_PHYS_PATH>() - if (*((uint8_t *)(pCalloutUD + 1)) == TARGET_IS_SENTINEL) - { - pTarget = TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL; - // TODO RTC: 45780 - HWAS_INF("TARGET_SENTINEL - can't handle; exiting"); - break; // HWAS can't handle this right now... - } - else + if (*((uint8_t *)(pCalloutUD + 1)) != TARGET_IS_SENTINEL) { // convert the EntityPath to a Target pointer TARGETING::EntityPath ep; memcpy(&ep, (pCalloutUD + 1), sizeof(ep)); pTarget = TARGETING::targetService().toTarget(ep); - } - if (pTarget == NULL) - { // should only happen if we have a corrupt errlog or targeting. - HWAS_ERR("HW callout; pTarget was NULL!!!"); - - /*@ - * @errortype - * @moduleid MOD_PROCESS_CALLOUT - * @reasoncode HWAS::RC_INVALID_TARGET - * @devdesc Invalid Target encountered into processCallout - */ - errl = hwasError( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - HWAS::MOD_PROCESS_CALLOUT, - HWAS::RC_INVALID_TARGET); - errlCommit(errl, HWAS_COMP_ID); - break; + if (unlikely(pTarget == NULL)) + { // only happen if we have a corrupt errlog or targeting. + HWAS_ERR("HW callout; pTarget was NULL!!!"); + + /*@ + * @errortype + * @moduleid HWAS::MOD_PROCESS_CALLOUT + * @reasoncode HWAS::RC_INVALID_TARGET + * @devdesc Invalid Target encountered in + * processCallout + */ + errl = hwasError( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + HWAS::MOD_PROCESS_CALLOUT, + HWAS::RC_INVALID_TARGET); + errlCommit(errl, HWAS_COMP_ID); + break; + } + } + else + { // convert this to the real master processor + TARGETING::targetService().masterProcChipTargetHandle(pTarget); } const DeconfigEnum deconfigState = pCalloutUD->deconfigState; @@ -106,10 +106,17 @@ void processCallout(const uint32_t i_errlPlid, } default: { + // move these to platform specific functions? + // RTC: 45781 + // hostboot: // call HWAS common function errl = HWAS::theDeconfigGard().createGardRecord(*pTarget, i_errlPlid, GARD_Fatal); + errlCommit(errl, HWAS_COMP_ID); + // fsp: + // RTC: 45781 + // nothing? gard record is already in PNOR break; } } // switch gardErrorType @@ -122,16 +129,43 @@ void processCallout(const uint32_t i_errlPlid, } case (DECONFIG): { - // call HWAS common function + // check to see if this target is the master processor + TARGETING::Target *l_masterProc; + TARGETING::targetService().masterProcChipTargetHandle( + l_masterProc); + if (pTarget == l_masterProc) + { + // if so, we can't run anymore, so we will + // return TRUE so the caller calls doShutdown + HWAS_ERR("callout - DECONFIG on MasterProc"); + l_rc = true; + break; + } + + // else, call HWAS common function errl = HWAS::theDeconfigGard().deconfigureTarget(*pTarget, i_errlPlid); + errlCommit(errl, HWAS_COMP_ID); break; } case (DELAYED_DECONFIG): { - // do nothing -- the deconfig information was already put - // on a queue and will be processed separately, when the - // time is right. + // check to see if this target is the master processor + TARGETING::Target *l_masterProc; + TARGETING::targetService().masterProcChipTargetHandle( + l_masterProc); + if (pTarget == l_masterProc) + { + // if so, we can't run anymore, so we will + // return TRUE so the caller calls doShutdown + l_rc = true; + HWAS_ERR("callout - DELAYED_DECONFIG on MasterProc"); + break; + } + // else + // do nothing -- the deconfig information was already + // put on a queue and will be processed separately, + // when the time is right. break; } } // switch deconfigState @@ -144,9 +178,14 @@ void processCallout(const uint32_t i_errlPlid, //const HWAS::epubProcedureID procedure = pCalloutUD->procedure; //const callOutPriority priority = pCalloutUD->priority; - // TODO RTC: 35108 - // call HWAS common function - //errl = HWAS::processCallout(procedure, priority, i_errlPlid); + // move these to platform specific functions? + // RTC: 45781 + // hostboot: + // nothing + + // fsp: + // RTC: 45781 + // ? not sure what fsp does for procedure callouts? break; } default: @@ -156,7 +195,8 @@ void processCallout(const uint32_t i_errlPlid, } } // switch - HWAS_INF("processCallout exit errl %p", errl); + HWAS_INF("processCallout exit l_rc %d", l_rc); + return l_rc; } // processCallout }; // end namespace |