diff options
author | Brian Horton <brianh@linux.ibm.com> | 2012-06-26 16:30:33 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-08-13 12:25:09 -0500 |
commit | 11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918 (patch) | |
tree | c1e8babefc8a5447d606a4d13a43f914c50bce95 /src/usr/hwas | |
parent | 99f217daf307b3cd963bcbce8eb7b025d58f734e (diff) | |
download | talos-hostboot-11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918.tar.gz talos-hostboot-11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918.zip |
ERRL: Hardware Callouts
Support for HW and Procedure Callouts, including GARD and
deconfigure information.
. Add errl functions to get the information;
. Add errlog userdetail code to package callout data;
. Add to errlog commit function to find callout user-detail
sections and call a HWAS:common function to process
the callout.
. Remove gardLevel from Targeting hwasState field
Change-Id: I01c7c3721e6fd843a0ba2ad4df8399f6db68b590
RTC: 41276
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1266
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/usr/hwas')
-rw-r--r-- | src/usr/hwas/common/hwas.C | 1 | ||||
-rw-r--r-- | src/usr/hwas/common/hwasCallout.C | 175 | ||||
-rw-r--r-- | src/usr/hwas/deconfigGard.C | 8 | ||||
-rw-r--r-- | src/usr/hwas/makefile | 8 | ||||
-rw-r--r-- | src/usr/hwas/test/hwas1test.H | 60 | ||||
-rw-r--r-- | src/usr/hwas/test/hwasGardTest.H | 67 |
6 files changed, 240 insertions, 79 deletions
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C index 9080f64c0..3d3ab10ca 100644 --- a/src/usr/hwas/common/hwas.C +++ b/src/usr/hwas/common/hwas.C @@ -88,7 +88,6 @@ errlHndl_t discoverTargets() hwasState.present = false; hwasState.functional = false; hwasState.changedSinceLastIPL = false; - hwasState.gardLevel = 0; target->setAttr<ATTR_HWAS_STATE>(hwasState); } diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C new file mode 100644 index 000000000..6d90c3b6d --- /dev/null +++ b/src/usr/hwas/common/hwasCallout.C @@ -0,0 +1,175 @@ +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/hwas/common/hwasCallout.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ +/** + * @file hwasCallout.C + * + * HardWare Availability Service Callout functions. + * + */ + + +/******************************************************************************/ +// Includes +/******************************************************************************/ +#include <stdint.h> + +#include <hwas/common/hwasCallout.H> +#include <hwas/common/hwasCommon.H> +#include <hwas/common/hwas_reasoncodes.H> +#include <hwas/deconfigGard.H> +#include <targeting/common/attributes.H> +#include <errl/errlmanager.H> + +namespace HWAS +{ + +class RegisterHWASFunctions +{ + public: + RegisterHWASFunctions() + { + // HWAS is awake - register our processCallout function + HWAS_DBG("module load: calling errlog::setHwasProcessCalloutFn"); + ERRORLOG::ErrlManager::setHwasProcessCalloutFn((processCalloutFn)(&processCallout)); + } +}; +// this causes the function to get run at module load. +RegisterHWASFunctions registerHWASFunctions; + +void processCallout(const uint32_t i_errlPlid, + uint8_t *i_pData, + uint64_t i_Size) +{ + HWAS_INF("processCallout entry. plid 0x%x data %p %lld", + i_errlPlid, i_pData, i_Size); + + callout_ud_t *pCalloutUD = (callout_ud_t *)i_pData; + errlHndl_t errl = NULL; + switch (pCalloutUD->type) + { + 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 + { + // 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 INVALID_TARGET + * @devdesc Invalid Target encountered into processCallout + */ + errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + MOD_PROCESS_CALLOUT, + RC_INVALID_TARGET); + errlCommit(errl, HWAS_COMP_ID); + break; + } + + HWAS_INF("HW callout; pTarget %p", pTarget); + const DeconfigEnum deconfigState = pCalloutUD->deconfigState; + const GARD_ErrorType gardErrorType = pCalloutUD->gardErrorType; + //const callOutPriority priority = pCalloutUD->priority; + switch (gardErrorType) + { + case (GARD_NULL): + { // means no GARD operations + break; + } + default: + { + // call HWAS common function + errl = HWAS::theDeconfigGard().createGardRecord(*pTarget, + i_errlPlid, + GARD_Fatal); + break; + } + } // switch gardErrorType + switch (deconfigState) + { + case (NO_DECONFIG): + { + break; + } + case (DECONFIG): + { + // call HWAS common function + errl = HWAS::theDeconfigGard().deconfigureTarget(*pTarget, + i_errlPlid); + break; + } + case (DELAYED_DECONFIG): + { + // call HWAS common function + // TODO RTC: 45781 + //errl = HWAS::theDeconfigGard().registerDelayedDeconfigure(*pTarget, + //i_errlPlid); + break; + } + } // switch deconfigState + break; + } + case (PROCEDURE_CALLOUT): + { + HWAS_INF("Procedure callout; proc 0x%x priority 0x%x", + pCalloutUD->type, pCalloutUD->type); + //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); + break; + } + default: + { + HWAS_ERR("bad data in Callout UD %x", pCalloutUD->type); + break; + } + } // switch + + HWAS_INF("processCallout exit errl %p", errl); +} // processCallout + +}; // end namespace diff --git a/src/usr/hwas/deconfigGard.C b/src/usr/hwas/deconfigGard.C index 549c5e09d..6bb65cf39 100644 --- a/src/usr/hwas/deconfigGard.C +++ b/src/usr/hwas/deconfigGard.C @@ -206,11 +206,11 @@ errlHndl_t DeconfigGard::deconfigureTarget(TARGETING::Target & i_target, //****************************************************************************** errlHndl_t DeconfigGard::createGardRecord(const TARGETING::Target & i_target, const uint32_t i_errlPlid, - const GardSeverity i_severity) + const GARD_ErrorType i_errorType) { TRAC_ERR("Usr Request: Create GARD Record"); mutex_lock(&iv_mutex); - errlHndl_t l_pErr = _createGardRecord(i_target, i_errlPlid, i_severity); + errlHndl_t l_pErr = _createGardRecord(i_target, i_errlPlid, i_errorType); mutex_unlock(&iv_mutex); return l_pErr; } @@ -468,7 +468,7 @@ void DeconfigGard::_getDeconfigureRecords( //****************************************************************************** errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target, const uint32_t i_errlPlid, - const GardSeverity i_severity) + const GARD_ErrorType i_errorType) { errlHndl_t l_pErr = NULL; @@ -539,7 +539,7 @@ errlHndl_t DeconfigGard::_createGardRecord(const TARGETING::Target & i_target, l_pRecord->iv_targetId = l_id; // TODO Setup iv_cardMruSn or iv_chipMruEcid l_pRecord->iv_errlogPlid = i_errlPlid; - l_pRecord->iv_severity = i_severity; + l_pRecord->iv_errorType = i_errorType; l_pRecord->iv_padding[0] = 0; l_pRecord->iv_padding[1] = 0; l_pRecord->iv_padding[2] = 0; diff --git a/src/usr/hwas/makefile b/src/usr/hwas/makefile index 57958474a..e17115296 100644 --- a/src/usr/hwas/makefile +++ b/src/usr/hwas/makefile @@ -30,11 +30,11 @@ VPATH += ${ROOTPATH}/src/usr/hwas/common MODULE = hwas -# files in this directory -OBJS = hwas.o deconfigGard.o +# files in hwas/common directory +OBJS = hwas.o hwasCallout.o -# files in hwas/plat -OBJS += hwasPlat.o hostbootIstep.o +# files in this directory +OBJS += hwasPlat.o hostbootIstep.o deconfigGard.o SUBDIRS = test.d diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H index 894db8a1a..168aeba15 100644 --- a/src/usr/hwas/test/hwas1test.H +++ b/src/usr/hwas/test/hwas1test.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/targeting/test/targetingtest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/hwas/test/hwas1test.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef __TESTTARGETING_H #define __TESTTARGETING_H @@ -80,7 +81,6 @@ public: l_hwasState.present = true; l_hwasState.functional = true; l_hwasState.changedSinceLastIPL = true; - l_hwasState.gardLevel = 3; // Now write the modified value back to Targeting. l_pTarget->setAttr<ATTR_HWAS_STATE>( l_hwasState ); @@ -110,13 +110,6 @@ public: l_pTarget->getAttr<ATTR_HWAS_STATE>().changedSinceLastIPL ); } - if ( l_pTarget->getAttr<ATTR_HWAS_STATE>().gardLevel != 3 ) - { - TS_FAIL( " gardLevel = 0x%x, should be 3", - l_pTarget->getAttr<ATTR_HWAS_STATE>().gardLevel ); - } - - // // Now write the original value back. // @@ -150,13 +143,6 @@ public: TS_FAIL( " changedSinceLastIPL = 0x%x, not restored", l_pTarget->getAttr<ATTR_HWAS_STATE>().changedSinceLastIPL ); } - - if ( l_pTarget->getAttr<ATTR_HWAS_STATE>().gardLevel - != l_orgHwasState.gardLevel ) - { - TS_FAIL( " gardLevel = 0x%x, not restored", - l_pTarget->getAttr<ATTR_HWAS_STATE>().gardLevel ); - } } TS_TRACE( "testHWASReadWrite exit" ); diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H index 9338678e9..f1d10c032 100644 --- a/src/usr/hwas/test/hwasGardTest.H +++ b/src/usr/hwas/test/hwasGardTest.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/hwas/test/hwasGardTest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/hwas/test/hwasGardTest.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef _HWASGARDTEST_H #define _HWASGARDTEST_H @@ -445,7 +446,7 @@ public: // valid PLID l_pErr = HWAS::theDeconfigGard(). createGardRecord(*l_pTarget, 0, - HWAS::DeconfigGard::GARD_SEVERITY_PREDICTIVE); + HWAS::GARD_Predictive); if (l_pErr) { @@ -469,11 +470,11 @@ public: break; } - if (l_records[0].iv_severity != - HWAS::DeconfigGard::GARD_SEVERITY_PREDICTIVE) + if (l_records[0].iv_errorType != + HWAS::GARD_Predictive) { - TS_FAIL("testGard4: Record severity %d, expected predictive", - l_records[0].iv_severity); + TS_FAIL("testGard4: Record errorType %d, expected predictive", + l_records[0].iv_errorType); break; } @@ -552,7 +553,7 @@ public: // valid PLID l_pErr = HWAS::theDeconfigGard(). createGardRecord(*l_pTarget, 0, - HWAS::DeconfigGard::GARD_SEVERITY_PREDICTIVE); + HWAS::GARD_Predictive); if (l_pErr) { @@ -563,7 +564,7 @@ public: // Create another GARD Record for the chip l_pErr = HWAS::theDeconfigGard(). createGardRecord(*l_pTarget, 0, - HWAS::DeconfigGard::GARD_SEVERITY_FATAL); + HWAS::GARD_Fatal); if (l_pErr) { @@ -662,7 +663,7 @@ public: // valid PLID l_pErr = HWAS::theDeconfigGard(). createGardRecord(*l_pTarget, 0, - HWAS::DeconfigGard::GARD_SEVERITY_PREDICTIVE); + HWAS::GARD_Predictive); if (l_pErr) { @@ -673,7 +674,7 @@ public: // Create another GARD Record for the chip l_pErr = HWAS::theDeconfigGard(). createGardRecord(*l_pTarget, 0, - HWAS::DeconfigGard::GARD_SEVERITY_FATAL); + HWAS::GARD_Fatal); if (l_pErr) { @@ -801,7 +802,7 @@ public: // valid PLID l_pErr = HWAS::theDeconfigGard(). createGardRecord(*l_pTarget, 0, - HWAS::DeconfigGard::GARD_SEVERITY_PREDICTIVE); + HWAS::GARD_Predictive); if (l_pErr) { @@ -812,7 +813,7 @@ public: // Create another GARD Record for the chip l_pErr = HWAS::theDeconfigGard(). createGardRecord(*l_pTarget, 0, - HWAS::DeconfigGard::GARD_SEVERITY_FATAL); + HWAS::GARD_Fatal); if (l_pErr) { |