summaryrefslogtreecommitdiffstats
path: root/src/include/usr/targeting
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 /src/include/usr/targeting
parent6dc98524f3673a1c49bffcc738a7a7c09af7c989 (diff)
downloadblackbird-hostboot-39c57d2a42c30cc87a47f279ead88ea304f68440.tar.gz
blackbird-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>
Diffstat (limited to 'src/include/usr/targeting')
-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
3 files changed, 78 insertions, 26 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
OpenPOWER on IntegriCloud