summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice/istepdispatcher
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2017-07-21 11:15:42 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-07-28 10:43:42 -0400
commitf54d606af645343351d086b1de237f021f38cb21 (patch)
tree5f0a86acb216888dc0f15e71c6032c0d795b444e /src/usr/initservice/istepdispatcher
parent481baf1c81c945ce3d354097a6452cb8ecba38d6 (diff)
downloadtalos-hostboot-f54d606af645343351d086b1de237f021f38cb21.tar.gz
talos-hostboot-f54d606af645343351d086b1de237f021f38cb21.zip
Secure Boot: Shutdown after key transition
- Fence off istep path after istep dispatcher stops - Automatically power off after a key transition has completed - Added IPMI API to power off system Change-Id: I74eaec08e86d0cbc46db6aa1674845c53bcf14d4 RTC: 174017 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43436 Tested-by: Jenkins Server <pfd-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> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com> Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/initservice/istepdispatcher')
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C65
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.H7
2 files changed, 58 insertions, 14 deletions
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index 2444b98ad..5edf4f835 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -655,6 +655,9 @@ errlHndl_t IStepDispatcher::executeAllISteps()
// possible
ERRORLOG::ErrlManager::callFlushErrorLogs();
+ // Quiesce new isteps, including external requests
+ (void)setStopIpl();
+
// Stop the IPL
stop();
}
@@ -1505,11 +1508,20 @@ void IStepDispatcher::handleShutdownMsg(msg_t * & io_pMsg)
#ifdef CONFIG_BMC_IPMI
void IStepDispatcher::requestReboot()
{
- // always stop dispatching isteps before calling for the reboot
- setStopIpl();
+ // Always stop dispatching isteps before calling for the reboot
+ (void)setStopIpl();
+
+ // Send a reboot message to the BMC
+ (void)IPMI::initiateReboot();
+}
+
+void IStepDispatcher::requestPowerOff()
+{
+ // Always stop dispatching isteps before calling for the power off
+ (void)setStopIpl();
- // send a reboot message to the BMC
- IPMI::initiateReboot();
+ // Send a power off message to the BMC
+ (void)IPMI::initiatePowerOff();
}
#endif
// ----------------------------------------------------------------------------
@@ -1744,21 +1756,42 @@ void IStepDispatcher::handleIStepRequestMsg(msg_t * & io_pMsg)
l_acceptMessages = iv_acceptIstepMessages;
mutex_unlock(&iv_mutex);
- if (l_acceptMessages)
+ // If istep dispatching has ceased, prevent new isteps from executing
+ if(iv_stopIpl == true)
+ {
+ /*@
+ * @errortype
+ * @reasoncode ISTEP_PROCESSING_DISABLED
+ * @severity ERRORLOG::ERRL_SEV_INFORMATIONAL
+ * @moduleid ISTEP_INITSVC_MOD_ID
+ * @userdata1 Istep Requested
+ * @userdata2 Substep Requested
+ * @devdesc Istep processing has terminated due to normal shutdown
+ * activity, secure boot key transition, or terminating error
+ * @custdesc Node is no longer accepting istep requests
+ */
+ err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_INFORMATIONAL,
+ ISTEP_INITSVC_MOD_ID,
+ ISTEP_PROCESSING_DISABLED,
+ istep,
+ substep);
+ }
+ else if (l_acceptMessages)
{
err = doIstep (istep, substep, l_doReconfig);
}
else
{
/*@
- * @errortype
- * @reasoncode ISTEP_NON_MASTER_NODE_MSG
- * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid ISTEP_INITSVC_MOD_ID
- * @userdata1 Istep Requested
- * @userdata2 Substep Requested
- * @devdesc Istep messaged received by non-master node.
- */
+ * @errortype
+ * @reasoncode ISTEP_NON_MASTER_NODE_MSG
+ * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid ISTEP_INITSVC_MOD_ID
+ * @userdata1 Istep Requested
+ * @userdata2 Substep Requested
+ * @devdesc Istep messaged received by non-master node.
+ */
err = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_UNRECOVERABLE,
ISTEP_INITSVC_MOD_ID,
@@ -2236,9 +2269,15 @@ void requestReboot()
{
IStepDispatcher::getTheInstance().requestReboot();
}
+
+void requestPowerOff()
+{
+ IStepDispatcher::getTheInstance().requestPowerOff();
+}
#endif
void stopIpl()
{
+ // Disable the istep dispatcher
return IStepDispatcher::getTheInstance().setStopIpl();
}
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H
index cd3c26dcb..59e0fd45b 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.H
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H
@@ -216,9 +216,14 @@ public:
void stop();
#ifdef CONFIG_BMC_IPMI
/**
- * @brief This function will trigger a reboot via ipmi commands
+ * @brief Trigger a reboot via IPMI commands
*/
void requestReboot();
+
+ /**
+ * @brief Trigger a power off via IPMI commands
+ */
+ void requestPowerOff();
#endif
/**
OpenPOWER on IntegriCloud