Skip to content

Commit

Permalink
Bug fixes for concurrent update of HBRT
Browse files Browse the repository at this point in the history
Fixed a bug where the wrong copy of the attribute was being used
after our code update preparation was run.
Fixed a bug due to not having enough memory allocated to update
the attribute values during the transition.
Added space to initial reserved memory to allow for new
attributes to be added at runtime.

Change-Id: I97c4d20ff1c369398be470fef718bbd001f71c1b
CQ: SW417526
ForwardPort: yes
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54685
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>
  • Loading branch information
dcrowell77 committed Feb 25, 2018
1 parent 24bc6a1 commit 431a3cc
Show file tree
Hide file tree
Showing 8 changed files with 257 additions and 114 deletions.
18 changes: 10 additions & 8 deletions src/include/usr/runtime/rt_targeting.H
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ namespace RT_TARG
* @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
* @return nullptr on success, else error log
*/
int saveRestoreAttrs(void *i_rsvdMemPtr,
void *io_lidStructPtr,
uint64_t& o_userdata2);
errlHndl_t saveRestoreAttrs(void *i_rsvdMemPtr,
void *io_lidStructPtr,
uint64_t& o_userdata2);

/**
* @brief Validate LID Structure against Reserved Memory. Check that the
Expand All @@ -81,12 +81,14 @@ 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] Total size of all sections in the new lid
* @param[out] Error log userdata2 value associated with non-zero rtn code
* @return 0 on success, else return code
* @return nullptr on success, else error log
*/
int validateData(void *i_lidStructPtr,
void *i_rsvdMemPtr,
uint64_t& o_userdata2);
errlHndl_t validateData(void *i_lidStructPtr,
void *i_rsvdMemPtr,
size_t& o_lidTotalSize,
uint64_t& o_userdata2);

/**
* @brief Apply ATTR_TMP overrides to be available for run time
Expand Down
6 changes: 3 additions & 3 deletions src/include/usr/targeting/attrrp.H
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class AttrRP
const TARGETING::NODE_ID i_nodeId);

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

public:
Expand Down
16 changes: 10 additions & 6 deletions src/include/usr/targeting/common/target.H
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@
// Forward declarations to allow friend functions to work
//******************************************************************************
#ifdef __HOSTBOOT_RUNTIME
namespace ERRORLOG
{
class ErrlEntry;
}
namespace RT_TARG
{
void adjustTargeting4Runtime();
int saveRestoreAttrs(void *i_rsvdMemPtr,
void *io_lidStructPtr,
uint64_t& o_userdata2);
ERRORLOG::ErrlEntry* saveRestoreAttrs(void *i_rsvdMemPtr,
void *io_lidStructPtr,
uint64_t& o_userdata2);
}
#endif

Expand Down Expand Up @@ -698,9 +702,9 @@ class Target

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


Expand Down
2 changes: 0 additions & 2 deletions src/include/usr/targeting/common/targreasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ enum TargetingModuleId
TARG_APPLY_ATTR_OVER = 0x0A,
TARG_HANDLE_ENUM_CHECK_FAILURE = 0x0B,
TARG_HANDLE_RANGE_CHECK_FAILURE = 0x0C,
TARG_RT_HBRT_UPDATE_PREP = 0x0D,
};

enum TargetingReasonCode
Expand Down Expand Up @@ -78,7 +77,6 @@ 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
17 changes: 13 additions & 4 deletions src/include/usr/targeting/targplatreasoncodes.H
Original file line number Diff line number Diff line change
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 @@ -58,6 +58,9 @@ enum PlatTargetingModuleId
TARG_MOD_ATTRRP_RT = 0x82,
TARG_MOD_SAVE_OVERRIDE_TANK = 0x83,
TARG_MOD_SAVE_ATTR_TANK = 0x84,
TARG_RT_HBRT_UPDATE_PREP = 0x85,
TARG_RT_VALIDATEDATA = 0x86,
TARG_RT_SAVERESTOREATTRS = 0x87,
};

/**
Expand All @@ -68,9 +71,15 @@ enum PlatTargetingModuleId
*/
enum PlatTargetingReasonCode
{
TARG_RC_INVALID_NODE = TARG_COMP_ID | 0x80,
TARG_RC_TARGET_NOT_FOUND = TARG_COMP_ID | 0x81,
TARG_SPACE_OVERRUN = TARG_COMP_ID | 0x82,
TARG_RC_INVALID_NODE = TARG_COMP_ID | 0x80,
TARG_RC_TARGET_NOT_FOUND = TARG_COMP_ID | 0x81,
TARG_SPACE_OVERRUN = TARG_COMP_ID | 0x82,
TARG_RT_BAD_EYECATCHER_LID = TARG_COMP_ID | 0x83,
TARG_RT_BAD_EYECATCHER_MEM = TARG_COMP_ID | 0x84,
TARG_RT_SECTION_NUM_MISMATCH = TARG_COMP_ID | 0x85,
TARG_RT_SECTION_MISMATCH = TARG_COMP_ID | 0x86,
TARG_RT_MISSING_ATTR = TARG_COMP_ID | 0x87,
TARG_RT_BAD_ATTR_SIZES = TARG_COMP_ID | 0x88,
};

} // End TARGETING namespace
Expand Down
7 changes: 5 additions & 2 deletions src/usr/runtime/populate_hbruntime.C
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,11 @@ errlHndl_t fill_RsvMem_hbData(uint64_t & io_start_address,
// Now calculate ATTR size
l_hbTOC.entry[l_hbTOC.total_entries].label = Util::HBRT_MEM_LABEL_ATTR;
l_hbTOC.entry[l_hbTOC.total_entries].offset = 0;
l_hbTOC.entry[l_hbTOC.total_entries].size =
TARGETING::AttrRP::maxSize();
uint64_t l_attrSize = TARGETING::AttrRP::maxSize();
// add 10% more extra space to account for a concurrent update
// that adds more attributes
l_attrSize = ((l_attrSize*110)/100);
l_hbTOC.entry[l_hbTOC.total_entries].size = l_attrSize;
l_totalSectionSize +=
ALIGN_PAGE(l_hbTOC.entry[l_hbTOC.total_entries].size);
l_hbTOC.total_entries++;
Expand Down

0 comments on commit 431a3cc

Please sign in to comment.