summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--src/include/usr/hwas/common/deconfigGard.H56
-rw-r--r--src/include/usr/hwas/common/hwas_reasoncodes.H6
-rw-r--r--src/include/usr/hwas/hwasPlatDeconfigGard.H2
-rw-r--r--src/usr/errl/runtime/makefile16
-rw-r--r--src/usr/errl/runtime/test/makefile5
-rw-r--r--src/usr/errl/runtime/test/test_runtimeDeconfig.H290
-rw-r--r--src/usr/hwas/common/deconfigGard.C69
-rw-r--r--src/usr/hwas/hwasPlatDeconfigGard.C154
-rw-r--r--src/usr/runtime/test/makefile1
9 files changed, 592 insertions, 7 deletions
diff --git a/src/include/usr/hwas/common/deconfigGard.H b/src/include/usr/hwas/common/deconfigGard.H
index 25e12f455..ad1e80282 100644
--- a/src/include/usr/hwas/common/deconfigGard.H
+++ b/src/include/usr/hwas/common/deconfigGard.H
@@ -455,6 +455,62 @@ public:
*/
void platPostDeconfigureTarget(TARGETING::Target * i_pTarget);
+ /**
+ * @brief Deconfigures a Target at runtime
+ *
+ * Called from PRD, in response to a checkstop attention from phyp
+ *
+ * This function will call the platform specific function to do the
+ * deconfigure actions.
+ *
+ * NOTE: Currently only core targets are supported
+ *
+ * @param[in] i_pTarget const pointer to the core target to deconfigure
+ * @param[in] i_deconfigureAction Deconfigure options -
+ * FULLY_AT_RUNTIME
+ * @param[in] i_deconfigErrl - error log assocated with this deconfig
+ * request. The error handle is non-null
+ * the eid of the errorlog will be listed as
+ * the deconfig reason, otherwise the
+ * reason will be DECONFIGURED_BY_PRD
+ *
+ * @return errlHndl_t. Error log handle.
+ */
+ errlHndl_t deconfigureTargetAtRuntime(
+ TARGETING::ConstTargetHandle_t const i_pTarget,
+ const DeconfigureFlags i_deconfigureAction,
+ const errlHndl_t i_deconfigErrl);
+
+ /**
+ *
+ * @brief Deconfigures a Target at runtime
+ *
+ * Platform specific implementation to deconfgure a target at runtime
+ *
+ * This function will deconfigure the target, do any
+ * post deconfigure actions and will skip deconfiguring any associated
+ * child targets. Any errors deconfiguring targets are committed and
+ * the function continues. The only errors returned are usage errors.
+ *
+ * @param[in] i_pTarget const pointer to Target to deconfigure.
+ * @param[in] i_deconfigureAction Deconfigure options -
+ * FULLY_AT_RUNTIME
+ * @param[in] i_deconfigErrl - error log assocated with this deconfig
+ * request. The error handle is non-null
+ * the eid of the errorlog will be listed as
+ * the deconfig reason, otherwise the
+ * reason will be DECONFIGURED_BY_PRD
+ *
+ * @return errlHndl_t. Error log handle.
+ */
+
+#ifdef __HOSTBOOT_RUNTIME
+ errlHndl_t platDeconfigureTargetAtRuntime(
+ TARGETING::ConstTargetHandle_t const i_pTarget,
+ const DeconfigureFlags i_deconfigureAction,
+ const errlHndl_t i_deconfigErrl);
+#endif
+
protected:
/**
diff --git a/src/include/usr/hwas/common/hwas_reasoncodes.H b/src/include/usr/hwas/common/hwas_reasoncodes.H
index 09d90a796..54e5ec494 100644
--- a/src/include/usr/hwas/common/hwas_reasoncodes.H
+++ b/src/include/usr/hwas/common/hwas_reasoncodes.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -34,6 +34,7 @@ namespace HWAS
MOD_CHECK_MIN_HW = 0x03,
MOD_DECONFIG_TARGETS_FROM_GARD = 0x04,
MOD_VALIDATE_EC_LEVELS = 0x05,
+ MOD_RUNTIME_DECONFIG = 0x06,
};
enum HwasReasonCode
@@ -58,6 +59,9 @@ namespace HWAS
RC_SYSAVAIL_NO_NX_FUNC = HWAS_COMP_ID | 0x0E,
RC_EC_MISMATCH = HWAS_COMP_ID | 0x0F,
RC_FAILED_EC_VALIDATION = HWAS_COMP_ID | 0x10,
+ RC_INVALID_PARAM = HWAS_COMP_ID | 0x11,
+ RC_NOT_AT_RUNTIME = HWAS_COMP_ID | 0x12,
+ RC_NULL_TARGET = HWAS_COMP_ID | 0x13,
};
};
diff --git a/src/include/usr/hwas/hwasPlatDeconfigGard.H b/src/include/usr/hwas/hwasPlatDeconfigGard.H
index c439a4215..4f74e5d4d 100644
--- a/src/include/usr/hwas/hwasPlatDeconfigGard.H
+++ b/src/include/usr/hwas/hwasPlatDeconfigGard.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
diff --git a/src/usr/errl/runtime/makefile b/src/usr/errl/runtime/makefile
index d4d097dfe..4c6f20262 100644
--- a/src/usr/errl/runtime/makefile
+++ b/src/usr/errl/runtime/makefile
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2013,2017
+# Contributors Listed Below - COPYRIGHT 2013,2018
# [+] International Business Machines Corp.
#
#
@@ -29,6 +29,18 @@ MODULE = errl_rt
#include common ojects between hostboot and runtime hostboot
include ../errl.mk
+#needed to compile hwasPlatDeconfigGard in runtime context
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2
+EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include
+
+
+# need find the source for this hwp in runtime env
+VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm
+
VPATH += ${ROOTPATH}/src/usr/hwas/common
VPATH += ${ROOTPATH}/src/usr/hwas
@@ -37,6 +49,8 @@ OBJS += rt_vfs.o
OBJS += hwasCallout.o
OBJS += deconfigGard.o
OBJS += hwasPlatDeconfigGard.o
+OBJS += p9_update_ec_eq_state.o
+
SUBDIRS += test.d
diff --git a/src/usr/errl/runtime/test/makefile b/src/usr/errl/runtime/test/makefile
index de9d58e18..8c9326ca8 100644
--- a/src/usr/errl/runtime/test/makefile
+++ b/src/usr/errl/runtime/test/makefile
@@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2013,2014
+# Contributors Listed Below - COPYRIGHT 2013,2018
+# [+] International Business Machines Corp.
+#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -24,6 +26,7 @@ HOSTBOOT_RUNTIME = 1
ROOTPATH = ../../../../..
MODULE = testerrl_rt
+
TESTS = *.H
include ${ROOTPATH}/config.mk
diff --git a/src/usr/errl/runtime/test/test_runtimeDeconfig.H b/src/usr/errl/runtime/test/test_runtimeDeconfig.H
new file mode 100644
index 000000000..2f5d37259
--- /dev/null
+++ b/src/usr/errl/runtime/test/test_runtimeDeconfig.H
@@ -0,0 +1,290 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/errl/runtime/test/test_runtimeDeconfig.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* Licensed under the Apache License, Version 2.0 (the "License"); */
+/* you may not use this file except in compliance with the License. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef _TEST_DECONFIGRUNTIME_H
+#define _TEST_DECONFIGRUNTIME_H
+
+#include <cxxtest/TestSuite.H>
+#include <attributestructs.H>
+#include <errl/errlmanager.H>
+#include <runtime/interface.h>
+#include <hwas/common/hwas_reasoncodes.H>
+#include <hwas/common/hwas.H>
+#include <hwas/common/deconfigGard.H>
+#include <targeting/common/utilFilter.H>
+
+extern trace_desc_t* g_trac_runtime;
+
+// enable this test to execute all unit tests
+//#define __ENABLE_DECONFIG_TEST
+
+class deconfigureTargetAtRuntimeTest : public CxxTest::TestSuite
+{
+ public:
+
+
+ void testNullTarget()
+ {
+ TRACFCOMP(g_trac_runtime, "testNullTarget running");
+
+ // pass in a null target pointer
+ TARGETING::Target * l_target = nullptr;
+
+ errlHndl_t l_errl =
+ HWAS::theDeconfigGard().deconfigureTargetAtRuntime(
+ l_target,
+ HWAS::DeconfigGard::FULLY_AT_RUNTIME,
+ l_errl);
+
+ do{
+
+ if(l_errl)
+ {
+ TRACFCOMP(g_trac_runtime, "testNullTarget:"
+ " errl returned (expected)");
+
+ //Check module id and reason code
+ if((l_errl->moduleId() == HWAS::MOD_RUNTIME_DECONFIG) and
+ (l_errl->reasonCode() == HWAS::RC_NULL_TARGET))
+ {
+ TRACFCOMP(g_trac_runtime, "testNullTarget:"
+ " error's module id and reason code match "
+ "expected values");
+
+ }
+ else
+ {
+ TS_FAIL("testNullTarget: error with unexpected"
+ " module id/reason code returned. Expected module "
+ "id = 0x%x returned module id = 0x%x; expected "
+ "reason code ="
+ " 0x%x returned reason code = 0x%x",
+ HWAS::MOD_RUNTIME_DECONFIG,
+ l_errl->moduleId(),
+ HWAS::RC_INVALID_TARGET,
+ l_errl->reasonCode());
+ errlCommit(l_errl, CXXTEST_COMP_ID);
+ break;
+ }
+ delete l_errl;
+ l_errl = nullptr;
+ }
+ else
+ {
+ TS_FAIL("testNullTarget: no errl returned from"
+ " checkHbResMemLimit under error condition");
+ }
+
+ }while(0);
+ TRACFCOMP(g_trac_runtime, "testNullTarget finished");
+ }
+
+
+ void testInvalidDeconfigOption()
+ {
+ TRACFCOMP(g_trac_runtime, "testInvalidDeconfig running");
+
+ TARGETING::Target * l_target = nullptr;
+
+ TARGETING::TargetHandleList l_cores;
+ TARGETING::getAllChiplets(l_cores, TARGETING::TYPE_CORE);
+
+ if( l_cores.size() == 0 )
+ {
+ TS_FAIL("Unable to execute test, found 0 cores");
+
+ }
+
+ l_target = l_cores.at(0);
+
+ errlHndl_t l_errl =
+ HWAS::theDeconfigGard().deconfigureTargetAtRuntime(
+ l_target,
+ HWAS::DeconfigGard::SPEC_DECONFIG,
+ l_errl);
+ do{
+
+ if(l_errl)
+ {
+ TRACDCOMP(g_trac_runtime, "testInvalidDeconfigOption:"
+ " errl returned (expected)");
+
+ //Check module id and reason code
+ if((l_errl->moduleId() == HWAS::MOD_RUNTIME_DECONFIG) and
+ (l_errl->reasonCode() == HWAS::RC_INVALID_PARAM))
+ {
+ TRACDCOMP(g_trac_runtime, "testInvalidDeconfigOption:"
+ " error's module id and reason code match "
+ "expected values");
+
+ }
+ else
+ {
+ TS_FAIL("testInvalidDeconfigOption: error with unexpected"
+ " module id/reason code returned. Expected module "
+ "id = 0x%x returned module id = 0x%x; expected "
+ "reason code = 0x%x returned reason code = 0x%x",
+ HWAS::MOD_RUNTIME_DECONFIG,
+ l_errl->moduleId(),
+ HWAS::RC_INVALID_PARAM,
+ l_errl->reasonCode());
+ errlCommit(l_errl, CXXTEST_COMP_ID);
+ break;
+ }
+ delete l_errl;
+ l_errl = nullptr;
+ }
+ else
+ {
+ TS_FAIL("testInvalidDeconfigOption: no errl returned from"
+ " checkHbResMemLimit under error condition");
+ }
+
+ }while(0);
+ TRACFCOMP(g_trac_runtime, "testInvalidDeconfigOption finished");
+ }
+
+ void testInvalidTarget()
+ {
+ TRACFCOMP(g_trac_runtime, "testInvalidTarget running");
+
+ TARGETING::TargetHandleList l_proc;
+ TARGETING::getAllChips(l_proc, TARGETING::TYPE_PROC);
+
+ if( l_proc.size() == 0 )
+ {
+ TS_FAIL("Unable to execute test, found procs");
+ }
+
+ TARGETING::Target * l_target = l_proc.at(0);
+
+ errlHndl_t l_errl =
+ HWAS::theDeconfigGard().deconfigureTargetAtRuntime(
+ l_target,
+ HWAS::DeconfigGard::FULLY_AT_RUNTIME,
+ l_errl);
+
+ do{
+
+ if(l_errl)
+ {
+ TRACDCOMP(g_trac_runtime, "deconfigureTargetAtRuntime:"
+ " errl returned (expected)");
+ //Check module id and reason code
+ if((l_errl->moduleId() == HWAS::MOD_RUNTIME_DECONFIG) and
+ (l_errl->reasonCode() == HWAS::RC_INVALID_TARGET))
+ {
+ TRACDCOMP(g_trac_runtime, "testInvalidTarget:"
+ " error's module id and reason code match "
+ "expected values");
+ }
+ else
+ {
+
+ TS_FAIL("testInvalidTarget: error with unexpected"
+ " module id/reason code returned. Expected "
+ "module id = 0x%x returned module id = "
+ "0x%x; expected reason code = 0x%x returned "
+ "reason code = 0x%x",
+ HWAS::MOD_RUNTIME_DECONFIG,
+ l_errl->moduleId(),
+ HWAS::RC_INVALID_TARGET,
+ l_errl->reasonCode());
+ errlCommit(l_errl, CXXTEST_COMP_ID);
+ break;
+
+ }
+ delete l_errl;
+ l_errl = nullptr;
+ }
+ else
+ {
+ TS_FAIL("testInvalidTarget: no errl returned from"
+ " deconfigTargetAtRuntime under error condition");
+ }
+
+ }while(0);
+ TRACFCOMP(g_trac_runtime, "testInvalidTarget finished");
+ }
+
+ void testDeconfigAtRuntime()
+ {
+ TRACFCOMP(g_trac_runtime, "testDeconfigAtRuntime running");
+
+#ifndef __ENABLE_DECONFIG_TEST
+ // NOTE: This test marks targets nonfunctional and then
+ // restore them. Since all the unit tests run in
+ // parallel, this may cause other tests to fail.
+ // Do not leave this test enabled for normal operations.
+ TS_TRACE(INFO_MRK "SKIPPING: other tests could be affected.");
+#else
+ TARGETING::TargetHandleList l_cores;
+ TARGETING::getAllChiplets(l_cores, TARGETING::TYPE_CORE);
+
+ if( l_cores.size() == 0 )
+ {
+ TS_FAIL("Unable to execute test, found procs");
+ }
+
+ TARGETING::Target * l_target = l_cores.at(0);
+
+ TARGETING::HwasState l_origState =
+ l_target->getAttr<TARGETING::ATTR_HWAS_STATE>();
+
+ errlHndl_t l_errl =
+ HWAS::theDeconfigGard().deconfigureTargetAtRuntime(
+ l_target,
+ HWAS::DeconfigGard::FULLY_AT_RUNTIME,
+ l_errl);
+
+ if(l_errl)
+ {
+ TS_FAIL("testDeconfigAtRuntime: deconfigureTargetAtRuntime"
+ " returned an unexpected error");
+ errlCommit(l_errl, CXXTEST_COMP_ID);
+ }
+ else
+ {
+ TRACDCOMP(g_trac_runtime, "testDeconfigAtRuntime:"
+ " no error returned (expected)");
+
+ TARGETING::HwasState l_state =
+ l_target->getAttr<TARGETING::ATTR_HWAS_STATE>();
+
+ if(l_state.functional)
+ {
+ TS_FAIL("testDeconfigureAtRuntime(): target functional after deconfigure");
+ }
+
+ l_target->setAttr<TARGETING::ATTR_HWAS_STATE>(l_origState);
+ }
+#endif
+ TRACFCOMP(g_trac_runtime, "testDeconfigAtRuntime finished");
+ }
+
+
+};
+
+
+#endif
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
diff --git a/src/usr/runtime/test/makefile b/src/usr/runtime/test/makefile
index 7eaaae928..d2aa63c9d 100644
--- a/src/usr/runtime/test/makefile
+++ b/src/usr/runtime/test/makefile
@@ -23,7 +23,6 @@
#
# IBM_PROLOG_END_TAG
ROOTPATH = ../../../..
-
MODULE = testruntime
TESTS += testpreverifiedlidmgr.H
TESTS += test_checkHbResMemLimit.H
OpenPOWER on IntegriCloud