Skip to content

Commit

Permalink
Handle extremely large ATTR in ATTR dump tool
Browse files Browse the repository at this point in the history
  - ATTR_WOF_TABLE_DATA is 128K, dump tool used
    the stack for local buffer space and this
    ATTR exceeded stack space.  Changed to use realloc

Change-Id: Icbdc7c397507ce4244cce1c04171a49e0f6bcb68
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40989
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>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
sannerd authored and dcrowell77 committed May 31, 2017
1 parent e2cd6a0 commit ddfce1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/usr/fapi2/plat_attr_override_sync.C
Expand Up @@ -675,6 +675,8 @@ void AttrOverrideSync::setAttrActions(const AttributeId i_attrId,
//******************************************************************************
void AttrOverrideSync::triggerAttrSync()
{
uint8_t * l_buf = NULL;

//Walk through all HB targets and see if there is a matching FAPI target
//If so then get the list of ATTR for FAPI target and add to sync list
for (TARGETING::TargetIterator target = TARGETING::targetService().begin();
Expand Down Expand Up @@ -735,7 +737,7 @@ void AttrOverrideSync::triggerAttrSync()
l_attrs[i].iv_dims[3];

//Get the data
uint8_t l_buf[l_bytes];
l_buf = reinterpret_cast<uint8_t *>(realloc(l_buf, l_bytes));
ReturnCode l_rc =
rawAccessAttr(
static_cast<fapi2::AttributeId>(l_attrs[i].iv_attrId),
Expand All @@ -751,6 +753,8 @@ void AttrOverrideSync::triggerAttrSync()
}
}

free(l_buf);

//Now push the data to the debug tool
sendFapiAttrSyncs();
}
Expand Down

0 comments on commit ddfce1b

Please sign in to comment.