Skip to content

Commit

Permalink
Concurrent code update of HBRT - Enable Interface for Host
Browse files Browse the repository at this point in the history
Includes changes to enable the host interface for HBRT concurrent update.
Also includes some changes for fixing prior review comments, for fixing
bugs found in end-to-end testing, and for removing temporary code used
when the LID was unavailable.

Change-Id: I221bbd299567c8b0dad058cae4620b94f7bff7c8
RTC: 181285
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51498
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian E. Bakke <bbakke@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@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>
  • Loading branch information
mgloff authored and dcrowell77 committed Jan 16, 2018
1 parent 5343e08 commit 6c769ae
Show file tree
Hide file tree
Showing 10 changed files with 635 additions and 207 deletions.
10 changes: 7 additions & 3 deletions src/include/usr/runtime/rt_targeting.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -67,10 +67,12 @@ namespace RT_TARG
* 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
* @param[out] Error log userdata2 value associated with non-zero rtn code
* @return 0 on success, else return code
*/
int saveRestoreAttrs(void *i_rsvdMemPtr,
void *io_lidStructPtr);
void *io_lidStructPtr,
uint64_t& o_userdata2);

/**
* @brief Validate LID Structure against Reserved Memory. Check that the
Expand All @@ -79,10 +81,12 @@ namespace RT_TARG
* match.
* @param[in] Pointer to new LID Structure targeting binary data
* @param[in] Pointer to current Reserved Memory targeting binary data
* @param[out] Error log userdata2 value associated with non-zero rtn code
* @return 0 on success, else return code
*/
int validateData(void *i_lidStructPtr,
void *i_rsvdMemPtr);
void *i_rsvdMemPtr,
uint64_t& o_userdata2);

/**
* @brief Apply ATTR_TMP overrides to be available for run time
Expand Down
9 changes: 5 additions & 4 deletions src/include/usr/targeting/attrrp.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -74,7 +74,8 @@ class AttrRP

#ifdef __HOSTBOOT_RUNTIME
friend int RT_TARG::saveRestoreAttrs(void *,
void *);
void *,
uint64_t&);
#endif

public:
Expand Down Expand Up @@ -237,7 +238,7 @@ class AttrRP
/**
* @brief Initialize the attribute resource provider
*
* @par Detailed Description"
* @par Detailed Description:
* Ensures member variables are initialized to sane values.
*/
AttrRP()
Expand All @@ -255,7 +256,7 @@ class AttrRP
/**
* @brief Initialize temporary attribute resource provider
*
* @par Detailed Description"
* @par Detailed Description:
* Ensures member variables are initialized to sane values.
*/
AttrRP(TargetingHeader* i_header)
Expand Down
8 changes: 5 additions & 3 deletions src/include/usr/targeting/common/target.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -59,7 +59,8 @@ namespace RT_TARG
{
void adjustTargeting4Runtime();
int saveRestoreAttrs(void *i_rsvdMemPtr,
void *io_lidStructPtr);
void *io_lidStructPtr,
uint64_t& o_userdata2);
}
#endif

Expand Down Expand Up @@ -661,7 +662,8 @@ class Target
#ifdef __HOSTBOOT_RUNTIME
friend void RT_TARG::adjustTargeting4Runtime();
friend int RT_TARG::saveRestoreAttrs(void *,
void *);
void *,
uint64_t&);
#endif


Expand Down
4 changes: 2 additions & 2 deletions src/include/usr/targeting/common/targetservice.H
Expand Up @@ -724,7 +724,7 @@ class TargetService
*
* @param[out] o_maxTargets maximum targets in the range
*
* @param[in] i_nodeId, node ID for the target. Defaults to 0.
* @param[in] i_nodeId, node ID for the target.
*
* @pre TargetService must be initialized.
*
Expand All @@ -736,7 +736,7 @@ class TargetService
TargetRangeFilter getTargetRangeFilter(void *i_attrData,
AttrRP *i_attrRP,
uint32_t &o_maxTargets,
NODE_ID i_nodeId = 0);
NODE_ID i_nodeId);

/**
* @brief Returns Target Attribute information.
Expand Down
5 changes: 3 additions & 2 deletions src/include/usr/targeting/common/targreasoncodes.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -50,7 +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,
TARG_RT_HBRT_UPDATE_PREP = 0x0D,
};

enum TargetingReasonCode
Expand Down Expand Up @@ -78,6 +78,7 @@ enum TargetingReasonCode
TARG_RC_MM_BLOCK_UNMAP_FAIL = TARG_COMP_ID | 0x15,
TARG_RC_ATTRIBUTE_ENUM_CHECK_FAIL = TARG_COMP_ID | 0x16,
TARG_RC_ATTRIBUTE_RANGE_CHECK_FAIL = TARG_COMP_ID | 0x17,
TARG_RC_CONCURRENT_CODE_UPDATE_FAIL = TARG_COMP_ID | 0x18,
};

}; // End TARGETING namespace
Expand Down
6 changes: 3 additions & 3 deletions src/usr/targeting/common/targetservice.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -1433,8 +1433,8 @@ TargetRangeFilter TargetService::getTargetRangeFilter(void *i_attrData,
reinterpret_cast<uint32_t*>(reinterpret_cast<char*>(l_header) +
l_header->headerSize);

(void)TargetService::_configureTargetPool(l_nodeSpecificInfo,
i_attrRP);
TargetService::_configureTargetPool(l_nodeSpecificInfo,
i_attrRP);

l_nodeSpecificInfo.initialized = true;

Expand Down
43 changes: 1 addition & 42 deletions src/usr/targeting/runtime/attrrp_rt.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -82,47 +82,6 @@ namespace TARGETING
iv_sections[i].pnorAddress,
iv_sections[i].size);
}

for (size_t i = 0; i < iv_sectionCount; ++i)
{
// get section data from current AttrRP
std::vector <TARGETING::sectionRefData>l_pages;
l_pages =
l_attributeSync.syncSectionFromAttrRP(iv_sections[i].type);

// write section data to new AttrRP
uint8_t * l_dataPtr = nullptr; // ptr to Attribute address space
bool l_rc = true; // true if write is successful

// for each page
for(std::vector<TARGETING::sectionRefData>::const_iterator
pageIter = l_pages.begin();
(pageIter != l_pages.end()) && (true == l_rc);
++pageIter)
{
// check that page number is within range
uint64_t l_pageOffset = (*pageIter).pageNumber * PAGESIZE;
if ( iv_sections[i].size < (l_pageOffset + PAGESIZE) )
{
TARG_ERR("page offset 0x%lx is greater than "
"size 0x%lx of section %u",
l_pageOffset,
iv_sections[i].size,
iv_sections[i].type);

l_rc = false;
break;
}

// adjust the pointer out by page size * page number
l_dataPtr =
reinterpret_cast<uint8_t *>(iv_sections[i].pnorAddress)
+ l_pageOffset;

memcpy( l_dataPtr, (*pageIter).dataPtr, PAGESIZE );

}
}
} while(false);

TRACFCOMP(g_trac_targeting, EXIT_MRK"AttrRP::fillInAttrRP");
Expand Down

0 comments on commit 6c769ae

Please sign in to comment.