Skip to content

Commit ddfce1b

Browse files
sannerddcrowell77
authored andcommitted
Handle extremely large ATTR in ATTR dump tool
- 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>
1 parent e2cd6a0 commit ddfce1b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/usr/fapi2/plat_attr_override_sync.C

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ void AttrOverrideSync::setAttrActions(const AttributeId i_attrId,
675675
//******************************************************************************
676676
void AttrOverrideSync::triggerAttrSync()
677677
{
678+
uint8_t * l_buf = NULL;
679+
678680
//Walk through all HB targets and see if there is a matching FAPI target
679681
//If so then get the list of ATTR for FAPI target and add to sync list
680682
for (TARGETING::TargetIterator target = TARGETING::targetService().begin();
@@ -735,7 +737,7 @@ void AttrOverrideSync::triggerAttrSync()
735737
l_attrs[i].iv_dims[3];
736738

737739
//Get the data
738-
uint8_t l_buf[l_bytes];
740+
l_buf = reinterpret_cast<uint8_t *>(realloc(l_buf, l_bytes));
739741
ReturnCode l_rc =
740742
rawAccessAttr(
741743
static_cast<fapi2::AttributeId>(l_attrs[i].iv_attrId),
@@ -751,6 +753,8 @@ void AttrOverrideSync::triggerAttrSync()
751753
}
752754
}
753755

756+
free(l_buf);
757+
754758
//Now push the data to the debug tool
755759
sendFapiAttrSyncs();
756760
}

0 commit comments

Comments
 (0)