summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2018-03-05 18:35:40 -0600
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-04-12 16:31:07 -0400
commit0fbaeccfec9bfc60e37dad4a7660040862b1e2ac (patch)
treed366b7f579db62549f71e59ff75b3dd5029a7e6e /src/usr/hwas
parent9964a274521177f062debb85fbd2e7b3022847be (diff)
downloadtalos-hostboot-0fbaeccfec9bfc60e37dad4a7660040862b1e2ac.tar.gz
talos-hostboot-0fbaeccfec9bfc60e37dad4a7660040862b1e2ac.zip
Add deconfigTargetAtRuntime interface
-PRD will call this function in response to a core unit checkstop detected by PHYP. The new function will mark the core as non-functional and call a hardware procdure to update the multicast groups for cores and chiplets. The procedure will also update the OCC core configuration status and the quad core status registers which reflect the number of enable cores/quad in the system at runtime. Change-Id: Ia7fc3f47dc1fee1f84d877d3d56b609d1aee1b17 RTC:188918 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55154 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Richard Ward <rward15@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/hwas')
-rw-r--r--src/usr/hwas/common/deconfigGard.C69
-rw-r--r--src/usr/hwas/hwasPlatDeconfigGard.C154
2 files changed, 221 insertions, 2 deletions
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C
index 805915f5a..ad7cc1ecd 100644
--- a/src/usr/hwas/common/deconfigGard.C
+++ b/src/usr/hwas/common/deconfigGard.C
@@ -978,7 +978,7 @@ errlHndl_t DeconfigGard::deconfigureTarget(
do
{
// Do not deconfig Target if we're NOT being asked to force AND
- // the is System is at runtime
+ // the System is at runtime
if ((i_deconfigRule == NOT_AT_RUNTIME) &&
platSystemIsAtRuntime())
{
@@ -2015,7 +2015,13 @@ void DeconfigGard::_deconfigureByAssoc(
// no action
break;
} // switch
- } // !i_Runkime
+ } // !i_Runtime
+ else
+ {
+ HWAS_INF("_deconfigureByAssoc() - system is at runtime"
+ " skipping all association checks beyond"
+ " the CHILD");
+ }
HWAS_DBG("_deconfigureByAssoc exiting: %.8X", get_huid(&i_target));
} // _deconfigByAssoc
@@ -2871,5 +2877,64 @@ bool DeconfigGard::anyChildFunctional(Target & i_parent)
return retVal;
} //anyChildFunctional
+#ifdef __HOSTBOOT_MODULE
+/******************************************************************************/
+// deconfigureTargetAtRuntime
+/******************************************************************************/
+errlHndl_t DeconfigGard::deconfigureTargetAtRuntime(
+ TARGETING::ConstTargetHandle_t const i_pTarget,
+ const DeconfigGard::DeconfigureFlags i_deconfigureAction,
+ const errlHndl_t i_deconfigErrl)
+
+{
+
+ errlHndl_t l_errl = nullptr;
+
+ uint32_t deconfigReason =
+ (i_deconfigErrl) ?
+ i_deconfigErrl->eid() : DeconfigGard::DECONFIGURED_BY_PRD;
+
+ HWAS_INF(">>>deconfigureTargetAtRuntime() - "
+ "Input Target HUID:0x%08X Deconfig Action"
+ " 0x%08X Deconfig Reason :0x%08X",
+ get_huid(i_pTarget),i_deconfigureAction,
+ deconfigReason);
+
+#ifdef __HOSTBOOT_RUNTIME
+
+ l_errl = platDeconfigureTargetAtRuntime(
+ i_pTarget,
+ i_deconfigureAction,
+ i_deconfigErrl
+ );
+#else
+ HWAS_ERR("deconfigureTargetAtRuntime() - "
+ "called outside of hbrt context");
+ /*@
+ * @errortype
+ * @moduleid MOD_RUNTIME_DECONFIG
+ * @reasoncode RC_NOT_AT_RUNTIME
+ * @userdata1 HUID of the target
+ * @userdata2 deconfig reason - either error log id, or
+ * DeconfigGard::DECONFIGURED_BY_PRD
+ *
+ * @devdesc deconfigureTargetAtRuntime is currently only
+ * supported in hostboot runtime, this error
+ * indicates the function was called outside of
+ * the hostboot runtime context.
+ * @custdesc Host firmware encountered an
+ * internal error
+ */
+
+ l_errl = hwasError(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ MOD_RUNTIME_DECONFIG,RC_NOT_AT_RUNTIME,
+ get_huid(i_pTarget),deconfigReason
+ );
+#endif
+ HWAS_INF(">>>deconfigureTargetAtRuntime()" );
+ return l_errl ;
+}
+#endif
} // namespace HWAS
diff --git a/src/usr/hwas/hwasPlatDeconfigGard.C b/src/usr/hwas/hwasPlatDeconfigGard.C
index 920f69ef2..419ac3cdf 100644
--- a/src/usr/hwas/hwasPlatDeconfigGard.C
+++ b/src/usr/hwas/hwasPlatDeconfigGard.C
@@ -50,6 +50,13 @@
#include <runtime/interface.h> // g_hostInterfaces
#include <runtime/hbrt_utilities.H> // createGenericFspMsg
#include <util/runtime/rt_fwreq_helper.H> // firmware_request_helper
+#include <errl/errludtarget.H>
+
+// includes to support the fapi2 hwp call in
+// platDeconfigureTargetAtRuntime()
+#include <fapi2/target.H>
+#include <p9_update_ec_eq_state.H>
+#include <fapi2/plat_hwp_invoker.H>
#endif
#ifdef CONFIG_TPMDD
@@ -713,4 +720,151 @@ errlHndl_t hwasError(const uint8_t i_sev,
return l_pErr;
}
+#ifdef __HOSTBOOT_RUNTIME
+/******************************************************************************/
+// platDeconfigureTargetAtRuntime
+/******************************************************************************/
+errlHndl_t DeconfigGard::platDeconfigureTargetAtRuntime(
+ TARGETING::ConstTargetHandle_t const i_pTarget,
+ const DeconfigureFlags i_deconfigureAction,
+ const errlHndl_t i_deconfigErrl)
+{
+
+ HWAS_INF(">>>platDeconfigureTargetAtRuntime()");
+
+ errlHndl_t l_errl = nullptr;
+
+ do
+ {
+ if( i_pTarget == nullptr )
+ {
+ HWAS_ERR("Target is NULL.");
+ /*@
+ * @errortype
+ * @moduleid MOD_RUNTIME_DECONFIG
+ * @reasoncode RC_NULL_TARGET
+ * @devdesc Target is NULL
+ * @custdesc Host Firmware encountered an internal
+ * error
+ */
+ l_errl = hwasError(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ HWAS::MOD_RUNTIME_DECONFIG,
+ HWAS::RC_NULL_TARGET,0,0);
+
+ break;
+ }
+
+ if(i_pTarget->getAttr<TARGETING::ATTR_TYPE>() !=
+ TARGETING::TYPE_CORE)
+ {
+ // only supporting cores
+ /*@
+ * @errortype
+ * @moduleid MOD_RUNTIME_DECONFIG
+ * @reasoncode RC_INVALID_TARGET
+ * @devdesc Target is not a TYPE_CORE
+ * userdata1 target huid
+ * @custdesc Host Firmware encountered an internal
+ * error
+ */
+ l_errl = hwasError(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ HWAS::MOD_RUNTIME_DECONFIG,
+ HWAS::RC_INVALID_TARGET,get_huid(i_pTarget),0);
+ break;
+ }
+
+
+ switch(i_deconfigureAction)
+ {
+ case DeconfigGard::FULLY_AT_RUNTIME:
+
+ HWAS_INF(" Deconfig action FULLY_AT_RUNTIME :0x%08X",
+ DeconfigGard::FULLY_AT_RUNTIME);
+
+ break;
+
+ default:
+ HWAS_ERR("Caller passed invalid DeconfigAction: 0x%08X",
+ i_deconfigureAction);
+ /*@
+ * @errortype
+ * @moduleid MOD_RUNTIME_DECONFIG
+ * @reasoncode RC_INVALID_PARAM
+ * @userdata1 HUID of the target
+ * @userdata2 Target type
+ * @userdata3 Target class
+ * @userdata4 Deconfig Action
+ * @devdesc Caller passed invalid deconfigure action
+ * @custdesc Host firmware encountered an
+ * internal error
+ */
+ l_errl = hwasError(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ HWAS::MOD_RUNTIME_DECONFIG,
+ HWAS::RC_INVALID_PARAM,0,0);
+
+ break;
+ }
+
+ }while(0);
+
+ if(l_errl == nullptr)
+ {
+ uint32_t l_deconfigReason = (i_deconfigErrl) ? i_deconfigErrl->eid() :
+ DeconfigGard::DECONFIGURED_BY_PRD;
+
+ HWAS_INF("deconfigureTargetAtRuntime() - "
+ "Input Target HUID:0x%08X Deconfig Action"
+ " 0x%08X deconfigReason:0x%08X",
+ get_huid(i_pTarget),i_deconfigureAction,
+ l_deconfigReason);
+
+
+ bool l_isTargetDeconfigured = false;
+ // deconfigureTarget() checks for targets that can be deconfigured at
+ // runtime
+ l_errl = theDeconfigGard().deconfigureTarget(
+ const_cast<TARGETING::Target&>(*i_pTarget),
+ l_deconfigReason,
+ &l_isTargetDeconfigured,
+ i_deconfigureAction);
+
+ if(l_errl == nullptr && l_isTargetDeconfigured)
+ {
+ HWAS_INF("platDeconfigureTargetAtRuntime() - "
+ "deconfigure successful");
+
+ TARGETING::TYPE l_type = TARGETING::TYPE_PROC;
+ const TARGETING::Target * l_parent =
+ TARGETING::getParent(i_pTarget,l_type);
+ // get the parent proc and call the hwp to alert
+ // pm not to attempt to manage this core anymore
+ const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>
+ l_proc(const_cast<TARGETING::Target *>(l_parent));
+
+ HWAS_INF("platDeconfigureTargetAtRuntime() - "
+ "calling p9_update_ec_eq_state");
+ FAPI_INVOKE_HWP( l_errl,p9_update_ec_eq_state,l_proc);
+
+ if(l_errl)
+ {
+ HWAS_ERR("platDeconfigureTargetAtRuntime() - "
+ "call to p9_update_ec_eq_state() failed on proc "
+ "with HUID : %d",TARGETING::get_huid(l_proc));
+ ERRORLOG::ErrlUserDetailsTarget(l_proc).addToLog(l_errl);
+ }
+
+ }
+ else
+ {
+ HWAS_INF("platDeconfigureTargetAtRuntime() - deconfigure failed");
+ }
+ }
+ HWAS_INF(">>>platDeconfigureTargetAtRuntime()" );
+
+ return l_errl ;
+}
+
+#endif // __HOSTBOOT_RUNTIME
+
+
} // namespace HWAS
OpenPOWER on IntegriCloud