Skip to content

Commit

Permalink
Add error callouts and other improvements for Node Communications
Browse files Browse the repository at this point in the history
This code adds bus, hw, code, etc callouts to the appropriate errors.
It also cleans up other TODOs, refactors some functions, and applies
somes fixes found in testing.

Change-Id: I462cdb2c4e313c277a3e0542f740e82ede3313f3
RTC:184518
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61813
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-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>
  • Loading branch information
mabaiocchi authored and wghoffa committed Jul 3, 2018
1 parent e5dfc3a commit 1759af7
Show file tree
Hide file tree
Showing 11 changed files with 701 additions and 337 deletions.
16 changes: 16 additions & 0 deletions src/include/usr/errl/errlentry.H
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,22 @@ public:
const HWAS::busTypeEnum i_busType,
const HWAS::callOutPriority i_priority);

/**
* @brief Add a bus callout with entity paths
*
* @param[in] i_target1 The PHYS_PATH of HW bus endpoint target1
* @param[in] i_target2 The PHYS_PATH of HW bus endpoint target2
* @param[in] i_busType The hardware bus type
* @param[in] i_priority Priority of the callout
*
* @return void
*/
void addBusCallout(const TARGETING::EntityPath & i_target1,
const TARGETING::EntityPath & i_target2,
HWAS::busTypeEnum i_busType,
HWAS::callOutPriority i_priority);


/**
* @brief Add a hardware callout
*
Expand Down
1 change: 1 addition & 0 deletions src/include/usr/hwas/common/hwasCallout.H
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ enum partTypeEnum
MEM_REF_CLOCK = 9,
PROC_REF_CLOCK = 10,
PCI_REF_CLOCK = 11,
// @TODO 195920 Remove SMP_CABLE once HWSV code no longer references it
SMP_CABLE = 12, //Target is SMPGROUP
};

Expand Down
4 changes: 2 additions & 2 deletions src/include/usr/secureboot/secure_reasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace SECUREBOOT
MOD_NCEX_MASTER = 0x27,
MOD_NCEX_SLAVE = 0x28,
MOD_NCEX_GET_RANDOM = 0x29,
MOD_NCEX_RECV = 0x2A,
MOD_NC_RECV = 0x2A,
};

enum SECUREReasonCode
Expand Down Expand Up @@ -102,7 +102,7 @@ namespace SECUREBOOT
RC_NCEX_NO_FUNCTIONAL_TPMS = SECURE_COMP_ID | 0x28,
RC_NCEX_INVALID_PHYS_PATH = SECURE_COMP_ID | 0x29,
RC_NCEX_INVALID_INSTANCE_COUNT = SECURE_COMP_ID | 0x2A,
RC_NCEX_WAITING_TIMEOUT = SECURE_COMP_ID | 0x2B,
RC_NC_WAITING_TIMEOUT = SECURE_COMP_ID | 0x2B,

// Reason codes 0xA0 - 0xEF reserved for trustedboot_reasoncodes.H
};
Expand Down
73 changes: 71 additions & 2 deletions src/usr/errl/errlentry.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include <hwas/common/deconfigGard.H>
#include <targeting/common/targetservice.H>
#include <targeting/common/utilFilter.H>
#include <targeting/common/commontargeting.H>
#include <config.h>
#include <initservice/initserviceif.H>
#include <attributeenums.H>
Expand Down Expand Up @@ -377,8 +378,9 @@ void ErrlEntry::addPartCallout(const TARGETING::Target *i_target,
const HWAS::DeconfigEnum i_deconfigState,
const HWAS::GARD_ErrorType i_gardErrorType)
{
TRACFCOMP(g_trac_errl, ENTER_MRK"addPartCallout(%p, %d, 0x%x)",
i_target, i_partType, i_priority);
TRACFCOMP(g_trac_errl, ENTER_MRK"addPartCallout(%p, %d, 0x%x, %d, 0x%x)",
i_target, i_partType, i_priority,
i_deconfigState, i_gardErrorType);

const void* pData = nullptr;
uint32_t size = 0;
Expand Down Expand Up @@ -437,6 +439,73 @@ void ErrlEntry::addBusCallout(const TARGETING::Target *i_target_endp1,
}
} // addBusCallout

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
void ErrlEntry::addBusCallout(const TARGETING::EntityPath & i_target_endp1,
const TARGETING::EntityPath & i_target_endp2,
const HWAS::busTypeEnum i_busType,
const HWAS::callOutPriority i_priority)
{
char * l_target_endp1_path_str = nullptr;
char * l_target_endp2_path_str = nullptr;

do
{

// Need targeting module loaded before calculating the size of the
// EntityPaths. If not loaded, don't make error callout, which
// shouldn't be an issue as without targeting only 1 target is
// available in the system: TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL
if(Util::isTargetingLoaded() && TARGETING::targetService().isInitialized())
{

l_target_endp1_path_str = i_target_endp1.toString();
l_target_endp2_path_str = i_target_endp2.toString();

TRACFCOMP(g_trac_errl, ENTER_MRK"addBusCallout(%s, %s, %d, 0x%x)",
l_target_endp1_path_str, l_target_endp2_path_str,
i_busType, i_priority);

auto size1 = sizeof(i_target_endp1) -
(TARGETING::EntityPath::MAX_PATH_ELEMENTS - i_target_endp1.size()) *
sizeof(TARGETING::EntityPath::PathElement);

auto size2 = sizeof(i_target_endp2) -
(TARGETING::EntityPath::MAX_PATH_ELEMENTS - i_target_endp2.size()) *
sizeof(TARGETING::EntityPath::PathElement);

ErrlUserDetailsCallout(&i_target_endp1,
size1,
&i_target_endp2,
size2,
i_busType,
i_priority).addToLog(this);

}
else
{
TRACFCOMP(g_trac_errl, ERR_MRK"addBusCallout(ep1, ep2, %d, 0x%x): "
"Can't process because targeting isn't loaded",
i_busType, i_priority);
}

} while (0);

if (l_target_endp1_path_str != nullptr)
{
free(l_target_endp1_path_str);
l_target_endp1_path_str = nullptr;
}

if (l_target_endp2_path_str != nullptr)
{
free(l_target_endp2_path_str);
l_target_endp2_path_str = nullptr;
}

return;

} // addBusCallout (with EntityPath inputs)

////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 0 additions & 1 deletion src/usr/errl/plugins/errludcallout.H
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ case HWAS::_type: i_parser.PrintString( "Part Type", #_type); break;
case_PART_TYPE(MEM_REF_CLOCK)
case_PART_TYPE(PROC_REF_CLOCK)
case_PART_TYPE(PCI_REF_CLOCK)
case_PART_TYPE(SMP_CABLE)

default:
i_parser.PrintNumber( "Part Type", "UNKNOWN: 0x%X",
Expand Down
2 changes: 1 addition & 1 deletion src/usr/isteps/istep18/establish_system_smp.C
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void *host_sys_fab_iovalid_processing(void* io_ptr )
err->plid());
delete err;
err = nullptr;
}
}

// Lock the secure ABUS Link Mailboxes now
SECUREBOOT::lockAbusSecMailboxes();
Expand Down

0 comments on commit 1759af7

Please sign in to comment.