diff options
author | Richard J. Knight <rjknight@us.ibm.com> | 2013-09-19 12:50:27 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-08 21:33:53 -0500 |
commit | fc5719ef7796c39c5e6c8abad6391dd311c9126c (patch) | |
tree | 67311300b63fc5086f7c5c69efb272ebe3c82360 /src | |
parent | e588a94e039ad1a02fc366f371471d65337369fa (diff) | |
download | blackbird-hostboot-fc5719ef7796c39c5e6c8abad6391dd311c9126c.tar.gz blackbird-hostboot-fc5719ef7796c39c5e6c8abad6391dd311c9126c.zip |
Implement termination from fatal error log.
Change-Id: Ie83f0876887ee0465cd4d430fa4a335f6aa396ec
RTC:35268
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6403
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/kernel/hbterminatetypes.H | 4 | ||||
-rw-r--r-- | src/include/usr/errl/errlentry.H | 12 | ||||
-rw-r--r-- | src/include/usr/errl/hberrltypes.H | 3 | ||||
-rw-r--r-- | src/include/usr/initservice/initserviceif.H | 14 | ||||
-rw-r--r-- | src/usr/errl/errlentry.C | 26 | ||||
-rw-r--r-- | src/usr/errl/errlmanager.C | 71 | ||||
-rw-r--r-- | src/usr/initservice/baseinitsvc/initservice.C | 46 | ||||
-rw-r--r-- | src/usr/initservice/baseinitsvc/initservice.H | 12 |
8 files changed, 158 insertions, 30 deletions
diff --git a/src/include/kernel/hbterminatetypes.H b/src/include/kernel/hbterminatetypes.H index 487704b96..c337eb1ba 100644 --- a/src/include/kernel/hbterminatetypes.H +++ b/src/include/kernel/hbterminatetypes.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/include/kernel/terminatetypes.H $ */ +/* $Source: src/include/kernel/hbterminatetypes.H $ */ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H index d90f358a6..7bc971ed0 100644 --- a/src/include/usr/errl/errlentry.H +++ b/src/include/usr/errl/errlentry.H @@ -312,6 +312,14 @@ public: void setTermState(const errlTermState_t i_termState); /** + * @brief Helper function to determine if log is a terminating error + * + * + * @return returns true if error will result in system termination. + */ + bool isTerminateLog() const; + + /** * @brief Add data to the iv_Src user data words. * * @param[in] i_data - information to add to the user data word 1. @@ -615,8 +623,8 @@ private: std::vector<uint64_t> iv_btAddrs; // list of addresses for the backtrace ErrlUserDetailsBackTrace * iv_pBackTrace; // Pointer to back trace - // TODO need to interpret term state and terminate accordingly. - // TODO termstate is presently not being flattend into PEL + // termstate will not be flattend into PEL, its only used by + // hostboot. errlTermState_t iv_termState; }; diff --git a/src/include/usr/errl/hberrltypes.H b/src/include/usr/errl/hberrltypes.H index 3c0611366..b8e9c220a 100644 --- a/src/include/usr/errl/hberrltypes.H +++ b/src/include/usr/errl/hberrltypes.H @@ -287,11 +287,12 @@ enum epubSubSystem_t /** * @brief Terminating flag definitions * Needs to fit into 1 word (32-bits) for flattening purposes. - * TODO Termination state and termination action. */ enum errlTermState_t { TERM_STATE_NO_FLAGS = 0x00000000, + TERM_STATE_MNFG = 0x10000000, + TERM_STATE_SOFT = 0x20000000, TERM_STATE_UNKNOWN = 0xFFFFFFFF, }; diff --git a/src/include/usr/initservice/initserviceif.H b/src/include/usr/initservice/initserviceif.H index e32e57640..9bfd7b0b0 100644 --- a/src/include/usr/initservice/initserviceif.H +++ b/src/include/usr/initservice/initserviceif.H @@ -99,6 +99,20 @@ void doShutdown ( uint64_t i_status, uint64_t i_payload_entry = 0, uint64_t i_payload_data = 0) NO_RETURN; + +/** + * @brief Creates a separate thread and calls doShutdown + * + * @param[in] i_status - Shutdown status to be passed along on shutdown + * + * @return Nothing + * + * @Note: added for errlmanager to call so errlmanager continues + * to run in case there are errors in the shutdown path + * + */ +void Shutdown( uint64_t i_status ); + /** * @brief This function will return whether or not we are SPless * diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index 8d1084f76..e201f4454 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -570,6 +570,32 @@ void ErrlEntry::setSubSystemIdBasedOnCallouts() } /////////////////////////////////////////////////////////////////////////////// +// Determine if this log should cause a termination +bool ErrlEntry::isTerminateLog() const +{ + bool l_terminate = false; + + switch( iv_termState ) + { + case TERM_STATE_MNFG: + l_terminate = true; + break; + + case TERM_STATE_SOFT: + l_terminate = true; + break; + + default: + l_terminate = false; + break; + + } + + return l_terminate; + +} + +/////////////////////////////////////////////////////////////////////////////// // Map the target type to correct subsystem ID using a binary search epubSubSystem_t ErrlEntry::getSubSystem( TARGETING::TYPE i_target ) { diff --git a/src/usr/errl/errlmanager.C b/src/usr/errl/errlmanager.C index 84bb4e3eb..14041b178 100644 --- a/src/usr/errl/errlmanager.C +++ b/src/usr/errl/errlmanager.C @@ -245,38 +245,55 @@ 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; + //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 - l_err->commit( (compId_t) theMsg->data[0] ); + //Ask the ErrlEntry to assign commit component, commit time + l_err->commit( (compId_t) theMsg->data[0] ); - //Write the error log to L3 memory till PNOR is implemented - //RTC #47517 for future task to write error log to PNOR - saveErrLogEntry ( l_err ); + //Write the error log to L3 memory till PNOR is implemented + //RTC #47517 for future task to write error log to PNOR + saveErrLogEntry ( l_err ); - //Create a mbox message with the error log and send it to FSP - //We only send error log to FSP when mailbox is enabled - if( MBOX::mailbox_enabled() ) - { - sendMboxMsg ( l_err ); - } + //Create a mbox message with the error log and send it to + // FSP. + // We only send error log to FSP when mailbox is enabled + if( MBOX::mailbox_enabled() ) + { + sendMboxMsg ( l_err ); + } - //Ask the ErrlEntry to process any callouts - l_err->processCallout(); + //Ask the ErrlEntry to process any callouts + l_err->processCallout(); - //We are done with the error log handle so delete it. - delete l_err; - l_err = NULL; + //Ask if it is a terminating log + if( l_err->isTerminateLog() ) + { - //We are done with the msg - msg_free(theMsg); + TRACFCOMP( g_trac_errl, INFO_MRK + "Terminating error was commited" + " errlmanager is reqesting a shutdown."); - // else go back and wait for a next msg - break; + INITSERVICE::Shutdown(l_err->plid()); + + TRACDCOMP( g_trac_errl, + INFO_MRK"shutdown in progress" ); + + } + + //We are done with the error log handle so delete it. + delete l_err; + l_err = NULL; + + //We are done with the msg + msg_free(theMsg); + + // 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 @@ -293,9 +310,13 @@ void ErrlManager::errlogMsgHndlr ( void ) case ERRLOG_SHUTDOWN: TRACFCOMP( g_trac_errl, INFO_MRK "Shutdown event received" ); + // respond before shutting down our queue etc.. + msg_respond ( iv_msgQ, theMsg ); //Start shutdown process for error log errlogShutdown(); - msg_respond ( iv_msgQ, theMsg ); + + TRACFCOMP( g_trac_errl, INFO_MRK "Shutdown event processed" ); + break; default: diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C index e3ca0160b..bf72d7179 100644 --- a/src/usr/initservice/baseinitsvc/initservice.C +++ b/src/usr/initservice/baseinitsvc/initservice.C @@ -615,6 +615,52 @@ void InitService::registerBlock(void* i_vaddr, uint64_t i_size, } } + +void Shutdown(uint64_t i_status ) +{ + void * plid = new uint64_t; + + *((uint64_t *)plid) = i_status; + + // spawn a detached thread to handle the shutdown + // request - need to do this because the initservice + // is going to try and send a sync message to the errl + // manager to shutdown + tid_t l_tid = task_create( + &InitService::Shutdown, plid ); + + TRACFCOMP( g_trac_initsvc, + INFO_MRK"shutdown tid=%d", l_tid ); + +} + +void * InitService::Shutdown( void * i_args ) +{ + + TRACFCOMP( g_trac_initsvc, ENTER_MRK"Shutdown()" ); + + // detach the process from the calling process. + task_detach(); + + uint64_t plid = *(reinterpret_cast<uint64_t*>(i_args)); + + TRACDCOMP( g_trac_initsvc, "plid 0x%x", plid ); + // request a shutdown, passing in the terminating + // error plid as the status. + INITSERVICE::doShutdown( plid ); + + // delete the storage for the plid; + delete ((uint64_t *)i_args); + + i_args = NULL; + + TRACFCOMP( g_trac_initsvc, EXIT_MRK"Shutdown()" ); + + return i_args; +} + + + void doShutdown ( uint64_t i_status, uint64_t i_payload_base, uint64_t i_payload_entry, diff --git a/src/usr/initservice/baseinitsvc/initservice.H b/src/usr/initservice/baseinitsvc/initservice.H index 795afae27..4b48d528f 100644 --- a/src/usr/initservice/baseinitsvc/initservice.H +++ b/src/usr/initservice/baseinitsvc/initservice.H @@ -219,6 +219,18 @@ public: uint64_t i_payload_entry = 0, uint64_t i_payload_data = 0); + /** + * @brief Creates detatched thread and calls doShutdown + * + * @param[in] i_status - Shutdown status to be passed along on shutdown + * + * @return Nothing + * @note Added to enable errl manager to continue to run in termination + * path + */ + +static void * Shutdown( void * io_args ); + protected: |