diff options
author | Bill Hoffa <wghoffa@us.ibm.com> | 2018-05-03 14:38:18 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-05-24 20:37:00 -0400 |
commit | 90a2cbe1f6071132c390f463d27193d87331a974 (patch) | |
tree | 43f739a461567626767d277fbf1d47746fbebc4a | |
parent | cd8df2a4b0330bf0f5457463d503f132cb649ca3 (diff) | |
download | talos-hostboot-90a2cbe1f6071132c390f463d27193d87331a974.tar.gz talos-hostboot-90a2cbe1f6071132c390f463d27193d87331a974.zip |
Set Master Proc Attrs during MPIPL FSP Fail-Over Scenario
- Need to account for a Service Processor Fail-Over scenario
where the 'master' processor could change. Because of this, FW
must re-evaluate which target pointer is the current master
and update attributes accordingly.
Change-Id: I83ada72389f05cc2a80d4c6a34db7d9ab3c2b3ce
CQ: SW429022
RTC: 182718
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59221
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@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>
-rw-r--r-- | src/include/usr/targeting/common/targetservice.H | 18 | ||||
-rw-r--r-- | src/usr/targeting/common/targetservice.C | 69 | ||||
-rwxr-xr-x | src/usr/targeting/targetservicestart.C | 7 |
3 files changed, 93 insertions, 1 deletions
diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H index 4fee83b92..860a5564b 100644 --- a/src/include/usr/targeting/common/targetservice.H +++ b/src/include/usr/targeting/common/targetservice.H @@ -874,6 +874,24 @@ class TargetService NODE_ID i_nodeId) const; #endif +#if defined (__HOSTBOOT_MODULE) && !defined (__HOSTBOOT_RUNTIME) + /** + * @brief Returns the master processor chip target + * + * @param[out] o_masterProcChipTargetHandle - The master proc chip + * target handle or nullptr + * + * @param[in] i_onlyFunctional - only functional procs be considered + * + * @pre Target service must be initialized + * + * @post Target Service returns the master proc target handle + */ + void _getMasterProcChipTargetHandle( + Target*& o_masterProcChipTargetHandle, + bool i_onlyFunctional) const; +#endif + /** * @brief Configures the pool of targets * diff --git a/src/usr/targeting/common/targetservice.C b/src/usr/targeting/common/targetservice.C index c5dad4f5d..a92423a92 100644 --- a/src/usr/targeting/common/targetservice.C +++ b/src/usr/targeting/common/targetservice.C @@ -55,7 +55,11 @@ #ifdef __HOSTBOOT_MODULE // Generated + +#include <arch/pirformat.H> #include <mutexattributes.H> +#include <sys/task.h> +#include <sys/misc.h> #endif #undef EXTRA_SANITY_CHECKING @@ -268,6 +272,46 @@ void TargetService::_getFirstTargetForIterators(Target*& o_firstTargetPtr) const #undef TARG_FN } +#if defined (__HOSTBOOT_MODULE) && !defined (__HOSTBOOT_RUNTIME) +void TargetService::_getMasterProcChipTargetHandle( + Target*& o_masterProcChipTargetHandle, + bool i_onlyFunctional) const +{ + #define TARG_FN "_getMasterProcChipTargetHandle()" + TARG_ASSERT(iv_initialized, TARG_ERR_LOC + "USAGE: TargetService not initialized"); + + task_affinity_pin(); + task_affinity_migrate_to_master(); + uint64_t cpuid = task_getcpuid(); + task_affinity_unpin(); + uint64_t l_masterGroupID = PIR_t::groupFromPir(cpuid); + uint64_t l_masterChipID = PIR_t::chipFromPir(cpuid); + + // Get all Proc targets + TARGETING::TargetHandleList l_procTargetList; + getAllChips(l_procTargetList, TYPE_PROC, i_onlyFunctional); + + // Find the master chip pointer + TARGETING::Target* l_masterChip = nullptr; + for (auto & l_chip: l_procTargetList) + { + TARGETING::ATTR_FABRIC_CHIP_ID_type l_chipId = + (l_chip)->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>(); + TARGETING::ATTR_FABRIC_GROUP_ID_type l_groupId = + (l_chip)->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>(); + if( l_chipId == l_masterChipID && l_groupId == l_masterGroupID ) + { + l_masterChip = (l_chip); + break; + } + } + + o_masterProcChipTargetHandle = l_masterChip; + #undef TARG_FN +} +#endif + #ifdef __HOSTBOOT_RUNTIME //****************************************************************************** // TargetService:: _getFirstTargetForIterators @@ -751,6 +795,12 @@ errlHndl_t TargetService::queryMasterProcChipTargetHandle( || PLAT::PROPERTIES::MULTINODE_AWARE || i_onlyFunctional ) { + +#if defined (__HOSTBOOT_MODULE) && !defined (__HOSTBOOT_RUNTIME) + _getMasterProcChipTargetHandle(pMasterProc, i_onlyFunctional); + pActingMasterTarget = pMasterProc; +#else + // Create filter that finds acting master processors PredicateCTM procFilter(CLASS_CHIP, TYPE_PROC); PredicateAttrVal<ATTR_PROC_MASTER_TYPE> actingMasterFilter( @@ -795,6 +845,7 @@ errlHndl_t TargetService::queryMasterProcChipTargetHandle( { pActingMasterTarget = pMasterProc; } +#endif } else { @@ -807,6 +858,22 @@ errlHndl_t TargetService::queryMasterProcChipTargetHandle( else if( (i_pNodeTarget->getAttr<ATTR_CLASS>() == CLASS_ENC) && (i_pNodeTarget->getAttr<ATTR_TYPE>() == TYPE_NODE) ) { +#if defined (__HOSTBOOT_MODULE) && !defined (__HOSTBOOT_RUNTIME) + TARGETING::Target* l_masterChip = NULL; + _getMasterProcChipTargetHandle(l_masterChip, i_onlyFunctional); + + //To hook back in with the implementation below for commonality -- + // either return an empty list (error) or push the master proc as + // the one and only element to the list + TARGETING::TargetHandleList l_masterProclist; + if (l_masterChip) + { + l_masterProclist.push_back(l_masterChip); + } + + TRACFCOMP( g_trac_targeting, "Found Master chip with HUID: %08x", l_masterChip->getAttr<ATTR_HUID>()); + +#else // Create predicate which looks for an acting master processor chip PredicateAttrVal<ATTR_PROC_MASTER_TYPE> l_procMasterMatches( PROC_MASTER_TYPE_ACTING_MASTER); @@ -818,7 +885,6 @@ errlHndl_t TargetService::queryMasterProcChipTargetHandle( l_masterProcFilter.push(&l_procPredicate).push( &l_procMasterMatches).And(); - // Limit to only functional procs if requested if (i_onlyFunctional) { @@ -831,6 +897,7 @@ errlHndl_t TargetService::queryMasterProcChipTargetHandle( const_cast<const Target*>(i_pNodeTarget), CHILD, ALL, &l_masterProcFilter); +#endif if(!l_masterProclist.empty()) { pMasterProc = l_masterProclist[0]; diff --git a/src/usr/targeting/targetservicestart.C b/src/usr/targeting/targetservicestart.C index 459f9e777..d655ede7d 100755 --- a/src/usr/targeting/targetservicestart.C +++ b/src/usr/targeting/targetservicestart.C @@ -473,6 +473,13 @@ static void initializeAttributes(TargetService& i_targetService, { l_chip->setAttr<ATTR_XSCOM_VIRTUAL_ADDR>(0); l_chip->setAttr<ATTR_HOMER_VIRT_ADDR>(0); + //In certain IPL Scenarios this attribute may not get + // cleared properly, so clearing it for all proc chip + // targets that are not the master proc chip + if (l_chip != l_pMasterProcChip) + { + l_chip->setAttr<ATTR_PROC_SBE_MASTER_CHIP>(0); + } } //Assemble list of tpms and zero out some values |