Skip to content

Commit

Permalink
Send errors from previous boots as callhome type eSELs
Browse files Browse the repository at this point in the history
During early boot, Hostboot attempts to resend unacknowledged error
logs from prior boots as eSELS, without correponding SELs.  BMCs typically
require both in order to expose a given error log to a customer.  This change
morphs errors from prior boots into callhome type logs, so that a simple eSEL
will be enough to get the error propagated.

Change-Id: If499defe8a39b9254f08392b264d72047b7e5f7c
CQ: SW426731
RTC: 193265
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/62079
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: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
Nick Bofferding authored and wghoffa committed Jul 17, 2018
1 parent 38834a9 commit 928ef69
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 13 deletions.
24 changes: 18 additions & 6 deletions src/include/usr/ipmi/ipmisel.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -51,6 +51,18 @@ namespace IPMISEL
MSG_LAST_TYPE = MSG_STATE_SHUTDOWN_SEL,
};

/**
* @brief data[0/1] format for the MSG_SEND_ESEL message
*/
struct send_esel_data_t
{
uint8_t callhome; // Whether the ESEL is of callhome type or not
uint8_t reserved1[3];
uint32_t eid; // Error ID of the error being described
uint64_t reserved2;

} PACKED;

typedef struct sel_info
{
uint8_t eventDirType;
Expand Down Expand Up @@ -309,12 +321,12 @@ namespace IPMISEL
};

/**
* @brief parse the msg and call send_esel to send the esel (handles if
* the SEL reservation is lost)
* @param[in] i_msg
* @param[in] i_infoCallHome - informational call-home log
* @brief Parse the message and call send_esel to send the eSEL (handles
* if the SEL reservation is lost).
*
* @param[in] i_msg Pointer to message to send. Asserts if nullptr.
*/
void process_esel(msg_t *i_msg, bool i_infoCallHome);
void process_esel(msg_t *i_msg);

/**
* @brief do the actual ipmi calls to send the esel data to the bmc
Expand Down
4 changes: 4 additions & 0 deletions src/usr/errl/errlmanager_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ void ErrlManager::sendErrLogToBmc(errlHndl_t &io_err, bool i_sendSels)
ERRL_COMP_ID, 1, ERRL_UDT_STRING );
io_err->iv_SectionVector.insert(io_err->iv_SectionVector.begin(),
l_ffdcSection);

// If this is an error from the previous boot, pass it off as a
// call home applicable log to get the eSEL propagated
l_callhome_type = true;
}

// flatten into buffer, truncate to max eSEL size
Expand Down
24 changes: 17 additions & 7 deletions src/usr/ipmi/ipmisel.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -103,14 +103,18 @@ void sendESEL(uint8_t* i_eselData, uint32_t i_dataSize,
msg_t *msg = msg_allocate();
#endif
msg->type = MSG_SEND_ESEL;
msg->data[0] = i_eid;
auto * const pData = reinterpret_cast<send_esel_data_t*>
(msg->data);
pData->callhome=i_infoCallHome;
pData->eid=i_eid;

eselInitData *eselData =
new eselInitData(i_selEventList, i_eselData, i_dataSize);

msg->extra_data = eselData;

#ifdef __HOSTBOOT_RUNTIME
process_esel(msg, i_infoCallHome);
process_esel(msg);
#else
// one message queue to the SEL thread
static msg_q_t mq = Singleton<IpmiSEL>::instance().msgQueue();
Expand All @@ -130,11 +134,17 @@ void sendESEL(uint8_t* i_eselData, uint32_t i_dataSize,
/*
* @brief process esel msg
*/
void process_esel(msg_t *i_msg, bool i_infoCallHome)
void process_esel(msg_t *i_msg)
{
errlHndl_t l_err = NULL;
IPMI::completion_code l_cc = IPMI::CC_UNKBAD;
const uint32_t l_eid = i_msg->data[0];

assert(i_msg != nullptr,"i_msg was nullptr");
const auto * const pData = reinterpret_cast<const send_esel_data_t*>
(i_msg->data);
const auto callhome = pData->callhome;
const auto l_eid = pData->eid;

eselInitData * l_data =
(eselInitData*)(i_msg->extra_data);
IPMI_TRAC(ENTER_MRK "process_esel");
Expand Down Expand Up @@ -181,7 +191,7 @@ void process_esel(msg_t *i_msg, bool i_infoCallHome)
while (l_send_count > 0)
{
// try to send the esel to the bmc
send_esel(l_data, l_err, l_cc, i_infoCallHome);
send_esel(l_data, l_err, l_cc, callhome);

// if no error but last completion code was:
if ((l_err == NULL) &&
Expand Down Expand Up @@ -555,7 +565,7 @@ void IpmiSEL::execute(void)
switch(msg_type)
{
case IPMISEL::MSG_SEND_ESEL:
IPMISEL::process_esel(msg, false);
IPMISEL::process_esel(msg);
//done with msg
msg_free(msg);
break;
Expand Down
9 changes: 9 additions & 0 deletions src/usr/secureboot/base/service.C
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,15 @@ void handleSecurebootFailure(errlHndl_t &io_err, const bool i_waitForShutdown,

errlCommit(io_err, SECURE_COMP_ID);

// If background shutdown requested, flush the error logs to ensure that the
// security error is committed to PNOR. Otherwise, it's possible for other
// fail paths to TI Hostboot before the shutdown completes, potentially
// leaving the security error uncommitted.
if(!i_waitForShutdown)
{
ErrlManager::callFlushErrorLogs();
}

// Shutdown with Secureboot error status
INITSERVICE::doShutdown(l_rc, !i_waitForShutdown);
}
Expand Down

0 comments on commit 928ef69

Please sign in to comment.