diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2013-07-16 14:58:43 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-08-21 15:38:53 -0500 |
commit | b814311a6dc122e761336881130eace63d3533e7 (patch) | |
tree | 1330190b59abbe6fc094de1b5afda87abacc100b /src/usr/runtime | |
parent | a6f46d0a9461b96781bc85c9fd82c24d14b5ce42 (diff) | |
download | talos-hostboot-b814311a6dc122e761336881130eace63d3533e7.tar.gz talos-hostboot-b814311a6dc122e761336881130eace63d3533e7.zip |
Handle interrupts on MPIPL
Change-Id: I315d5c802819bf6f16cd6adbffe77530bd42699a
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5427
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/runtime')
-rw-r--r-- | src/usr/runtime/hdatservice.C | 129 | ||||
-rw-r--r-- | src/usr/runtime/hdatservice.H | 48 |
2 files changed, 175 insertions, 2 deletions
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C index 4de60449b..f6d70d19b 100644 --- a/src/usr/runtime/hdatservice.C +++ b/src/usr/runtime/hdatservice.C @@ -299,6 +299,7 @@ hdatService::hdatService(void) :iv_spiraL(NULL) ,iv_spiraH(NULL) ,iv_spiraS(NULL) +,iv_mdrtCnt(0) { } @@ -600,7 +601,6 @@ errlHndl_t hdatService::getHostDataSection( SectionId i_section, errhdl = findSpira(); if( errhdl ) { break; } - // NACA if( RUNTIME::NACA == i_section ) { @@ -929,7 +929,7 @@ errlHndl_t hdatService::getHostDataSection( SectionId i_section, //Note - there is no header for the MDRT //return the total allocated size since it is empty at first - o_dataSize = tuple->hdatAllocSize * tuple->hdatAllocSize; + o_dataSize = tuple->hdatAllocSize * tuple->hdatAllocCnt; errhdl = getSpiraTupleVA(tuple, o_dataAddr); if( errhdl ) { break; } @@ -1157,6 +1157,115 @@ errlHndl_t hdatService::findSpira( void ) return errhdl; } +errlHndl_t hdatService::updateHostDataSectionActual( SectionId i_section, + uint16_t i_count ) +{ + errlHndl_t errhdl = NULL; + TRACFCOMP( g_trac_runtime, "RUNTIME::updateHostDataSectionActual( i_section=%d )", i_section); + + do + { + //Always force a load (mapping) + errhdl = loadHostData(); + if(errhdl) + { + break; + } + + TARGETING::Target * sys = NULL; + TARGETING::targetService().getTopLevelTarget( sys ); + assert(sys != NULL); + + // Figure out what kind of payload we have + TARGETING::ATTR_PAYLOAD_KIND_type payload_kind + = sys->getAttr<TARGETING::ATTR_PAYLOAD_KIND>(); + + if( TARGETING::PAYLOAD_KIND_NONE == payload_kind ) + { + // we're all done -- don't need to do anything + break; + } + //If payload is not (PHYP or Sapphire w/fsp) + else if( !((TARGETING::PAYLOAD_KIND_PHYP == payload_kind ) || + ((TARGETING::PAYLOAD_KIND_SAPPHIRE == payload_kind ) && + !INITSERVICE::spLess()))) + { + TRACFCOMP( g_trac_runtime, "get_host_data_section> There is no host data for PAYLOAD_KIND=%d", payload_kind ); + /*@ + * @errortype + * @moduleid RUNTIME::MOD_HDATSERVICE_UPDATE_SECTION_ACTUAL + * @reasoncode RUNTIME::RC_INVALID_PAYLOAD_KIND + * @userdata1 ATTR_PAYLOAD_KIND + * @userdata2 Requested Section + * @devdesc There is no host data for specified kind of payload + */ + errhdl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + RUNTIME::MOD_HDATSERVICE_UPDATE_SECTION_ACTUAL, + RUNTIME::RC_INVALID_PAYLOAD_KIND, + payload_kind, + i_section); + errhdl->collectTrace("RUNTIME",1024); + break; + } + + // Setup the SPIRA pointers + errhdl = findSpira(); + if( errhdl ) { break; } + + + // MS DUMP Results Table - MDRT + if( RUNTIME::MS_DUMP_RESULTS_TBL == i_section ) + { + //For security we can't trust the FSP's payload attribute + // on MPIPLs for the dump tables. + //@todo: RTC:59171 + + // Find the right tuple and verify it makes sense + hdat5Tuple_t* tuple = NULL; + if( iv_spiraS ) + { + tuple = &(iv_spiraS->hdatDataArea[SPIRAH_MS_DUMP_RSLT_TBL]); + } + else if( unlikely(iv_spiraL != NULL) ) + { + tuple = &(iv_spiraL->hdatDataArea[SPIRAL_MS_DUMP_RSLT_TBL]); + } + TRACFCOMP( g_trac_runtime, "MS_DUMP_RESULTS_TBL tuple=%p, count=%x", tuple, i_count); + errhdl = check_tuple( i_section, + tuple ); + if( errhdl ) { break; } + + tuple->hdatActualCnt = i_count; + } + // Not sure how we could get here... + else + { + TRACFCOMP( g_trac_runtime, "get_host_data_section> Unknown section %d", i_section ); + /*@ + * @errortype + * @moduleid RUNTIME::MOD_HDATSERVICE_UPDATE_SECTION_ACTUAL + * @reasoncode RUNTIME::RC_INVALID_SECTION + * @userdata1 Section Id + * @userdata2 <unused> + * @devdesc Unknown section requested + */ + errhdl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + RUNTIME::MOD_HDATSERVICE_UPDATE_SECTION_ACTUAL, + RUNTIME::RC_INVALID_SECTION, + i_section, + 0); + errhdl->collectTrace("RUNTIME",1024); + break; + } + + if( errhdl ) { break; } + + } while(0); + + return errhdl; +} + /******************** Public Methods ********************/ @@ -1183,6 +1292,22 @@ errlHndl_t get_host_data_section( SectionId i_section, getHostDataSection(i_section,i_instance, o_dataAddr, o_dataSize); } +errlHndl_t update_host_data_section_actual( SectionId i_section, + uint16_t i_count ) +{ + return Singleton<hdatService>::instance(). + updateHostDataSectionActual(i_section,i_count); +} + +void update_MDRT_Count(uint16_t i_count ) +{ + Singleton<hdatService>::instance().updateMdrtCount(i_count); +} + +errlHndl_t write_MDRT_Count( void ) +{ + return Singleton<hdatService>::instance().writeMdrtCount(); +} }; /******************** diff --git a/src/usr/runtime/hdatservice.H b/src/usr/runtime/hdatservice.H index 542c7be32..0b670273a 100644 --- a/src/usr/runtime/hdatservice.H +++ b/src/usr/runtime/hdatservice.H @@ -95,6 +95,17 @@ namespace RUNTIME uint64_t& o_dataAddr, size_t& o_dataSize ); + /** + * @brief Update the actual count of section. Only supported for + * memory dump results table + * + * @param[in] i_section Chunk of data to find + * @param[in] i_count Actual count + * + * @return errlHndl_t NULL on success + */ + errlHndl_t updateHostDataSectionActual( SectionId i_section, + uint16_t i_count ); protected: /** @@ -219,6 +230,43 @@ namespace RUNTIME * SPIRA-S */ hdatSpira_t* iv_spiraS; + + /** + * Count of number of MDRT entries present + * on MPIPL/Dump. A value of 0 implies it + * doesn't need to be written + */ + uint16_t iv_mdrtCnt; + + public: + /** + * @brief Update the actual count of MDRT. Called by dump + * and needs to be saved away till populate_attributes. Can't + * be directly written by dump since FSP will load new value over + + * @param[in] i_count Actual count for MDRT entries + * + */ + void updateMdrtCount( uint16_t i_count ) + { + iv_mdrtCnt = i_count; + } + + /** + * @brief Write the MDRT stored value to SPIRA + * + * @return errlHndl_t NULL on success + */ + errlHndl_t writeMdrtCount( void ) + { + errlHndl_t l_err = NULL; + if(iv_mdrtCnt) + { + l_err = updateHostDataSectionActual( + MS_DUMP_RESULTS_TBL,iv_mdrtCnt); + } + return l_err; + } }; }; |