summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-10-17 08:23:52 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-01-08 13:23:52 -0500
commit0a1b60c34e55018e233c64b292e16c3479d2145c (patch)
tree0595baf0046a2f7391fbf772b0e231b76b3a5f2c /src/include/usr
parent1d862697f0b1256e7f7d1d620bf124eb2504d169 (diff)
downloadtalos-hostboot-0a1b60c34e55018e233c64b292e16c3479d2145c.tar.gz
talos-hostboot-0a1b60c34e55018e233c64b292e16c3479d2145c.zip
Concurrent code update of HBRT - Update Structure
Update Hostboot targeting data in the new targeting structure from the current targeting data. It will have the logic to save and restore values as appropriate. Change-Id: I7ae4a0c2e58548f6f1a6229f40b9fda833670e86 RTC: 180908 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48504 Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Reviewed-by: Brian E. Bakke <bbakke@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: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/runtime/rt_targeting.H26
-rw-r--r--src/include/usr/targeting/attrrp.H47
-rw-r--r--src/include/usr/targeting/attrsync.H45
-rw-r--r--src/include/usr/targeting/common/target.H30
-rw-r--r--src/include/usr/targeting/common/targetservice.H69
-rw-r--r--src/include/usr/targeting/common/targreasoncodes.H1
-rw-r--r--src/include/usr/util/utillidmgr.H1
7 files changed, 206 insertions, 13 deletions
diff --git a/src/include/usr/runtime/rt_targeting.H b/src/include/usr/runtime/rt_targeting.H
index 5895c9fad..a8e01c20b 100644
--- a/src/include/usr/runtime/rt_targeting.H
+++ b/src/include/usr/runtime/rt_targeting.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2016 */
+/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -54,7 +54,7 @@ namespace RT_TARG
rtChipId_t &o_targetId);
/**
- * @brier Convert a runtime chip_id (target) into a TARGETING::Target
+ * @brief Convert a runtime chip_id (target) into a TARGETING::Target
* @param[in] The rt chipId
* @param[out] The TARGETING::Target pointer
* @return error log handle on error else NULL
@@ -63,6 +63,28 @@ namespace RT_TARG
TARGETING::Target *& o_target);
/**
+ * @brief Save/Restore attribute values from current Reserved Memory data
+ * into new LID Structure data
+ * @param[in] Pointer to current Reserved Memory targeting binary data
+ * @param[in/out] Pointer to new LID Structure targeting binary data
+ * @return 0 on success, else return code
+ */
+ int saveRestoreAttrs(void *i_rsvdMemPtr,
+ void *io_lidStructPtr);
+
+ /**
+ * @brief Validate LID Structure against Reserved Memory. Check that the
+ * TargetingHeader eyecatchers are valid, that the TargetingHeader number of
+ * sections match, and that the types and sizes of each TargetingSection
+ * match.
+ * @param[in] Pointer to new LID Structure targeting binary data
+ * @param[in] Pointer to current Reserved Memory targeting binary data
+ * @return 0 on success, else return code
+ */
+ int validateData(void *i_lidStructPtr,
+ void *i_rsvdMemPtr);
+
+ /**
* @brief Apply ATTR_TMP overrides to be available for run time
*/
void applyTempOverrides( );
diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H
index 02772cb6d..1d5698d74 100644
--- a/src/include/usr/targeting/attrrp.H
+++ b/src/include/usr/targeting/attrrp.H
@@ -40,7 +40,6 @@
#include <sys/msg.h>
#include <targeting/adapters/types.H>
#include <targeting/common/targetservice.H>
-#include <targeting/attrsync.H>
#include <targeting/common/attributeTank.H>
namespace TARGETING
@@ -73,6 +72,11 @@ class AttrRP
const SECTION_TYPE i_sectionId,
const TARGETING::NODE_ID i_nodeId);
+#ifdef __HOSTBOOT_RUNTIME
+ friend int RT_TARG::saveRestoreAttrs(void *,
+ void *);
+#endif
+
public:
/**
@@ -216,6 +220,16 @@ class AttrRP
static errlHndl_t saveOverrides( uint8_t* i_dest,
size_t& io_size );
+#else
+ /**
+ * @brief Fill in new attribute resource provider for HBRT.
+ *
+ * @param[in] i_header
+ * TargetingHeader to use with filling in the new RT AttrRP.
+ *
+ * @return void
+ */
+ void fillInAttrRP(TargetingHeader* i_header);
#endif
protected:
@@ -228,22 +242,40 @@ class AttrRP
*/
AttrRP()
#ifndef __HOSTBOOT_RUNTIME
- : iv_msgQ(NULL), iv_sections(NULL), iv_sectionCount(0), iv_isMpipl(false)
+ : iv_msgQ(NULL), iv_sections(NULL), iv_sectionCount(0),
+ iv_isMpipl(false)
#else
- : iv_sections(NULL), iv_sectionCount(0), iv_isMpipl(false)
+ : iv_isTempInstance(false), iv_sections(NULL), iv_sectionCount(0),
+ iv_isMpipl(false)
#endif
{
};
+#ifdef __HOSTBOOT_RUNTIME
+ /**
+ * @brief Initialize temporary attribute resource provider
+ *
+ * @par Detailed Description"
+ * Ensures member variables are initialized to sane values.
+ */
+ AttrRP(TargetingHeader* i_header)
+ : iv_isTempInstance(true), iv_isMpipl(false)
+ {
+ // Fill in member variables
+ fillInAttrRP(i_header);
+ };
+#endif
+
/**
* @brief Destroy the attribute resource provider
*
* @par Detailed Description:
* Frees any memory allocated by the resource provider.
*
- * @note This should never actually be used because the daemon
- * thread and the vmm blocks are unable to be reclaimed.
- * Function will assert if called due to leaky behavior.
+ * @note This should never actually be used for the singleton
+ * instance because the daemon thread and the vmm blocks
+ * are unable to be reclaimed. Function will assert if
+ * called due to leaky behavior.
*/
~AttrRP();
@@ -388,6 +420,9 @@ class AttrRP
// Message Queue for VMM requests
msg_q_t iv_msgQ;
+#else
+ // Indicator that AttrRP instance is a temporary one, not the singleton
+ bool iv_isTempInstance;
#endif
// Parsed structures of the attribute sections.
AttrRP_Section* iv_sections;
diff --git a/src/include/usr/targeting/attrsync.H b/src/include/usr/targeting/attrsync.H
index b8c52fe7e..598292546 100644
--- a/src/include/usr/targeting/attrsync.H
+++ b/src/include/usr/targeting/attrsync.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -43,6 +43,7 @@
#include <stddef.h>
#include <targeting/common/targetservice.H>
#include <targeting/common/attrsyncdefs.H>
+#include <targeting/attrrp.H>
namespace TARGETING
@@ -79,6 +80,7 @@ namespace TARGETING
*/
~AttributeSync();
+#ifndef __HOSTBOOT_RUNTIME
/**
* @brief Setup the internal variables to point to the correct
* attribute section.
@@ -86,8 +88,8 @@ namespace TARGETING
* @par Detailed Description:
* This function will call into the AttRP:: to have the
* correct attribute section paged into accessible memory.
- * this function may be called multiple times with different
- * section names.
+ * this function may be called multiple times with
+ * different section names.
*
* @pre None:
*
@@ -107,6 +109,36 @@ namespace TARGETING
errlHndl_t syncSectionToFsp(
TARGETING::SECTION_TYPE i_section_to_sync );
+#else
+ /**
+ * @brief Setup the internal variables to point to the correct
+ * attribute section.
+ *
+ * @par Detailed Description:
+ * This function will call into the AttRP:: to have the
+ * correct attribute section paged into accessible memory.
+ * This function may be called multiple times with
+ * different section names.
+ *
+ * @pre None:
+ *
+ * @post The entire section from the HB attribute section
+ * passed in has been synchronized to new AttrRP.
+ *
+ * @param[in] i_section_to_sync
+ * TARGETING::SECTION_TYPE is passed in to
+ * identify the section to be synced to the
+ * new AttrRP.
+ *
+ * @return std::vector <TARGETING::sectionRefData> with
+ * attribute section pages.
+ *
+ */
+ std::vector <TARGETING::sectionRefData> syncSectionFromAttrRP(
+ TARGETING::SECTION_TYPE i_section_to_sync);
+#endif
+
+#ifndef __HOSTBOOT_RUNTIME
/**
* @brief Sends a request to the FSP to sync its data to Hostboot
* for a specific attribute section. Write the data
@@ -138,9 +170,11 @@ namespace TARGETING
errlHndl_t syncSectionFromFsp(
TARGETING::SECTION_TYPE i_section_to_sync,
msg_q_t i_pMsgQ );
+#endif
private:
+#ifndef __HOSTBOOT_RUNTIME
/**
* @enum TARGETING::MBOX_MSG_TYPE
*
@@ -153,6 +187,7 @@ namespace TARGETING
ASYNCHRONOUS,
SYNCHRONOUS
};
+#endif
/**
* @brief Setup the internal variables to point to the correct
@@ -165,6 +200,7 @@ namespace TARGETING
*/
void getSectionData();
+#ifndef __HOSTBOOT_RUNTIME
/**
* @brief Write the attribute data received from the FSP to
* the attribute section.
@@ -226,6 +262,7 @@ namespace TARGETING
* return errl != NULL -> failure
*/
errlHndl_t sendSyncToHBRequestMessage();
+#endif
private:
@@ -247,6 +284,7 @@ namespace TARGETING
};
+#ifndef __HOSTBOOT_RUNTIME
/**
* @brief Handles synchronization of all RW targeting attributes from
* hostboot to the fsp; the following sections are
@@ -278,6 +316,7 @@ namespace TARGETING
* return errl != NULL -> failure
*/
errlHndl_t syncAllAttributesFromFsp();
+#endif
diff --git a/src/include/usr/targeting/common/target.H b/src/include/usr/targeting/common/target.H
index 9e1c23b85..6d7a0dafd 100644
--- a/src/include/usr/targeting/common/target.H
+++ b/src/include/usr/targeting/common/target.H
@@ -58,6 +58,8 @@
namespace RT_TARG
{
void adjustTargeting4Runtime();
+ int saveRestoreAttrs(void *i_rsvdMemPtr,
+ void *io_lidStructPtr);
}
#endif
@@ -98,6 +100,7 @@ namespace TARGETING
// Type Aliases
//******************************************************************************
class AttributeTank;
+class AttrRP;
class Target;
typedef const Target* ConstTargetHandle_t;
typedef Target* TargetHandle_t;
@@ -480,6 +483,31 @@ class Target
void*& o_pAttr) const;
/**
+ * @brief Gets a pointer to the target's associated attribute
+ *
+ * Gets a pointer to the target's associated attribute
+ *
+ * @param[in] i_attr Attribute to retrieve
+ * @param[in] i_attrRP Pointer to attribute resource provider
+ * @param[in] i_pAttrId Pointer to array of attribute IDs for target
+ * @param[in] i_ppAttrAddr Pointer to array of attribute addresses
+ * @param[out] o_pAttr Pointer to data location to hold the attribute
+ * data
+ *
+ * @pre Target service must be initialized
+ *
+ * @post If attribute exists for the associated target, caller's
+ * pointer updated with associated attribute pointer. Otherwise,
+ * caller's pointer updated to NULL.
+ */
+ void _getAttrPtr(
+ ATTRIBUTE_ID i_attr,
+ AttrRP* i_attrRP,
+ ATTRIBUTE_ID* i_pAttrId,
+ AbstractPointer<void>* i_ppAttrAddr,
+ void*& o_pAttr) const;
+
+ /**
* @brief Returns pointer to a mutex attribute associated with the
* target
*
@@ -632,6 +660,8 @@ class Target
#ifdef __HOSTBOOT_RUNTIME
friend void RT_TARG::adjustTargeting4Runtime();
+ friend int RT_TARG::saveRestoreAttrs(void *,
+ void *);
#endif
diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H
index 5eae01fc7..f1126bf21 100644
--- a/src/include/usr/targeting/common/targetservice.H
+++ b/src/include/usr/targeting/common/targetservice.H
@@ -63,6 +63,9 @@
namespace TARGETING
{
+ // Forward declaration of attribute resource provider class.
+ class AttrRP;
+
class TargetService;
/*
@@ -710,6 +713,60 @@ class TargetService
*/
void getMasterNodeTarget(Target*& o_masterNodeTarget) const;
+ /**
+ * @brief Returns Target Range Filter information.
+ *
+ * @par Detailed Description:
+ * Returns the Target Range Filter information for the specified
+ * attribute data and resource provider.
+ *
+ * @param[in] i_attrData pointer to attribute data
+ *
+ * @param[in] i_attrRP pointer to attribute resource provider
+ *
+ * @param[out] o_maxTargets maximum targets in the range
+ *
+ * @param[in] i_nodeId, node ID for the target. Defaults to 0.
+ *
+ * @pre TargetService must be initialized.
+ *
+ * @post Returns the Target Range Filter information for the specified
+ * attribute data and resource provider.
+ *
+ * @return TargetRangeFilter
+ */
+ TargetRangeFilter getTargetRangeFilter(void *i_attrData,
+ AttrRP *i_attrRP,
+ uint32_t &o_maxTargets,
+ NODE_ID i_nodeId = 0);
+
+ /**
+ * @brief Returns Target Attribute information.
+ *
+ * @par Detailed Description:
+ * Returns the Target Attribute information for the specified
+ * target and resource provider.
+ *
+ * @param[in] i_target pointer to target
+ *
+ * @param[in] i_attrRP pointer to attribute resource provider
+ *
+ * @param[out] o_pAttrId pointer to array of attribute IDs
+ *
+ * @param[out] o_ppAttrAddr pointer to array of attribute addresses
+ *
+ * @pre TargetService must be initialized.
+ *
+ * @post Returns the Target Attribute information for the specified
+ * target and resource provider.
+ *
+ * @return Number of attributes in the arrays
+ */
+ uint32_t getTargetAttributes(Target*i_target,
+ AttrRP *i_attrRP,
+ ATTRIBUTE_ID* &o_pAttrId,
+ AbstractPointer<void>* &o_ppAttrAddr);
+
private:
@@ -768,11 +825,15 @@ class TargetService
* specific information of the type NodeSpecificInfo. May refer to
* structure definition
*
+ * @param[in] i_attrRP, attribute resource provider to use if address
+ * translation is required. Defaults to NULL, ie, AttrRP Singleton.
+ *
* @pre Target service must not be initialized
*
* @post Target service target pool configured for access
*/
- void _configureTargetPool(NodeSpecificInfo& i_nodeInfoContainer);
+ void _configureTargetPool(NodeSpecificInfo& i_nodeInfoContainer,
+ AttrRP *i_attrRP = NULL);
/**
* @brief Computes the maximum number of targets, caches the value
@@ -785,13 +846,17 @@ class TargetService
* specific information of the type NodeSpecificInfo. May refer to
* structure definition
*
+ * @param[in] i_attrRP, attribute resource provider to use if address
+ * translation is required. Defaults to NULL, ie, AttrRP Singleton.
+ *
* @pre Target service must not already be initialized
*
* @post Target service updated with maximum target count in
* nodeContainer.
*
*/
- void _maxTargets(NodeSpecificInfo & io_nodeInfoContainer);
+ void _maxTargets(NodeSpecificInfo & io_nodeInfoContainer,
+ AttrRP *i_attrRP = NULL);
//@NEBA
diff --git a/src/include/usr/targeting/common/targreasoncodes.H b/src/include/usr/targeting/common/targreasoncodes.H
index 92d9611c4..1c0fb4c8c 100644
--- a/src/include/usr/targeting/common/targreasoncodes.H
+++ b/src/include/usr/targeting/common/targreasoncodes.H
@@ -50,6 +50,7 @@ enum TargetingModuleId
TARG_APPLY_ATTR_OVER = 0x0A,
TARG_HANDLE_ENUM_CHECK_FAILURE = 0x0B,
TARG_HANDLE_RANGE_CHECK_FAILURE = 0x0C,
+ TARG_RT_SAVE_RESTORE_ATTRS = 0x0D,
};
enum TargetingReasonCode
diff --git a/src/include/usr/util/utillidmgr.H b/src/include/usr/util/utillidmgr.H
index a80f67876..9b2b349f3 100644
--- a/src/include/usr/util/utillidmgr.H
+++ b/src/include/usr/util/utillidmgr.H
@@ -59,6 +59,7 @@ enum LidId
CUMULUS_HCODE_LIDID = 0x81e00603,
HCODE_CONTAINER_LIDID = 0x80d0000c,
HWREFIMG_RINGOVD_LIDID = 0x81e00620,
+ TARGETING_BINARY_LIDID = 0x81e00630,
INVALID_LIDID = 0xFFFFFFFF
};
OpenPOWER on IntegriCloud