summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2018-10-12 15:03:44 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-10-17 08:18:29 -0500
commit39c57d2a42c30cc87a47f279ead88ea304f68440 (patch)
treecd1dcad0c6d54a5abf0f4b94a603c00065735b05
parent6dc98524f3673a1c49bffcc738a7a7c09af7c989 (diff)
downloadtalos-hostboot-39c57d2a42c30cc87a47f279ead88ea304f68440.tar.gz
talos-hostboot-39c57d2a42c30cc87a47f279ead88ea304f68440.zip
Serialize all attribute synchronization calls
Forces all FSP attribute synchronizations down to FSP to serialize in the attribute resource provider attribute synchronization daemon thread to avoid concurrenty problems. Change-Id: Ifb355ba6f42872465ea3d6f0d9009cfd6f768d7a CQ: SW448280 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/67450 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: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/include/usr/targeting/attrrp.H79
-rw-r--r--src/include/usr/targeting/attrsync.H24
-rw-r--r--src/include/usr/targeting/common/targreasoncodes.H1
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C3
-rw-r--r--src/usr/isteps/istep07/call_mss_attr_update.C3
-rw-r--r--src/usr/isteps/istep16/call_host_ipl_complete.C2
-rw-r--r--src/usr/mbox/mailboxsp.C14
-rw-r--r--src/usr/sbe/sbe_update.C5
-rw-r--r--src/usr/secureboot/trusted/trustedboot.C3
-rwxr-xr-xsrc/usr/targeting/attrrp.C204
10 files changed, 256 insertions, 82 deletions
diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H
index c25fa8290..b04973230 100644
--- a/src/include/usr/targeting/attrrp.H
+++ b/src/include/usr/targeting/attrrp.H
@@ -347,10 +347,12 @@ class AttrRP
{
// Prepare runtime for secure transition of attributes
MSG_MM_RP_RUNTIME_PREP = 0x00000002,
- // Arm service to synchronize attributes when Hostboot shuts down
- MSG_PRIME_SHUTDOWN_ATTR_SYNC = 0x00000003,
- // Invoke attribute synchronization at shutdown
- MSG_INVOKE_SHUTDOWN_ATTR_SYNC = 0x00000004,
+ // Arm service to synchronize attributes
+ MSG_PRIME_ATTR_SYNC = 0x00000003,
+ // Invoke attribute synchronization
+ MSG_INVOKE_ATTR_SYNC = 0x00000004,
+ // Sentinel value for when message type is not yet known
+ MSG_INVALID = 0xFFFFFFFF,
};
/**
@@ -365,12 +367,18 @@ class AttrRP
};
/**
- * @brief Notifies the attribute resource provider that a specific
- * resource of interest is ready/available
+ * @brief This is a static wrapper around _notifyResourceReady
*
- * @param[in] i_resource Resource that is ready/available
+ * @see _notifyResourceReady for documentation
*/
- static void notifyResourceReady(RESOURCE i_resource);
+ static errlHndl_t notifyResourceReady(RESOURCE i_resource);
+
+ /**
+ * @brief This is a static wrapper around _syncAllAttributesToFsp
+ *
+ * @see _syncAllAttributesToFsp for documentation
+ */
+ static errlHndl_t syncAllAttributesToFsp();
/**
* @brief Modifies the memory R/W permissions on VMM pages for a
@@ -483,7 +491,7 @@ class AttrRP
#ifndef __HOSTBOOT_RUNTIME
: iv_msgQ(nullptr), iv_attrSyncMsgQ(msg_q_create()),
iv_sections(nullptr), iv_sectionCount(0),
- iv_shutdownAttrSyncPrimed(false),iv_isMpipl(false)
+ iv_attrSyncPrimed(false),iv_isMpipl(false)
#else
: iv_isTempInstance(false), iv_isMpipl(false)
#endif
@@ -621,13 +629,44 @@ class AttrRP
* resource of interest is ready/available
*
* @param[in] i_resource Resource that is ready/available
+ *
+ * @return errlHndl_t Error log handle
+ * @retval nullptr Resource notification successful
+ * @retval !nullptr Resource notification failed; handle
+ * references valid error log
*/
- void _notifyResourceReady(RESOURCE i_resource) const;
+ errlHndl_t _notifyResourceReady(RESOURCE i_resource) const;
/**
- * @brief Synchronizes attributes to FSP during a user space initiated
- * shutdown
+ * @brief Forces attributes to sync down to FSP
*
+ * @return errlHndl_t Error log handle
+ * @retval nullptr Attribute synchronization successful
+ * @retval !nullptr Attribute synchronization failed; handle
+ * references valid error log
+ */
+ errlHndl_t _syncAllAttributesToFsp() const;
+
+ /**
+ * @brief Sends message of the given type to the attribute resource
+ * provider
+ *
+ * @param[in] i_msgType Type of message to send
+ * @param[in] i_sync true, if the message is synchronous, false
+ * otherwise
+ *
+ * @return errlHndl_t Error log handle
+ * @retval nullptr Message processed successfully
+ * @retval !nullptr Message processing failed; handle references
+ * valid error log
+ */
+ errlHndl_t _sendAttrSyncMsg(
+ ATTRRP_MSG_TYPE i_msgType,
+ bool i_sync) const;
+
+ /**
+ * @brief Synchronizes attributes to FSP
+ * *
* @par Detailed Description:
* During a user space initiated shutdown, the init service calls
* the resource provider shutdown handler which attempts to
@@ -635,9 +674,16 @@ class AttrRP
* the FSP must be available, the mailbox must be online (and have
* earlier called notifyResourceReady API to arm the
* synchronization), and SBE must not be quiesced (or mailbox
- * traffic going through the SBE FIFO in secure mode will fail)
+ * traffic going through the SBE FIFO in secure mode will fail).
+ * Various isteps also invoke attribute synchronization explicitly
+ * via this API when needed.
+ *
+ * @return errlHndl_t Error log handle
+ * @retval nullptr Attribute synchronization successful
+ * @retval !nullptr Attribute synchronization failed; handle
+ * references valid error log
*/
- void invokeShutdownAttrSync() const;
+ errlHndl_t _invokeAttrSync() const;
/**
* @brief Processes daemon messages
@@ -764,9 +810,8 @@ class AttrRP
// Count of attribute sections.
size_t iv_sectionCount;
- // Whether service is primed to invoke attribute synchronization when
- // Hostboot shuts down under user space control
- bool iv_shutdownAttrSyncPrimed;
+ // Whether service is primed to invoke attribute synchronization
+ bool iv_attrSyncPrimed;
#else
// Indicator that AttrRP instance is a temporary one, not the singleton
bool iv_isTempInstance;
diff --git a/src/include/usr/targeting/attrsync.H b/src/include/usr/targeting/attrsync.H
index 1d48e7964..fdee416de 100644
--- a/src/include/usr/targeting/attrsync.H
+++ b/src/include/usr/targeting/attrsync.H
@@ -253,19 +253,25 @@ namespace TARGETING
};
#ifndef __HOSTBOOT_RUNTIME
+
/**
- * @brief Handles synchronization of all RW targeting attributes from
- * hostboot to the fsp; the following sections are
- * synchronized.
+ * @brief Synchronizes all RW targeting attributes from Hostboot to the
+ * FSP without providing any safety for concurrent invocations. It is
+ * up to the caller to provide that safety. Callers (other than the
+ * attribute resource provider itself), should instead use the
+ * attribute resource provider's "syncAllAttributesToFsp" API to
+ * safely synchronize attributes to the FSP.
*
- * 1). SECTION_TYPE_PNOR_RW
- * 2). SECTION_TYPE_HEAP_PNOR_INIT
- * 3). SECTION_TYPE_HEAP_PNOR_ZERO_INIT
+ * The following sections are synchronized:
*
+ * 1) SECTION_TYPE_PNOR_RW
+ * 2) SECTION_TYPE_HEAP_PNOR_INIT
+ * 3) SECTION_TYPE_HEAP_PNOR_ZERO_INIT
*
- * @return errlHndl_t
- * return errl == NULL -> success
- * return errl != NULL -> failure
+ * @return errlHndl_t Error log handle
+ * @return nullptr Success
+ * @return !nullptr Failed to synchonize attributes to FSP; error log
+ * handle references valid error log
*/
errlHndl_t syncAllAttributesToFsp();
diff --git a/src/include/usr/targeting/common/targreasoncodes.H b/src/include/usr/targeting/common/targreasoncodes.H
index bdad3212a..c5e2882f8 100644
--- a/src/include/usr/targeting/common/targreasoncodes.H
+++ b/src/include/usr/targeting/common/targreasoncodes.H
@@ -53,6 +53,7 @@ enum TargetingModuleId
TARG_EDIT_PAGE_PERMISSIONS = 0x0D,
TARG_NOTIFY_RESOURCE_READY = 0x0E,
TARG_ATTR_SYNC_TASK = 0x0F,
+ TARG_SEND_ATTR_SYNC_MSG = 0x10,
};
enum TargetingReasonCode
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index 7fe1f0038..08e2391f6 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -49,6 +49,7 @@
#include <initservice/initserviceif.H>
#include <targeting/common/targetservice.H>
#include <targeting/attrsync.H>
+#include <targeting/attrrp.H>
#include <fapi2/plat_attr_override_sync.H>
#include <mbox/mbox_queues.H> // HB_ISTEP_MSGQ
#include <mbox/mboxif.H> // register mailbox
@@ -1013,7 +1014,7 @@ errlHndl_t IStepDispatcher::doIstep(uint32_t i_istep,
TRACFCOMP(g_trac_initsvc,
INFO_MRK"doIstep: sync attributes to FSP");
- errlHndl_t l_errl = TARGETING::syncAllAttributesToFsp();
+ errlHndl_t l_errl = TARGETING::AttrRP::syncAllAttributesToFsp();
if(l_errl)
{
diff --git a/src/usr/isteps/istep07/call_mss_attr_update.C b/src/usr/isteps/istep07/call_mss_attr_update.C
index 1cbfcfb65..4ebd3d099 100644
--- a/src/usr/isteps/istep07/call_mss_attr_update.C
+++ b/src/usr/isteps/istep07/call_mss_attr_update.C
@@ -52,6 +52,7 @@
// targeting support
#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
+#include <targeting/attrrp.H>
// HWAS
#include <hwas/common/hwas.H>
@@ -309,7 +310,7 @@ errlHndl_t check_proc0_memory_config(IStepError & io_istepErr)
do
{
// Sync all attributes to the FSP
- l_err = syncAllAttributesToFsp();
+ l_err = TARGETING::AttrRP::syncAllAttributesToFsp();
if( l_err )
{
// Something failed on the sync. Commit the error here
diff --git a/src/usr/isteps/istep16/call_host_ipl_complete.C b/src/usr/isteps/istep16/call_host_ipl_complete.C
index df2e6305c..279070745 100644
--- a/src/usr/isteps/istep16/call_host_ipl_complete.C
+++ b/src/usr/isteps/istep16/call_host_ipl_complete.C
@@ -303,7 +303,7 @@ void* call_host_ipl_complete (void *io_pArgs)
}
// Sync attributes to Fsp
- l_err = syncAllAttributesToFsp();
+ l_err = TARGETING::AttrRP::syncAllAttributesToFsp();
if( l_err )
{
diff --git a/src/usr/mbox/mailboxsp.C b/src/usr/mbox/mailboxsp.C
index 1e462dbbe..7ce3b9e25 100644
--- a/src/usr/mbox/mailboxsp.C
+++ b/src/usr/mbox/mailboxsp.C
@@ -229,9 +229,19 @@ errlHndl_t MailboxSp::_init()
if(!err)
{
// call ErrlManager function - tell him that MBOX is ready!
+ // Note: this API does -not- return an error log, unlike the one below.
ERRORLOG::ErrlManager::errlResourceReady(ERRORLOG::MBOX);
- TARGETING::AttrRP::notifyResourceReady(
- TARGETING::AttrRP::RESOURCE::MAILBOX);
+
+ // Inform attribute resource provider to enable FSP attribute sync
+ // functionality
+ err = TARGETING::AttrRP::notifyResourceReady(
+ TARGETING::AttrRP::RESOURCE::MAILBOX);
+ if(err)
+ {
+ TRACFCOMP(g_trac_mbox, ERR_MRK
+ "MailboxSp::_init: Failed in call to "
+ "TARGETING::AttrRP::notifyResourceReady.");
+ }
}
#endif
diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C
index cfa3372ec..4792de5bd 100644
--- a/src/usr/sbe/sbe_update.C
+++ b/src/usr/sbe/sbe_update.C
@@ -36,6 +36,7 @@
#include <targeting/common/targetservice.H>
#include <targeting/common/target.H>
#include <targeting/targplatutil.H>
+#include <targeting/attrrp.H>
#include <util/align.H>
#include <util/crc32.H>
#include <util/misc.H>
@@ -277,7 +278,7 @@ namespace SBE
{
// Sync all attributes to FSP before we quiesce all the
// SBEs.
- err = syncAllAttributesToFsp();
+ err = TARGETING::AttrRP::syncAllAttributesToFsp();
if( err )
{
// Failed to sync all attributes to FSP; this is not
@@ -5535,7 +5536,7 @@ errlHndl_t sbeDoReboot( void )
&& !g_do_hw_keys_hash_transition)
{
// Sync all attributes to the FSP before doing the Shutdown
- err = syncAllAttributesToFsp();
+ err = TARGETING::AttrRP::syncAllAttributesToFsp();
if( err )
{
// Something failed on the sync. Commit the error here
diff --git a/src/usr/secureboot/trusted/trustedboot.C b/src/usr/secureboot/trusted/trustedboot.C
index 7b06c59c9..28122df6c 100644
--- a/src/usr/secureboot/trusted/trustedboot.C
+++ b/src/usr/secureboot/trusted/trustedboot.C
@@ -39,6 +39,7 @@
#include <errl/errludtarget.H>
#include <errl/errludstring.H>
#include <targeting/attrsync.H>
+#include <targeting/attrrp.H>
#include <targeting/targplatutil.H>
#include <targeting/common/targetservice.H>
#include <targeting/common/commontargeting.H>
@@ -1289,7 +1290,7 @@ void tpmVerifyFunctionalPrimaryTpmExists(
// TPM alignment check.
if(INITSERVICE::spBaseServicesEnabled())
{
- err = TARGETING::syncAllAttributesToFsp();
+ err = TARGETING::AttrRP::syncAllAttributesToFsp();
if(err)
{
TRACFCOMP(g_trac_trustedboot, ERR_MRK"Could not sync"
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C
index 404468aec..2a9e8c463 100755
--- a/src/usr/targeting/attrrp.C
+++ b/src/usr/targeting/attrrp.C
@@ -153,30 +153,46 @@ namespace TARGETING
io_taskRetErrl = l_errl;
}
- void AttrRP::notifyResourceReady(const RESOURCE i_resource)
+ errlHndl_t AttrRP::notifyResourceReady(const RESOURCE i_resource)
{
- Singleton<AttrRP>::instance()._notifyResourceReady(i_resource);
+ return Singleton<AttrRP>::instance()._notifyResourceReady(i_resource);
}
- void AttrRP::_notifyResourceReady(const RESOURCE i_resource) const
+ errlHndl_t AttrRP::syncAllAttributesToFsp()
+ {
+ return Singleton<AttrRP>::instance()._syncAllAttributesToFsp();
+ }
+
+ errlHndl_t AttrRP::_syncAllAttributesToFsp() const
{
TRACFCOMP(g_trac_targeting, ENTER_MRK
- "AttrRP::notifyResourceReady: resource type = 0x%02X.",
+ "AttrRP::_syncAllAttributesToFsp");
+ auto pError = _sendAttrSyncMsg(MSG_INVOKE_ATTR_SYNC,true);
+ TRACFCOMP(g_trac_targeting, EXIT_MRK
+ "AttrRP::_syncAllAttributesToFsp");
+ return pError;
+ }
+
+ errlHndl_t AttrRP::_notifyResourceReady(const RESOURCE i_resource) const
+ {
+ TRACFCOMP(g_trac_targeting, ENTER_MRK
+ "AttrRP::_notifyResourceReady: resource type = 0x%02X.",
i_resource);
- auto pMsg = msg_allocate();
+ auto msgType = MSG_INVALID;
+ const bool sync=false;
switch (i_resource)
{
case MAILBOX:
{
- pMsg->type = MSG_PRIME_SHUTDOWN_ATTR_SYNC;
+ msgType = MSG_PRIME_ATTR_SYNC;
}
break;
default:
{
TRACFCOMP(g_trac_targeting, ERR_MRK
- "AttrRP::notifyResourceReady: Bug! Unhandled "
+ "AttrRP::_notifyResourceReady: Bug! Unhandled "
"resource type = 0x%02X.",
i_resource);
assert(0);
@@ -184,50 +200,135 @@ namespace TARGETING
break;
}
- auto rc = msg_send(iv_attrSyncMsgQ,pMsg);
+ errlHndl_t pError = _sendAttrSyncMsg(msgType,sync);
+ if(pError)
+ {
+ TRACFCOMP(g_trac_targeting, ERR_MRK
+ "AttrRP::_notifyResourceReady: Failed in call to "
+ "_sendAttrSyncMsg; msgType = 0x%08X, sync = %d.",
+ msgType,sync);
+ }
+
+ TRACFCOMP(g_trac_targeting, EXIT_MRK
+ "AttrRP::_notifyResourceReady");
+
+ return pError;
+ }
+
+ errlHndl_t AttrRP::_sendAttrSyncMsg(
+ const ATTRRP_MSG_TYPE i_msgType,
+ const bool i_sync) const
+ {
+ TRACFCOMP(g_trac_targeting, ENTER_MRK
+ "AttrRP::_sendAttrSyncMsg: i_msgType = 0x%08X, i_sync = %d.",
+ i_msgType,
+ i_sync);
+
+ errlHndl_t pError = nullptr;
+ auto pMsg = msg_allocate();
+ pMsg->type = i_msgType;
+ int rc = 0;
+
+ if(sync)
+ {
+ rc = msg_sendrecv(iv_attrSyncMsgQ,pMsg);
+ }
+ else
+ {
+ rc = msg_send(iv_attrSyncMsgQ,pMsg);
+ }
+
+ bool logError=false;
+ uint32_t plid=0;
+ int msgRc=0;
+
if (rc)
{
TRACFCOMP(g_trac_targeting, ERR_MRK
- "AttrRP::notifyResourceReady: Failed in msg_send for "
- "resource type = 0x%02X, message type = 0x%08X; rc = %d.",
- i_resource,pMsg->type,rc);
+ "AttrRP::_sendAttrSyncMsg: Failed in %s. "
+ "Message type = 0x%08X, sync = %d, rc = %d.",
+ sync ? "msg_sendrecv" : "msg_send",
+ pMsg->type,sync,rc);
+ logError=true;
+ }
+ else if(sync)
+ {
+ if(pMsg->data[1])
+ {
+ msgRc=static_cast<int>(pMsg->data[1]);
+ TRACFCOMP(g_trac_targeting, ERR_MRK
+ "AttrRP::_sendAttrSyncMsg: Message (type = 0x%08X) "
+ "returned with rc = %d.",
+ pMsg->type,msgRc);
+ logError=true;
+ }
+
+ if(pMsg->extra_data)
+ {
+ plid=static_cast<uint32_t>(
+ reinterpret_cast<uint64_t>(pMsg->extra_data));
+ TRACFCOMP(g_trac_targeting, ERR_MRK
+ "AttrRP::_sendAttrSyncMsg: Message (type = 0x%08X) "
+ "returned with failure related to PLID = 0x%08X.",
+ pMsg->type,plid);
+ logError=true;
+ }
+ }
+
+ if(logError)
+ {
/*@
* @errortype
- * @moduleid TARG_NOTIFY_RESOURCE_READY
- * @reasoncode TARG_RC_ATTR_MSG_FAIL
- * @userdata1 Resource type
- * @userdata2 Return code
- * @devdesc Failed to alert attribute resource provider that a
- * specific resource is available. Various shutdown
- * steps, such as synchronizing attributes to FSP, may not
- * trigger as a result.
- * @custdesc Unexpected boot firmware error occurred
+ * @moduleid TARG_SEND_ATTR_SYNC_MSG
+ * @reasoncode TARG_RC_ATTR_MSG_FAIL
+ * @userdata1[00:31] Message type
+ * @userdata1[32:63] API return code (from msg_send or
+ * msg_sendrecv; 0=N/A)
+ * @userdata2[00:31] Message return code (0=N/A)
+ * @userdata2[32:63] Message error PLID (0=N/A)
+ * @devdesc Failed to either send/(receive) the requested
+ * message to/from the attribute resource provider OR the
+ * provider failed executing the message request.
+ * @custdesc Unexpected boot firmware error occurred
*/
- errlHndl_t pError = new ErrlEntry(
+ pError = new ErrlEntry(
ERRL_SEV_UNRECOVERABLE,
- TARG_NOTIFY_RESOURCE_READY,
+ TARG_SEND_ATTR_SYNC_MSG,
TARG_RC_ATTR_MSG_FAIL,
- i_resource,
- static_cast<uint64_t>(rc),
+ TWO_UINT32_TO_UINT64(pMsg->type,rc),
+ TWO_UINT32_TO_UINT64(msgRc,plid),
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);
+ pError->collectTrace(TARG_COMP_NAME);
+ if(plid)
+ {
+ pError->plid(plid);
+ }
+ }
- errlCommit(pError,TARG_COMP_ID);
+ if(sync)
+ {
+ msg_free(pMsg);
+ pMsg = nullptr;
}
TRACFCOMP(g_trac_targeting, EXIT_MRK
- "AttrRP::notifyResourceReady: rc = %d.",rc);
+ "AttrRP::_sendAttrSyncMsg: rc = %d, msgRc = %d, plid = "
+ "0x%08X.",
+ rc,msgRc,plid);
+
+ return pError;
}
- void AttrRP::invokeShutdownAttrSync() const
+ errlHndl_t AttrRP::_invokeAttrSync() const
{
errlHndl_t pError = nullptr;
do {
- if(!iv_shutdownAttrSyncPrimed)
+ if(!iv_attrSyncPrimed)
{
- TRACFCOMP(g_trac_targeting, INFO_MRK "invokeShutdownAttrSync: "
- "Shutdown attribute sync not primed; suppressing "
+ TRACFCOMP(g_trac_targeting, INFO_MRK "_invokeAttrSync: "
+ "Attribute sync not primed; suppressing "
"attribute sync.");
break;
}
@@ -236,7 +337,7 @@ namespace TARGETING
// sync request
if(!INITSERVICE::spBaseServicesEnabled())
{
- TRACFCOMP(g_trac_targeting, INFO_MRK "invokeShutdownAttrSync: "
+ TRACFCOMP(g_trac_targeting, INFO_MRK "_invokeAttrSync: "
"FSP services not available; suppressing "
"attribute sync.");
break;
@@ -252,7 +353,7 @@ namespace TARGETING
pMasterProc);
if(pError)
{
- TRACFCOMP(g_trac_targeting, ERR_MRK "invokeShutdownAttrSync: "
+ TRACFCOMP(g_trac_targeting, ERR_MRK "_invokeAttrSync: "
"Failed to determine master processor target; "
"suppressing attribute sync.");
break;
@@ -260,25 +361,22 @@ namespace TARGETING
if(pMasterProc->getAttr<TARGETING::ATTR_ASSUME_SBE_QUIESCED>())
{
- TRACFCOMP(g_trac_targeting, INFO_MRK "invokeShutdownAttrSync; SBE "
+ TRACFCOMP(g_trac_targeting, INFO_MRK "_invokeAttrSync; SBE "
"is quiesced; suppressing attribute sync.");
break;
}
- pError = syncAllAttributesToFsp();
+ pError = TARGETING::syncAllAttributesToFsp();
if(pError)
{
- TRACFCOMP(g_trac_targeting, ERR_MRK "invokeShutdownAttrSync: "
+ TRACFCOMP(g_trac_targeting, ERR_MRK "_invokeAttrSync: "
"Failed syncing attributes to FSP.");
break;
}
} while(0);
- if(pError)
- {
- errlCommit(pError,TARG_COMP_ID);
- }
+ return pError;
}
void AttrRP::attrSyncTask()
@@ -286,6 +384,8 @@ namespace TARGETING
// Crash Hostboot if this task dies
(void)task_detach();
+ errlHndl_t pError=nullptr;
+
TRACFCOMP(g_trac_targeting, ENTER_MRK "AttrRP::attrSyncTask.");
// Register to synchronize applicable attributes down to FSP when
@@ -295,11 +395,12 @@ namespace TARGETING
// registration happened already.
INITSERVICE::registerShutdownEvent(TARG_COMP_ID,
iv_attrSyncMsgQ,
- MSG_INVOKE_SHUTDOWN_ATTR_SYNC,
+ MSG_INVOKE_ATTR_SYNC,
INITSERVICE::NO_PRIORITY);
while(1)
{
int rc = 0;
+ uint32_t plid = 0;
auto pMsg = msg_wait(iv_attrSyncMsgQ);
if (!pMsg)
@@ -316,22 +417,22 @@ namespace TARGETING
switch(pMsg->type)
{
- case MSG_PRIME_SHUTDOWN_ATTR_SYNC:
+ case MSG_PRIME_ATTR_SYNC:
{
- iv_shutdownAttrSyncPrimed=true;
+ iv_attrSyncPrimed=true;
TRACFCOMP(g_trac_targeting, INFO_MRK
"AttrRP: attrSyncTask: "
"Attribute provider primed to synchronize "
- "attributes at shutdown.");
+ "attributes.");
}
break;
- case MSG_INVOKE_SHUTDOWN_ATTR_SYNC:
+ case MSG_INVOKE_ATTR_SYNC:
{
TRACFCOMP(g_trac_targeting, INFO_MRK
"AttrRP: attrSyncTask: "
- "Invoking shutdown attribute sync.");
+ "Invoking attribute sync.");
- (void)invokeShutdownAttrSync();
+ pError = _invokeAttrSync();
}
break;
default:
@@ -360,13 +461,18 @@ namespace TARGETING
* sync daemon.
* @custdesc Unexpected boot firmware failure
*/
- auto pError = new ErrlEntry(
+ pError = new ErrlEntry(
ERRL_SEV_UNRECOVERABLE,
TARG_ATTR_SYNC_TASK,
TARG_RC_UNSUPPORTED_ATTR_SYNC_MSG,
TO_UINT64(rc),
TO_UINT64(pMsg->type),
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);
+ }
+
+ if(pError)
+ {
+ plid = pError->plid();
errlCommit(pError,TARG_COMP_ID);
}
@@ -381,7 +487,9 @@ namespace TARGETING
else
{
// Respond to request.
- pMsg->data[1] = rc;
+ pMsg->data[1] = static_cast<uint64_t>(rc);
+ pMsg->extra_data = reinterpret_cast<void*>(
+ static_cast<uint64_t>(plid));
rc = msg_respond(iv_attrSyncMsgQ, pMsg);
if (rc)
{
OpenPOWER on IntegriCloud