From 90a2cbe1f6071132c390f463d27193d87331a974 Mon Sep 17 00:00:00 2001 From: Bill Hoffa Date: Thu, 3 May 2018 14:38:18 -0500 Subject: 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 Reviewed-by: Prachi Gupta Tested-by: Jenkins Server Reviewed-by: Christian R. Geddes Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa --- src/usr/targeting/common/targetservice.C | 69 +++++++++++++++++++++++++++++++- src/usr/targeting/targetservicestart.C | 7 ++++ 2 files changed, 75 insertions(+), 1 deletion(-) (limited to 'src/usr') 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 #include +#include +#include #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_GROUP_ID_type l_groupId = + (l_chip)->getAttr(); + 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 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() == CLASS_ENC) && (i_pNodeTarget->getAttr() == 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()); + +#else // Create predicate which looks for an acting master processor chip PredicateAttrVal 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(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(0); l_chip->setAttr(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(0); + } } //Assemble list of tpms and zero out some values -- cgit v1.2.1