Skip to content

Commit

Permalink
Support multiple nodes in HBRT - Remove Single Node Items
Browse files Browse the repository at this point in the history
There are some items that applied to a single node implementation that can
be removed after all dependencies on them have been removed by other tasks.
This single node support is being moved/removed.  Also a check is being
added to the VPD support so the node value does not index beyond the end
of the array of reserved memory addresses.

Change-Id: I7fea5ac9cdfa9f37caa57905d320633a8039e79d
RTC: 186585
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55917
Reviewed-by: Christian R. Geddes <crgeddes@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: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
mgloff authored and wghoffa committed Apr 10, 2018
1 parent 7a4cb95 commit 67de094
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
13 changes: 7 additions & 6 deletions src/include/usr/targeting/attrrp.H
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class AttrRP
iv_isMpipl(false)
#else
: iv_isTempInstance(false), iv_instanceStatus(SINGLE_NODE),
iv_sections(NULL), iv_sectionCount(0), iv_isMpipl(false)
iv_isMpipl(false)
#endif
{
};
Expand Down Expand Up @@ -546,6 +546,12 @@ class AttrRP

// Message Queue for VMM requests
msg_q_t iv_msgQ;

// Parsed structures of the attribute sections.
AttrRP_Section* iv_sections;

// Count of attribute sections.
size_t iv_sectionCount;
#else
// Indicator that AttrRP instance is a temporary one, not the singleton
bool iv_isTempInstance;
Expand All @@ -556,11 +562,6 @@ class AttrRP
// Node instance status
NodeInstanceStatus iv_instanceStatus;
#endif
// Parsed structures of the attribute sections.
AttrRP_Section* iv_sections; // @TODO RTC:186585 move to #ifndef clause

// Count of attribute sections.
size_t iv_sectionCount; // @TODO RTC:186585 move to #ifndef clause

bool iv_isMpipl;
};
Expand Down
3 changes: 2 additions & 1 deletion src/include/usr/vpd/vpdreasoncodes.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 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -146,6 +146,7 @@ enum vpdReasonCode
VPD_RC_XXX = VPD_COMP_ID | 0x38,
VPD_TARGET_CHIP_NOT_FOUND = VPD_COMP_ID | 0x39,
VPD_EEPROM_VPD_PRIMARY_INFO_MISSING = VPD_COMP_ID | 0x3a,
VPD_RT_NODE_TOO_LARGE = VPD_COMP_ID | 0x3b,

};

Expand Down
11 changes: 3 additions & 8 deletions src/usr/targeting/attrrp_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,20 @@ namespace TARGETING

AttrRP::~AttrRP()
{
if (iv_sections) // @TODO RTC:186585 move if... to #ifndef clause
#ifndef __HOSTBOOT_RUNTIME
if (iv_sections)
{
delete[] iv_sections;
iv_sections = nullptr;
} // @TODO RTC:186585 move if... to #ifndef clause
}

#ifndef __HOSTBOOT_RUNTIME
msg_q_destroy(iv_msgQ);
TARG_ASSERT(false, "Assert to exit ~AttrRP");
#else
for(uint32_t i = NODE0; i < INVALID_NODE_ID; ++i)
{
if (iv_nodeContainer[i].pSections)
{
if((i == NODE0) && (iv_sections == nullptr))
{
iv_nodeContainer[i].pSections = nullptr;
continue;
} // @TODO RTC:186585 move if...
delete[] iv_nodeContainer[i].pSections;
iv_nodeContainer[i].pSections = nullptr;
}
Expand Down
5 changes: 0 additions & 5 deletions src/usr/targeting/runtime/attrrp_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,6 @@ namespace TARGETING
io_nodeCont.sectionCount = i_header->numSections;
io_nodeCont.pSections =
new AttrRP_Section[io_nodeCont.sectionCount]();
if (i_nodeId == NODE0) // @TODO RTC:186585 remove
{ // @TODO RTC:186585 remove
iv_sectionCount = io_nodeCont.sectionCount; // @TODO RTC:186585
iv_sections = io_nodeCont.pSections; // @TODO RTC:186585 remove
} // @TODO RTC:186585 remove

// Find start to the first section:
// (header address + size of header + offset in header)
Expand Down
28 changes: 27 additions & 1 deletion src/usr/vpd/runtime/rt_vpd.C
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ extern trace_desc_t* g_trac_vpd;
// host interface get_reserved_mem function. We only want to call the
// function once as memory is allocated with every call.
static uint64_t g_reserved_mem_addr[] = {0, 0, 0, 0};
#define MAX_RSVD_MEM_ADDRS (sizeof(g_reserved_mem_addr) / sizeof(uint64_t))


namespace VPD
Expand Down Expand Up @@ -103,8 +104,33 @@ errlHndl_t getPnorAddr( pnorInformation & i_pnorInfo,
{
errlHndl_t err = NULL;

if( i_instance >= MAX_RSVD_MEM_ADDRS )
{
TRACFCOMP(g_trac_vpd,ERR_MRK"rt_vpd: Node %d is too large for size "
"of reserved memory address array %d",
i_instance,
MAX_RSVD_MEM_ADDRS);
/*@
* @errortype
* @moduleid VPD::VPD_RT_GET_ADDR
* @reasoncode VPD::VPD_RT_NODE_TOO_LARGE
* @userdata1 Node ID
* @userdata2 Rsvd Mem Address array size
* @devdesc Node for VPD is too large
*/
err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_INFORMATIONAL,
VPD::VPD_RT_GET_ADDR,
VPD::VPD_RT_NODE_TOO_LARGE,
i_instance,
MAX_RSVD_MEM_ADDRS);

err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE,
HWAS::SRCI_PRIORITY_HIGH);

err->collectTrace( "VPD", 256);
}
// Get the reserved_mem_addr only once
if( g_reserved_mem_addr[i_instance] == 0 )
else if( g_reserved_mem_addr[i_instance] == 0 )
{
uint64_t l_vpdSize;
g_reserved_mem_addr[i_instance] =
Expand Down

0 comments on commit 67de094

Please sign in to comment.