Skip to content

Commit

Permalink
Support sending chip info to SBEs on multinode
Browse files Browse the repository at this point in the history
  Existing code didn't support collecting the present chips
  on all nodes (Hostboot instances) and updating all SBEs with
  a system wide view.  For non multi drawer configs it will just
  update based on HB instance view.  For multi drawer configs
  the other hostboot instances will be queried for their configs,
  aggregated, and then informed of the system wide view via IPC
  commnuication.

Change-Id: I45c5673df26f940de212cbe2b54525e32c9147ab
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53603
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: Dean Sanner <dsanner@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
sannerd authored and dcrowell77 committed Feb 28, 2018
1 parent b6e41fc commit 2414e7c
Show file tree
Hide file tree
Showing 7 changed files with 586 additions and 60 deletions.
6 changes: 5 additions & 1 deletion src/include/usr/mbox/ipc_msg_types.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* Contributors Listed Below - COPYRIGHT 2013,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
Expand Down Expand Up @@ -35,6 +37,8 @@ namespace IPC
IPC_POPULATE_ATTRIBUTES = MBOX::FIRST_SECURE_MSG + 1,
IPC_TEST_CONNECTION = MBOX::FIRST_SECURE_MSG + 2,
IPC_START_PAYLOAD,
IPC_QUERY_CHIPINFO,
IPC_SET_SBE_CHIPINFO,
};

}; // namespace IPC
Expand Down
1 change: 1 addition & 0 deletions src/include/usr/mbox/mbox_queues.H
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace MBOX
HB_IPC_MSGQ = 9, //For inter-drawer HB messages
HB_POP_ATTR_MSGQ = 10, // populate Attribute response
HB_COALESCE_MSGQ = 11, //host_coalesce response
HB_SBE_SYSCONFIG_MSGQ = 12, //For SBE System Config response

// Add HB mbox msg queue ids (services) before this line
HB_LAST_VALID_MSGQ, // end of valid HB mbox msgQ ids
Expand Down
57 changes: 57 additions & 0 deletions src/include/usr/runtime/runtime.H
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,28 @@
namespace RUNTIME
{

/******************************************************************************/
// Globals/Constants
/******************************************************************************/
constexpr uint8_t HB_SBE_WAITING_FOR_MSG = 0x0;
constexpr uint8_t HB_SBE_MSG_DONE = 0x1;
constexpr uint32_t MAX_TIME_ALLOWED_MS = 10000;
// NUMBER_OF_POSSIBLE_DRAWERS definition here should be in sync with
// src/usr/isteps/istep18/establish_system_smp.H's definition of the same constant.
constexpr uint8_t NUMBER_OF_POSSIBLE_DRAWERS = 8;
constexpr uint8_t MAX_PROCS_PER_NODE = 8;
constexpr uint8_t CONTINUE_WAIT_FOR_MSGS = 0x2;
constexpr uint8_t TIME_EXPIRED=0x3;



/**
* enum used for sending messages within sendSBEsystemConfig
*/
enum
{
HB_SBE_SYSCONFIG_TIMER_MSG = 0xA2,
};
/**
* @brief Add the host data mainstore location to VMM
*
Expand Down Expand Up @@ -106,6 +127,42 @@ errlHndl_t populate_hbTpmInfo( void );
*/
errlHndl_t populate_TpmInfoByNode();

/**
* @brief Timer function for safe error handling in sendSBESystemConfig
*
* @description Used inside the sendSBEsystemConfig() to wait for
* responses from other nodes
* @param[in] i_msgQPtr -- Pointer to the Message Queue to wait for messages
*
* @return void
*/
void* sendSBEsystemConfig_timer(void* i_msgQPtr);

/**
* @brief Waits and Collects responses from all drawers
*
* @description Used inside the sendSBEsystemConfig() to wait and
* collect responses from other nodes
* @param[in] i_msgQPtr -- Pointer to the Message Queue to wait for messages
* @param[in] i_msgCount -- Number of messages to wait for
* @param[in] i_msgType -- Type of the message to wait for
* @param[in, out] i_systemFabricConfigurationMap -- to consolidate node info from all nodes
*
* @return void
*/
errlHndl_t collectRespFromAllDrawers( void* i_msgQPtr, uint64_t i_msgCount, uint32_t i_msgType, uint64_t& i_systemFabricConfigurationMap );

/**
* @brief Sends the chip config down to the SBEs
*
* @description Determines the system wide chip information to send to
* the SBE so it knows which chips are present for syncing with in MPIPL.
* Uses IPC to communication between HB instances if multinode
*
* @return errlHndl_t nullptr on success else pointer to error log
*/
errlHndl_t sendSBESystemConfig();


// How many pointers/sections there are in HB runtime data
#define HBRT_NUM_PTRS 2
Expand Down
3 changes: 3 additions & 0 deletions src/include/usr/runtime/runtime_reasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace RUNTIME
MOD_POPULATE_TPMINFOBYNODE = 0x19, /**< populate_hbruntime.C */
MOD_FILL_RSVMEM_HBDATA = 0x20, /**< populate_hbruntime.C */
MOD_ATTR_RUNTIME_CHECK_PREP_FAIL = 0x21, /**< populate_hbruntime.C */
MOD_SEND_SBE_SYSCONFIG = 0x22, /**< populate_hbruntime.C */
MOD_RT_FIRMWARE_NOTIFY = 0x23, /**< rt_fwnotify.C */
MOD_RT_FIRMWARE_REQUEST = 0x24, /**< rt_fwreq_helper.C */
MOD_RT_ATTR_SYNC_REQUEST = 0x25, /**< rt_fwnotify.C */
Expand Down Expand Up @@ -129,6 +130,8 @@ namespace RUNTIME
RC_TPM_HDAT_MAP_BLOCK_ERR = RUNTIME_COMP_ID | 0x3B,
RC_ATTR_UPDATE_FAILED = RUNTIME_COMP_ID | 0x3C,
RC_HB_RES_MEM_EXCEEDED = RUNTIME_COMP_ID | 0x3D,
RC_SEND_SBE_TIMER_EXPIRED = RUNTIME_COMP_ID | 0x3E,
RC_HOST_TIMER_THREAD_FAIL = RUNTIME_COMP_ID | 0x3F,
};

enum UserDetailsTypes
Expand Down
64 changes: 8 additions & 56 deletions src/usr/isteps/istep21/call_host_runtime_setup.C
Original file line number Diff line number Diff line change
Expand Up @@ -457,62 +457,6 @@ void* call_host_runtime_setup (void *io_pArgs)
}
}

//Need to send System Configuration down to SBE
//Use targeting code to get a list of all processors
TARGETING::TargetHandleList l_procChips;
getAllChips( l_procChips, TARGETING::TYPE_PROC , true);
uint64_t l_systemFabricConfigurationMap = 0x0;


for(auto l_proc : l_procChips)
{
//Get fabric info from proc
uint8_t l_fabricChipId =
l_proc->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
uint8_t l_fabricGroupId =
l_proc->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>();
//Calculate what bit position this will be
uint8_t l_bitPos = l_fabricChipId + (8 * l_fabricGroupId);

//Set the bit @ l_bitPos to be 1 because this is a functional proc
l_systemFabricConfigurationMap |= (0x8000000000000000 >> l_bitPos);
}

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Setting sending systemConfig to all Procs...");

for(auto l_proc : l_procChips)
{
TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"calling sendSystemConfig on proc 0x%x",
l_proc->getAttr<TARGETING::ATTR_POSITION>());
l_err = SBEIO::sendSystemConfig(l_systemFabricConfigurationMap,
l_proc);
if ( l_err )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"sendSystemConfig ERROR : Error sending sbe chip-op to proc 0x%.8X. Returning errorlog, reason=0x%x",
TARGETING::get_huid(l_proc),
l_err->reasonCode() );
break;
}
else
{
TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"sendSystemConfig SUCCESS" );
}
}

if(l_err)
{
break;
}
else
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Successfully sent all system configs to procs via SBE chip op !!");
}

// Need to load up the runtime module if it isn't already loaded
if ( !VFS::module_is_loaded( "libruntime.so" ) )
{
Expand All @@ -528,6 +472,14 @@ void* call_host_runtime_setup (void *io_pArgs)
}
}

//Need to send System Configuration down to SBE for all HB
//instances
l_err = RUNTIME::sendSBESystemConfig();
if(l_err)
{
break;
}

// Configure the ATTR_HBRT_HYP_ID attributes so that runtime code and
// whichever hypervisor is loaded can reference equivalent targets
l_err = RUNTIME::configureHbrtHypIds(TARGETING::is_phyp_load());
Expand Down
91 changes: 90 additions & 1 deletion src/usr/mbox/ipcSp.C
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <mbox/mbox_reasoncodes.H>
#include <intr/interrupt.H>
#include <initservice/initserviceif.H>
#include <sbeio/sbeioif.H>


namespace ISTEP_21
{
Expand Down Expand Up @@ -173,7 +175,94 @@ void IpcSp::msgHandler()
}
break;

case IPC_START_PAYLOAD:
case IPC_QUERY_CHIPINFO:
{
TARGETING::TargetHandleList l_procChips;
getAllChips( l_procChips, TARGETING::TYPE_PROC , true);
uint64_t l_systemFabricConfigurationMap = 0x0;
for(auto l_proc : l_procChips)
{
//Get fabric info from proc
uint8_t l_fabricChipId =
l_proc->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
uint8_t l_fabricGroupId =
l_proc->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>();
//Calculate what bit position this will be
uint8_t l_bitPos = l_fabricChipId + (RUNTIME::MAX_PROCS_PER_NODE * l_fabricGroupId);

//Set the bit @ l_bitPos to be 1 because this is a functional proc
l_systemFabricConfigurationMap |= (0x8000000000000000 >> l_bitPos);
}

TRACFCOMP( g_trac_ipc,
"IPC Query ChipInfo 0x%lx", l_systemFabricConfigurationMap);

//Send a response with this HB instances chip info
msg->extra_data = reinterpret_cast<uint64_t*>(l_systemFabricConfigurationMap);
err = MBOX::send(MBOX::HB_SBE_SYSCONFIG_MSGQ, msg, msg->data[1] );
if (err)
{
uint32_t l_errPlid = err->plid();
errlCommit(err,IPC_COMP_ID);
INITSERVICE::doShutdown(l_errPlid, true);
}
break;
}
case IPC_SET_SBE_CHIPINFO:
{
//Need to send System Configuration down to SBE
//Master sends info to set into SBE via msg->extra_data
uint64_t l_systemFabricConfigurationMap =
reinterpret_cast<uint64_t>(msg->extra_data);

TRACFCOMP( g_trac_ipc,
"sending systemConfig[0x%lx] to SBEs",
l_systemFabricConfigurationMap);

TARGETING::TargetHandleList l_procChips;
getAllChips( l_procChips, TARGETING::TYPE_PROC , true);
for(auto l_proc : l_procChips)
{
TRACDCOMP( g_trac_ipc,
"calling sendSystemConfig on proc 0x%x",
TARGETING::get_huid(l_proc));
err = SBEIO::sendSystemConfig(l_systemFabricConfigurationMap,
l_proc);
if ( err )
{
TRACFCOMP( g_trac_ipc,
"sendSystemConfig ERROR : Error sending sbe chip-op to proc 0x%.8X. Returning errorlog, reason=0x%x",
TARGETING::get_huid(l_proc),
err->reasonCode() );
break;
}
}

//If error terminate here
if(err)
{
TRACFCOMP( g_trac_ipc, "In ipcSp: SBEIO::sendSystemConfig errored - must shutdown now!!!");
uint32_t l_errPlid = err->plid();
errlCommit(err, IPC_COMP_ID);
INITSERVICE::doShutdown(l_errPlid, true);
}
else
{
TRACFCOMP( g_trac_ipc,
"Successfully sent all system configs to procs via SBE chip op !!");
}

//Send response back to the master HB to indicate successful configuration down to SBE
err = MBOX::send(MBOX::HB_SBE_SYSCONFIG_MSGQ, msg, msg->data[1] );
if (err)
{
uint32_t l_errPlid = err->plid();
errlCommit(err,IPC_COMP_ID);
INITSERVICE::doShutdown(l_errPlid, true);
}
break;
}
case IPC_START_PAYLOAD:
{
const int NUM_MOD = 3;
const char * mods[NUM_MOD] =
Expand Down

0 comments on commit 2414e7c

Please sign in to comment.