Skip to content

Commit

Permalink
Store SBE failed rc for async FFDC
Browse files Browse the repository at this point in the history
Store the SBE rc for failed command in globals

Change-Id: I673ee6929fc1941233d5235d18412a747e596508
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52511
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
Shakeebbk authored and sgupta2m committed Feb 3, 2018
1 parent 035b8cc commit 7be7840
Show file tree
Hide file tree
Showing 17 changed files with 190 additions and 140 deletions.
15 changes: 4 additions & 11 deletions src/sbefw/app/common/sbecmdgeneric.C
Expand Up @@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
Expand Down Expand Up @@ -130,10 +131,8 @@ uint32_t sbeGetFfdc (uint8_t *i_pArg)
/ sizeof(uint32_t);
// Set failed command information
// Sequence Id is 0 by default for Fifo interface
// @TODO via RTC : 149074
// primary and secondary status should be picked
// from the globals.
l_ffdc.setCmdInfo(0, respHdr.cmdClass, respHdr.command);
l_ffdc.setCmdInfo(0, SBE_GLOBAL->failedCmdClass,
SBE_GLOBAL->failedCmd);
// Add HWP specific ffdc data length
l_ffdc.lenInWords += ffdcDataLenInWords;
len = sizeof(sbeResponseFfdc_t)/sizeof(uint32_t);
Expand All @@ -152,13 +151,7 @@ uint32_t sbeGetFfdc (uint8_t *i_pArg)

}
//Send the FFDC data over FIFO.
// @TODO via RTC : 149074
// primary and secondary status should be picked
// from the globals.
// Check for Primary and Secondary Status from Globals and then send
// internal FFDC.
rc = sbeFfdcPack.sendOverFIFO(respHdr,
SBE_FFDC_ALL_DUMP,
rc = sbeFfdcPack.sendOverFIFO(SBE_FFDC_ALL_DUMP,
len,
true);
if (rc)
Expand Down
13 changes: 7 additions & 6 deletions src/sbefw/app/common/sbecmdscomaccess.C
Expand Up @@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
Expand Down Expand Up @@ -81,7 +82,7 @@ uint32_t sbeGetScom (uint8_t *i_pArg)
l_scomData, &l_hdr,
&l_ffdc);

if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"getscom failed, "
"scomAddr[0x%08X%08X]",
Expand Down Expand Up @@ -172,7 +173,7 @@ uint32_t sbePutScom (uint8_t *i_pArg)
checkIndirectAndDoScom(false, l_addr,
l_scomData, &l_hdr, &l_ffdc);

if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"putscom failure data, "
"scomAddr[0x%08X%08X], "
Expand Down Expand Up @@ -269,7 +270,7 @@ uint32_t sbeModifyScom (uint8_t *i_pArg)
checkIndirectAndDoScom(true, l_addr,
l_scomData, &l_hdr, &l_ffdc);

if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"getscom failed,"
" ScomAddress[0x%08X %08X]",
Expand All @@ -294,7 +295,7 @@ uint32_t sbeModifyScom (uint8_t *i_pArg)
checkIndirectAndDoScom(false, l_addr,
l_modifyingData, &l_hdr, &l_ffdc);

if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"putscom failed,"
" ScomAddress[0x%08X%08X]",
Expand Down Expand Up @@ -382,7 +383,7 @@ uint32_t sbePutScomUnderMask (uint8_t *i_pArg)
checkIndirectAndDoScom(true, l_addr,
l_scomData, &l_hdr, &l_ffdc);

if (l_hdr.secondaryStatus == SBE_SEC_OPERATION_SUCCESSFUL) // scom success
if (l_hdr.secondaryStatus() == SBE_SEC_OPERATION_SUCCESSFUL) // scom success
{
l_putScomUmaskMsg.getScomData(l_scomData);

Expand All @@ -391,7 +392,7 @@ uint32_t sbePutScomUnderMask (uint8_t *i_pArg)
l_scomData, &l_hdr, &l_ffdc);
}

if (l_hdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
if (l_hdr.secondaryStatus() != SBE_SEC_OPERATION_SUCCESSFUL) // scom failed
{
SBE_ERROR(SBE_FUNC"scom failed, "
"ScomAddress[0x%08X%08X]",
Expand Down
34 changes: 18 additions & 16 deletions src/sbefw/app/power/sbecmdmemaccess.C
Expand Up @@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
Expand Down Expand Up @@ -191,14 +192,15 @@ uint32_t processPbaRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
{
l_addr = i_hdr.getAddr();
// Check if the access to the address is allowed
l_respHdr.secondaryStatus = mainStoreSecMemRegionManager.isAccessAllowed(
uint16_t sbeRc = mainStoreSecMemRegionManager.isAccessAllowed(
{l_addr,
i_hdr.len,
(i_isFlagRead ? static_cast<uint8_t>(memRegionMode::READ):
static_cast<uint8_t>(memRegionMode::WRITE))});
if(l_respHdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL)
if(sbeRc != SBE_SEC_OPERATION_SUCCESSFUL)
{
l_respHdr.primaryStatus = SBE_PRI_UNSECURE_ACCESS_DENIED;
l_respHdr.setStatus(SBE_PRI_UNSECURE_ACCESS_DENIED,
sbeRc);
break;
}
}
Expand Down Expand Up @@ -274,7 +276,7 @@ uint32_t processPbaRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
while (l_granulesCompleted < l_lenCacheAligned)
{
// Breaking out here if invalid size
if(l_respHdr.primaryStatus != SBE_PRI_OPERATION_SUCCESSFUL)
if(l_respHdr.primaryStatus() != SBE_PRI_OPERATION_SUCCESSFUL)
{
break;
}
Expand Down Expand Up @@ -331,7 +333,7 @@ uint32_t processPbaRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
// need to Flush out upstream FIFO, until EOT arrives
if (!i_isFlagRead)
{
l_rc = flushUpstreamFifo(l_respHdr.primaryStatus);
l_rc = flushUpstreamFifo(l_respHdr.primaryStatus());
CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(l_rc);
}

Expand Down Expand Up @@ -466,14 +468,15 @@ uint32_t processAduRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
if(false == i_hdr.isTrustedOp())
{
// Check if the access to the address is allowed
l_respHdr.secondaryStatus = mainStoreSecMemRegionManager.isAccessAllowed(
uint16_t sbeRc = mainStoreSecMemRegionManager.isAccessAllowed(
{l_addr,
i_hdr.len,
(i_isFlagRead ? static_cast<uint8_t>(memRegionMode::READ):
static_cast<uint8_t>(memRegionMode::WRITE))});
if(l_respHdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL)
if(sbeRc != SBE_SEC_OPERATION_SUCCESSFUL)
{
l_respHdr.primaryStatus = SBE_PRI_UNSECURE_ACCESS_DENIED;
l_respHdr.setStatus(SBE_PRI_UNSECURE_ACCESS_DENIED,
sbeRc);
break;
}
}
Expand Down Expand Up @@ -635,7 +638,7 @@ uint32_t processAduRequest(const sbeMemAccessReqMsgHdr_t &i_hdr,
// need to Flush out upstream FIFO, until EOT arrives
if (!i_isFlagRead)
{
l_rc = flushUpstreamFifo(l_respHdr.primaryStatus);
l_rc = flushUpstreamFifo(l_respHdr.primaryStatus());
CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(l_rc);
}

Expand Down Expand Up @@ -759,10 +762,10 @@ uint32_t sbeUpdateMemAccessRegion (uint8_t *i_pArg)
SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags);

uint16_t mode = SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags & 0x00FF;
uint16_t sbeRc = SBE_SEC_OPERATION_SUCCESSFUL;
if(mode == SBE_MEM_REGION_CLOSE)
{
SBE_GLOBAL->sbeSbe2PsuRespHdr.secStatus =
mainStoreSecMemRegionManager.remove(req.startAddress);
sbeRc = mainStoreSecMemRegionManager.remove(req.startAddress);
}
else
{
Expand All @@ -776,15 +779,14 @@ uint32_t sbeUpdateMemAccessRegion (uint8_t *i_pArg)
memMode = static_cast<uint8_t>(memRegionMode::READ) |
static_cast<uint8_t>(memRegionMode::WRITE);
}
SBE_GLOBAL->sbeSbe2PsuRespHdr.secStatus =
mainStoreSecMemRegionManager.add(req.startAddress,
sbeRc = mainStoreSecMemRegionManager.add(req.startAddress,
req.size,
memMode);
}
if(SBE_GLOBAL->sbeSbe2PsuRespHdr.secStatus !=
SBE_SEC_OPERATION_SUCCESSFUL)
if(sbeRc != SBE_SEC_OPERATION_SUCCESSFUL)
{
SBE_GLOBAL->sbeSbe2PsuRespHdr.primStatus = SBE_PRI_USER_ERROR;
SBE_GLOBAL->sbeSbe2PsuRespHdr.setStatus(SBE_PRI_USER_ERROR,
sbeRc);
}
} while(false);

Expand Down
10 changes: 6 additions & 4 deletions src/sbefw/app/power/sbecmdsram.C
Expand Up @@ -6,6 +6,7 @@
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
Expand Down Expand Up @@ -138,14 +139,15 @@ uint32_t sbeOccSramAccess_Wrap(const bool i_isGetFlag)
// For read access no checking is required
if( (l_validAddrForFirstAccess) && !( i_isGetFlag ))
{
l_respHdr.secondaryStatus = occSramSecRegionManager.isAccessAllowed(
uint16_t sbeRc = occSramSecRegionManager.isAccessAllowed(
{static_cast<uint64_t>(l_req.addr)&(0x00000000FFFFFFFFull),
l_req.len,
(i_isGetFlag? static_cast<uint8_t>(memRegionMode::READ):
static_cast<uint8_t>(memRegionMode::WRITE))});
if(l_respHdr.secondaryStatus != SBE_SEC_OPERATION_SUCCESSFUL)
if(sbeRc != SBE_SEC_OPERATION_SUCCESSFUL)
{
l_respHdr.primaryStatus = SBE_PRI_UNSECURE_ACCESS_DENIED;
l_respHdr.setStatus(SBE_PRI_UNSECURE_ACCESS_DENIED,
sbeRc);
break;
}
}
Expand Down Expand Up @@ -251,7 +253,7 @@ uint32_t sbeOccSramAccess_Wrap(const bool i_isGetFlag)
{
// If there was a HWP failure for put sram occ request,
// need to Flush out upstream FIFO, until EOT arrives
if ( l_respHdr.primaryStatus != SBE_PRI_OPERATION_SUCCESSFUL)
if ( l_respHdr.primaryStatus() != SBE_PRI_OPERATION_SUCCESSFUL)
{
l_rc = sbeUpFifoDeq_mult(l_len2dequeue, NULL,
true, true);
Expand Down
28 changes: 9 additions & 19 deletions src/sbefw/core/sbeFFDC.C
Expand Up @@ -28,12 +28,18 @@
#include "sbeFifoMsgUtils.H"
#include "sberegaccess.H"
#include "sbeFFDC.H"
#include "sbe_build_info.H"
#include "sbeglobals.H"
#include "sbecmdcntrldmt.H"

void SbeFFDCPackage::updateUserDataHeader(uint32_t i_fieldsConfig)
{
// Set failed command information
iv_sbeFFDCDataHeader.primaryStatus = SBE_GLOBAL->failedPrimStatus;
iv_sbeFFDCDataHeader.secondaryStatus = SBE_GLOBAL->failedSecStatus;
iv_sbeFFDCHeader.setCmdInfo(SBE_GLOBAL->failedSeqId,
SBE_GLOBAL->failedCmdClass,
SBE_GLOBAL->failedCmd);

//Update the user data header with dump fields configuration
iv_sbeFFDCDataHeader.dumpFields.set(i_fieldsConfig);
iv_sbeFFDCHeader.lenInWords = (sizeof(sbeResponseFfdc_t) +
Expand Down Expand Up @@ -75,8 +81,7 @@ uint32_t SbeFFDCPackage::collectAsyncHwpFfdc (void)
#undef SBE_FUNC
}

uint32_t SbeFFDCPackage::sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
const uint32_t i_fieldsConfig,
uint32_t SbeFFDCPackage::sendOverFIFO(const uint32_t i_fieldsConfig,
uint32_t &o_bytesSent,
const bool i_skipffdcBitCheck)
{
Expand All @@ -101,14 +106,6 @@ uint32_t SbeFFDCPackage::sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
break;
}

// update the primary and secondary status
iv_sbeFFDCDataHeader.primaryStatus = i_hdr.primaryStatus;
iv_sbeFFDCDataHeader.secondaryStatus = i_hdr.secondaryStatus;
iv_sbeFFDCDataHeader.fwCommitID = SBE_COMMIT_ID;
iv_sbeFFDCDataHeader.ddLevel = SBE_FFDC_DD2;
// Set failed command information
// Sequence Id is 0 by default for Fifo interface
iv_sbeFFDCHeader.setCmdInfo(0, i_hdr.cmdClass, i_hdr.command);
//Update the user data header with dump fields configuration
updateUserDataHeader(i_fieldsConfig);

Expand Down Expand Up @@ -167,8 +164,7 @@ uint32_t SbeFFDCPackage::sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
#undef SBE_FUNC
}

uint32_t SbeFFDCPackage::sendOverHostIntf(const sbeSbe2PsuRespHdr_t &i_hdr,
const uint32_t i_fieldsConfig,
uint32_t SbeFFDCPackage::sendOverHostIntf(const uint32_t i_fieldsConfig,
sbeMemAccessInterface *i_pMemInterface,
uint32_t i_allocatedSize,
const bool i_skipffdcBitCheck)
Expand All @@ -193,12 +189,6 @@ uint32_t SbeFFDCPackage::sendOverHostIntf(const sbeSbe2PsuRespHdr_t &i_hdr,
break;
}

// update the primary and secondary status
iv_sbeFFDCDataHeader.primaryStatus = i_hdr.primStatus;
iv_sbeFFDCDataHeader.secondaryStatus = i_hdr.secStatus;
iv_sbeFFDCDataHeader.fwCommitID = SBE_COMMIT_ID;
// Set failed command information
iv_sbeFFDCHeader.setCmdInfo(i_hdr.seqID, i_hdr.cmdClass, i_hdr.command);
//Update the user data header with dump fields configuration
updateUserDataHeader(i_fieldsConfig);

Expand Down
14 changes: 7 additions & 7 deletions src/sbefw/core/sbeFFDC.H
Expand Up @@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
Expand All @@ -30,6 +31,7 @@
#include "sbeFFDCType.H"
#include "sbeSpMsg.H"
#include "sbeHostUtils.H"
#include "sbe_build_info.H"
#include "sbeMemAccessInterface.H"

//PIBMEM attribute dump
Expand Down Expand Up @@ -90,6 +92,8 @@ public:

iv_sbeFFDCDataHeader.primaryStatus = SBE_PRI_OPERATION_SUCCESSFUL;
iv_sbeFFDCDataHeader.secondaryStatus = SBE_SEC_OPERATION_SUCCESSFUL;
iv_sbeFFDCDataHeader.fwCommitID = SBE_COMMIT_ID;
iv_sbeFFDCDataHeader.ddLevel = SBE_FFDC_DD2;

//length and dumpFields will be filled up depending on the fields
//to be sent in send APIs
Expand All @@ -108,7 +112,6 @@ public:
* @brief sendOverFIFO - method to pack and send SBE internal FFDC
* only if isSendInternalFFDCSet() is true
* over FIFO interface
* @param[in] i_hdr - Fifo response header
* @param[in] i_fieldsConfig - bitmap indicating the field
* to be sent in FFDC
* @param[out] o_bytesSent - number of bytes sent
Expand All @@ -118,16 +121,14 @@ public:
*
* @return - SBE secondary RC
*/
uint32_t sendOverFIFO(const sbeRespGenHdr_t &i_hdr,
const uint32_t i_fieldsConfig,
uint32_t sendOverFIFO(const uint32_t i_fieldsConfig,
uint32_t &o_bytesSent,
const bool i_skipffdcBitCheck = false);

/* @brief sendOverHostIntf - method to pack and send SBE internal FFDC
* only if isSendInternalFFDCSet() is true
* over HOST interface
*
* @param[in] i_hdr - Host response header
* @param[in] i_fieldsConfig - bitmap indicating the field
* to be sent in FFDC
* @param[in] i_pMemInterface - pointer to memory interface object
Expand All @@ -138,8 +139,7 @@ public:
*
* @return - SBE secondary RC
*/
uint32_t sendOverHostIntf(const sbeSbe2PsuRespHdr_t &i_hdr,
const uint32_t i_fieldsConfig,
uint32_t sendOverHostIntf(const uint32_t i_fieldsConfig,
sbeMemAccessInterface *i_pMemInterface,
uint32_t i_allocatedSize,
const bool i_skipffdcBitCheck = false);
Expand Down

0 comments on commit 7be7840

Please sign in to comment.