summaryrefslogtreecommitdiffstats
path: root/src/include/usr/targeting/common/targetservice.H
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2018-05-03 16:35:08 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-06-02 16:10:29 -0400
commit17d1f78337ea7f5bfbb0ee727e63495dd7bb437b (patch)
tree539d51896e9e422751e5acb1a705fb46aaf7578d /src/include/usr/targeting/common/targetservice.H
parent1d21270b627aaef8b43aff215fa626ff0d36347d (diff)
downloadtalos-hostboot-17d1f78337ea7f5bfbb0ee727e63495dd7bb437b.tar.gz
talos-hostboot-17d1f78337ea7f5bfbb0ee727e63495dd7bb437b.zip
Refactor re-init of targeting data during MPIPL/HBRT startup
There are a couple of things we have to do to targets/attrs when we either transition from Hostboot->HBRT or from HBRT->Hostboot during an MPIPL. These include resetting all of the mutex attrs so they are in the unlocked state and updating the pointer which PEER_TARGET stores as a value to reflect the change in the memory mapping. For both of these tasks we need to loop through all of the targets.This refactor allows both these tasks to be done in the same loop. Change-Id: I23614bba11b2c9eabb97a7ddc7a53937f83dc131 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58316 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> 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: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr/targeting/common/targetservice.H')
-rw-r--r--src/include/usr/targeting/common/targetservice.H64
1 files changed, 57 insertions, 7 deletions
diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H
index 860a5564b..37bf6216e 100644
--- a/src/include/usr/targeting/common/targetservice.H
+++ b/src/include/usr/targeting/common/targetservice.H
@@ -563,6 +563,33 @@ class TargetService
void dump() const;
#ifndef __HOSTBOOT_RUNTIME
+
+ /**
+ * @brief This func changes the readOnly section of the targeting data
+ * to be writeable, allowing hostboot to update attributes that
+ * are read-only. After attributes are updated the user should
+ * toggle back to making the section readOnly
+ *
+ * This top level interface calls the lower level attribute resource
+ * provider interface to modify R/W permissions on the VMM pages it has
+ * mapped for each of the different sections of the targeting data. This
+ * function specifically provides a way to toggle the ability to write to
+ * the readOnly pages of the targeting data.
+ *
+ * @param[in] i_allowWrites If TRUE will change R/W permissions of readOnly
+ * targeting data to be writable
+ * If FALSE will change R/W permissions of readOnly
+ * targeting data to be readOnly
+ *
+ * @pre AttrRp must be initialized
+ *
+ * @post R/W permissions of the readOnly section of the targeting data will
+ * be modified depending on boolean parameter.
+ *
+ * @return Error handle holding any errors accrued during execution
+ */
+ errlHndl_t modifyReadOnlyPagePermissions(bool i_allowWrites);
+
/**
* @brief Updates the targeting/attribute section data with the
* specified vector parameters.
@@ -790,23 +817,46 @@ class TargetService
AttrRP *i_attrRP,
ATTRIBUTE_ID* &o_pAttrId,
AbstractPointer<void>* &o_ppAttrAddr);
+ /**
+ * @brief Update the address that PEER_TARGET points to for a given target
+ *
+ * @par Detailed Description:
+ * The PEER_TARGET attribute is a pointer to a target's peer. The location
+ * of the target changes when we transition from Hostboot<->HBRT. After
+ * transitioning to runtime, or if we perform an MPIPL this function needs
+ * to be run on all targets in order to insure any target with a PEER_TARGET
+ * attribute gets the PEER_TARGET's pointer looked up again and set to the
+ * new value.
+ *
+ * @param[in] i_pTarget pointer to target to update PEER_TARGET attr for
+ *
+ * @pre TargetService must be initialized.
+ *
+ * @post If the target passed in has a PEER_TARGET , its value will be updated
+ *
+ * @return TRUE if target was updated , FALSE if PEER_TARGET was not updated
+ */
+ bool updatePeerTarget( const Target* i_pTarget);
+
#ifdef __HOSTBOOT_MODULE
/**
- * @brief Reset all hostboot mutex attributes
+ * @brief Reset all hostboot mutex attributes on a given target
*
* @par Detailed Description:
- * Iterates through all targets and check each of their attributes to
- * see if they are of type hbmutex. If we find a mutex attribute we will
- * run mutex_init on it to reset it.
+ * Take in target and check each of its attributes to see if they are
+ * of type hbmutex. If we find a mutex attribute we will run mutex_init
+ * on it to reset it.
+ *
+ * @param[in] i_pTarget pointer to target to reset mutex attrs on
*
* @pre TargetService must be initialized.
* AttrRp must be initialized
*
- * @post All hb mutex attributes on all targets have been reset
+ * @post All hb mutex attributes on given target have been reset
*
- * @return void
+ * @return number of mutex attributes reset
*/
- void resetMutexAttributes();
+ uint32_t resetMutexAttributes( const Target* i_pTarget);
#endif
private:
OpenPOWER on IntegriCloud