summaryrefslogtreecommitdiffstats
path: root/src/usr/sbe
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-01-06 13:55:20 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-01-23 23:29:43 -0500
commitc50f586098a5208764c5cbee9b88f23a51d16f07 (patch)
treedf2d2cc4e36295344b2c1ab6cfe4d0e19b09a56d /src/usr/sbe
parent44eaa7b67e29cbca5b79e60c491ebdfcb624d787 (diff)
downloadtalos-hostboot-c50f586098a5208764c5cbee9b88f23a51d16f07.tar.gz
talos-hostboot-c50f586098a5208764c5cbee9b88f23a51d16f07.zip
Enforce single-threaded rule for Hardware Procedures
Because we aren't using read thread-local storage for the FAPI variables (opmode, piberrmask, current_err) we need to ensure that we never have multiple HWPs running at the same time. The external interface that we use in all cases is FAPI_INVOKE_HWP so that is where a mutex is placed. This change also uncovered a couple bugs in how we were executing some non-fapi HWPs in the SBE update code so I fixed those as well. Change-Id: Ie8817da62dd4e6bc9ed3ac2debf126f6d05c2b23 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34518 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/sbe')
-rw-r--r--src/usr/sbe/sbe_update.C67
1 files changed, 47 insertions, 20 deletions
diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C
index fc6c3c777..c8f2849e5 100644
--- a/src/usr/sbe/sbe_update.C
+++ b/src/usr/sbe/sbe_update.C
@@ -923,36 +923,30 @@ namespace SBE
i_image, io_image_size);
do{
- // Invoke p9_xip_find to find HBBL image in SBE image
- fapi2::ReturnCode l_fapi_rc;
+ // Call p9_xip_find to find HBBL image in SBE image
const char* l_sectionId = ".hbbl";
- FAPI_EXEC_HWP( l_fapi_rc,
- p9_xip_find,
- i_image,
- l_sectionId,
- &l_xipItem );
+ // Note - this is not a fapi2 function
+ int xip_rc = p9_xip_find( i_image, l_sectionId, &l_xipItem );
// Check the return code
- if(l_fapi_rc.isRC(P9_XIP_ITEM_NOT_FOUND))
+ if( xip_rc == P9_XIP_ITEM_NOT_FOUND )
{
TRACUCOMP( g_trac_sbe, "appendHbblToSbe(): "
"p9_xip_find received expected return code, item "
"not found, rc=0x%X",
- l_fapi_rc );
+ xip_rc );
}
- else if(l_fapi_rc.isRC(0) ||
- l_fapi_rc.isRC(P9_XIP_DATA_NOT_PRESENT))
+ else if( xip_rc == P9_XIP_DATA_NOT_PRESENT )
{
TRACFCOMP( g_trac_sbe, "appendHbblToSbe(): "
"p9_xip_find located %s, rc=0x%X",
- (l_fapi_rc) ? "TOC only" : "TOC and section data",
- int(l_fapi_rc) );
+ xip_rc ? "TOC only" : "TOC and section data",
+ xip_rc );
- // Invoke p9_xip_delete_section to delete existing HBBL image
+ // Call p9_xip_delete_section to delete existing HBBL image
// from SBE image
void *l_imageBuf = malloc(io_image_size);
- FAPI_INVOKE_HWP( err,
- p9_xip_delete_section,
+ xip_rc = p9_xip_delete_section(
i_image,
l_imageBuf,
io_image_size,
@@ -960,11 +954,28 @@ namespace SBE
free(l_imageBuf);
// Check for error
- if(err)
+ if( xip_rc )
{
TRACFCOMP( g_trac_sbe, "appendHbblToSbe(): "
"p9_xip_delete_section failed, rc=0x%X",
- err->reasonCode() );
+ xip_rc );
+ /*@
+ * @errortype
+ * @moduleid SBE_APPEND_HBBL
+ * @reasoncode ERROR_FROM_XIP_DELETE
+ * @userdata1 rc from p9_xip_delete
+ * @userdata2 <unused>
+ * @devdesc Bad RC from p9_xip_delete
+ * @custdesc A problem occurred while updating processor
+ * boot code.
+ */
+ err = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ SBE_APPEND_HBBL,
+ ERROR_FROM_XIP_DELETE,
+ xip_rc,
+ 0,
+ true /* SW error */);
+ err->collectTrace(SBE_COMP_NAME);
// exit loop
break;
@@ -974,8 +985,24 @@ namespace SBE
{
TRACFCOMP( g_trac_sbe, "appendHbblToSbe(): p9_xip_find "
"received unexpected return code, rc=0x%X",
- int(l_fapi_rc) );
- err = fapi2::rcToErrl(l_fapi_rc);\
+ xip_rc );
+ /*@
+ * @errortype
+ * @moduleid SBE_APPEND_HBBL
+ * @reasoncode ERROR_FROM_XIP_FIND
+ * @userdata1 rc from p9_xip_find
+ * @userdata2 <unused>
+ * @devdesc Bad RC from p9_xip_find
+ * @custdesc A problem occurred while updating processor
+ * boot code.
+ */
+ err = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ SBE_APPEND_HBBL,
+ ERROR_FROM_XIP_FIND,
+ xip_rc,
+ 0,
+ true /* SW error */);
+ err->collectTrace(SBE_COMP_NAME);
err->collectTrace(FAPI_IMP_TRACE_NAME,256);
err->collectTrace(FAPI_TRACE_NAME,384);
OpenPOWER on IntegriCloud