Skip to content

Commit

Permalink
Add procedure for istep 18's Node Communication ABUS Exchange
Browse files Browse the repository at this point in the history
This commit creates a new interface that will be called in istep 18
to facilitate the exchanging of Link Mailboxes messages between nodes
acros the ABUS interface.  It also does the basic procedure without
all of the final FFDC and RAS implementation that will come in
subsequent commits.  All error logs are deleted to not kill any
IPLs until full functionality is tested.

Change-Id: I7391deaa37e49629cd01cfad212b64fecb9529bd
RTC:184518
CMVC-Prereq:1058895
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60793
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com>
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: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
mabaiocchi authored and dcrowell77 committed Jun 19, 2018
1 parent 7e0d574 commit 7617e77
Show file tree
Hide file tree
Showing 8 changed files with 796 additions and 9 deletions.
11 changes: 11 additions & 0 deletions src/include/usr/secureboot/nodecommif.H
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ enum node_comm_link_mbox_info_t
*/
errlHndl_t nodeCommXbus2ProcTest(void);

/**
* @brief Runs the procedure for the drawers/nodes to exchange messages
* over the ABUS Link Mailbox facility
*
* @return errHndl_t Error log handle indicating success or failure
* @retval nullptr Procedure completed successfully
* @retval !nullptr Error log providing failure details
*/
errlHndl_t nodeCommAbusExchange(void);


} // End NODECOMM namespace

} // End SECUREBOOT namespace
Expand Down
2 changes: 1 addition & 1 deletion src/usr/isteps/istep09/call_proc_smp_link_layer.C
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void* call_proc_smp_link_layer( void *io_pArgs )
errlHndl_t l_errl = NULL;
IStepError l_StepError;

// @TODO RTC:191008
// @TODO RTC:184518
// Currently the x-bus mailbox exchange causes a
// security violation in step 9, so disabling
bool l_run_xbus_test = false;
Expand Down
25 changes: 23 additions & 2 deletions src/usr/isteps/istep18/establish_system_smp.C
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
#include <targeting/common/attributes.H>
#include <targeting/targplatutil.H>

// fapi support

Expand All @@ -70,7 +71,7 @@

#include <mbox/ipc_msg_types.H>
#include <intr/interrupt.H>

#include <secureboot/nodecommif.H>

// Uncomment these files as they become available:
// #include "host_coalesce_host/host_coalesce_host.H"
Expand Down Expand Up @@ -244,7 +245,7 @@ errlHndl_t call_host_coalesce_host( )
master_node_mask = mask >> drawerCount;

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"master_node_mask=%X",master_node_mask);
"master_node_mask=0x%X",master_node_mask);
}

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
Expand Down Expand Up @@ -540,6 +541,26 @@ void *host_sys_fab_iovalid_processing(void* io_ptr )
sys->setAttr<TARGETING::ATTR_HB_EXISTING_IMAGE>(hb_existing_image);

#ifdef CONFIG_TPMDD
// Run Secure Node-to-Node Communication Procedure
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"host_sys_fab_iovalid_processing: hb_existing_image = 0x%X, "
"isMaster=%d. Calling nodeCommAbusExchange()",
hb_existing_image, TARGETING::UTIL::isCurrentMasterNode());

errlHndl_t err = SECUREBOOT::NODECOMM::nodeCommAbusExchange();
if (err)
{
// @TODO RTC 184518 Determine how to handle error log, but
// delete error log for now
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,ERR_MRK
"host_sys_fab_iovalid_processing: nodeCommAbusExchange() "
"returned err: plid=0x%X. Deleting err and continuing",
err->plid());
delete err;
err = nullptr;
}

// Lock the secure ABUS Link Mailboxes now
SECUREBOOT::lockAbusSecMailboxes();
#endif

Expand Down
1 change: 1 addition & 0 deletions src/usr/secureboot/node_comm/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ include ../common/common.mk
OBJS += node_comm_dd.o
OBJS += node_comm_test.o
OBJS += node_comm.o
OBJS += node_comm_exchange.o

VPATH += $(ROOTPATH)/src/usr/targeting/common
EXTRAINCDIR += $(ROOTPATH)/src/include/usr
Expand Down
4 changes: 3 additions & 1 deletion src/usr/secureboot/node_comm/node_comm.C
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ errlHndl_t nodeCommMapAttn(TARGETING::Target* i_pProc,

if (bit_count == 0)
{
TRACFCOMP(g_trac_nc,INFO_MRK"nodeCommMapAttn: no attentions found");
TRACFCOMP(g_trac_nc,INFO_MRK"nodeCommMapAttn: no attentions found: "
"FIR data = 0x%.16llX, mask=0x%.16llX, data+mask=0x%.16llX",
fir_data, fir_mask, fir_data_with_mask);
break;
}
else if (bit_count > 1)
Expand Down
28 changes: 27 additions & 1 deletion src/usr/secureboot/node_comm/node_comm.H
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ enum node_comm_registers_t : uint64_t
};

/**
* @brief Calculate Link Mailbox Register Address based on mode (XBUS or ABUS)
* @brief Convert Link Mailbox Register Address based on mode (XBUS or ABUS)
*
* @param[in] i_reg - Register Base Address - see node_comm_registers_t
* @param[in] i_mode - Indicates if the address is for a ABUS or XBUS operation
Expand Down Expand Up @@ -129,6 +129,32 @@ inline uint64_t getLinkMboxReg(uint8_t i_linkId, uint8_t i_mboxId)
return NCDD_REG_LINK_MBOX_00 + (2*i_linkId) + i_mboxId;
}

/**
* @brief Calculate Secure LinkId and MailboxId based on OBUS Instance
*
* @param[out] i_obusInstance - OBUS Instance of the operation
* @param[out] o_linkId - Link Id of the OBUS instance
* @param[out] o_mboxId - Mailbox Id of the OBUS instance
*
* @return void
*/
inline void getSecureLinkMboxFromObus(uint8_t i_obusInstance,
uint8_t & o_linkId,
uint8_t & o_mboxId)
{
// For each OBUS instance there are 2 links and 2 mailboxes
// and the Secure Link and Mailbox is always the relative 'L0M0'
// of these 4 possibilities
o_linkId = (2*i_obusInstance);

// @TODO RTC 184518 Until Secure Mailbox is not fenced off by FSP, use
// non-secure mailbox for communications
o_mboxId = 1;

return;
}


enum node_comm_fir_reg_helpers_t : uint64_t
{
NCDD_ABUS_FIR_ATTN_MASK = 0x000000000FFFF000,
Expand Down
8 changes: 4 additions & 4 deletions src/usr/secureboot/node_comm/node_comm_dd.C
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ TRAC_INIT( & g_trac_nc, NODECOMM_TRACE_NAME, KILOBYTE );
// ----------------------------------------------
// If the link(s) are up the operation should complete right away
// so there will only be a short polling window
#define NODE_COMM_POLL_DELAY_NS 1 // Sleep for 1ns per poll
#define NODE_COMM_POLL_DELAY_TOTAL_NS 10 // Total time to poll
#define NODE_COMM_DD_POLL_DELAY_NS 1 // Sleep for 1ns per poll
#define NODE_COMM_DD_POLL_DELAY_TOTAL_NS 10 // Total time to poll


using namespace TARGETING;
Expand Down Expand Up @@ -542,8 +542,8 @@ errlHndl_t ncddWaitForCmdComp (node_comm_args_t & i_args,
ctrl_reg_t & o_statusVal )
{
errlHndl_t err = nullptr;
uint64_t interval_ns = NODE_COMM_POLL_DELAY_NS;
int timeout_ns = NODE_COMM_POLL_DELAY_TOTAL_NS;
uint64_t interval_ns = NODE_COMM_DD_POLL_DELAY_NS;
int timeout_ns = NODE_COMM_DD_POLL_DELAY_TOTAL_NS;
ctrl_reg_t ctrl_reg_status;

TRACUCOMP(g_trac_nc, "ncddWaitForCmdComp(): timeout_ns=%d, "
Expand Down

0 comments on commit 7617e77

Please sign in to comment.