From efb976fc64fc447d93015d3bb950431f341b6c19 Mon Sep 17 00:00:00 2001 From: Nick Bofferding Date: Tue, 8 Mar 2016 08:33:57 -0600 Subject: Support association between pervasive targets and other unit targets - Updated attribute compiler to link targets based on pervasive association - Updated attribute compiler to support virtual attributes - Added virtual attribute describing a unit's pervasive association - Updated Nimbus system XML with pervasive/unit associations - Fixed various errors compiling with debug trace enabled - Updated FSP attribute generator to create perv/unit links - Fixed FSP bad path character in attribute generator - Fixed PHB chip unit numbering in attribute generator - Replaced some NVBUS references with NV RTC: 148577 CMVC-Prereq: 988338 Change-Id: I6f3c4aa806e465dd9f09859c4911ff70db782a4f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21943 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Martin Gloff Reviewed-by: Christian R. Geddes Reviewed-by: Daniel M. Crowell --- src/include/usr/targeting/common/target.H | 7 +- src/include/usr/targeting/common/targetservice.H | 4 + src/usr/fapi2/test/fapi2GetParentTest.C | 14 +- src/usr/fapi2/test/fapi2TestUtils.C | 5 +- src/usr/hwas/test/hwas1test.H | 6 + src/usr/isteps/istep12/call_dmi_attr_update.C | 4 +- src/usr/isteps/istep14/call_host_startprd_dram.C | 3 +- src/usr/targeting/common/genHwsvMrwXml.pl | 116 ++++++++- .../targeting/common/test/testcommontargeting.H | 103 ++++++++ .../targeting/common/xmltohb/attribute_types.xml | 13 + .../common/xmltohb/simics_NIMBUS.system.xml | 260 +++++++++++++++++++- src/usr/targeting/common/xmltohb/target_types.xml | 13 + .../targeting/common/xmltohb/vbu_NIMBUS.system.xml | 262 ++++++++++++++++++++- src/usr/targeting/common/xmltohb/xmltohb.pl | 139 +++++++++-- 14 files changed, 899 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/include/usr/targeting/common/target.H b/src/include/usr/targeting/common/target.H index 4901845c8..ae7f64e90 100644 --- a/src/include/usr/targeting/common/target.H +++ b/src/include/usr/targeting/common/target.H @@ -537,14 +537,15 @@ class Target // Array of pointers to target handles. Currently there is one pointer // for each supported association type. The currently supported - // association types are PARENT, CHILD, PARENT_BY_AFFINITY, and - // CHILD_BY_AFFINTY. The number of pointers should exactly equal value + // association types are PARENT, CHILD, PARENT_BY_AFFINITY, + // CHILD_BY_AFFINTY, PERVASIVE_CHILD, and PARENT_PERVASIVE. + // The number of pointers should exactly equal value // of TargetService::MAX_ASSOCIATION_TYPES defined in // targeting/common/targetservice.H. Due to the huge code changes // necessary to directly use that enum value, a compile time assert in // targeting/common/targetservice.C enforces that restriction. TARGETING::AbstractPointer< AbstractPointer > - iv_ppAssociations[4]; + iv_ppAssociations[6]; private: // Private CTORs/DTORs/Operators diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H index 455502dcf..79641e7ff 100644 --- a/src/include/usr/targeting/common/targetservice.H +++ b/src/include/usr/targeting/common/targetservice.H @@ -179,6 +179,10 @@ class TargetService ///< Hardware affinity. For example the child ///< of a memory controller channel target might ///< be a DIMM target + PERVASIVE_CHILD, ///< The result target(s) should be units + ///< associated with a pervasive target + PARENT_PERVASIVE, ///< The result target should be a pervasive + ///< target MAX_ASSOCIATION_TYPES, ///< Number of types, must always be last }; diff --git a/src/usr/fapi2/test/fapi2GetParentTest.C b/src/usr/fapi2/test/fapi2GetParentTest.C index 6418b8b9a..3fc30cfbb 100644 --- a/src/usr/fapi2/test/fapi2GetParentTest.C +++ b/src/usr/fapi2/test/fapi2GetParentTest.C @@ -137,7 +137,7 @@ errlHndl_t fapi2GetParentTest() targeting_targets[MY_XBUS]); Target fapi2_obusTarget( targeting_targets[MY_OBUS]); - Target fapi2_nvbusTarget( + Target fapi2_nvTarget( targeting_targets[MY_NV]); Target fapi2_ppeTarget( targeting_targets[MY_PPE]); @@ -574,7 +574,7 @@ errlHndl_t fapi2GetParentTest() numFails++; } -// //Check PHB's parents + //Check PHB's parents l_tempTargetingParent = static_cast( fapi2_phbTarget.getParent()); @@ -741,10 +741,10 @@ errlHndl_t fapi2GetParentTest() numFails++; } - //Check NVBUS's parents + //Check NV's parents l_tempTargetingParent = static_cast( - fapi2_nvbusTarget.getParent()); + fapi2_nvTarget.getParent()); numTests++; if(TARGETING::get_huid(l_nimbusProc) != TARGETING::get_huid(l_tempTargetingParent)) @@ -758,10 +758,10 @@ errlHndl_t fapi2GetParentTest() * @reasoncode fapi2::RC_NV_NO_PROC_FOUND * @userdata1[0:31] Expected Parent HUID * @userdata1[32:63] Actual Parent HUID - * @userdata2[0:31] Instance of NVBUS + * @userdata2[0:31] Instance of NV * @userdata2[32:63] fapi2 Type of expected parent * @devdesc Could not find the parent PROC of this - * NVBUS target + * NV target */ l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi2::MOD_FAPI2_PLAT_GET_PARENT_TEST, @@ -778,7 +778,7 @@ errlHndl_t fapi2GetParentTest() TO_UINT32(TARGET_TYPE_PROC_CHIP)), true/*SW Error*/); errlCommit(l_err,HWPF_COMP_ID); - TS_FAIL( "fapi2TargetTest::Unable to find NVBUS's PROC parent!"); + TS_FAIL( "fapi2TargetTest::Unable to find NV's PROC parent!"); numFails++; } diff --git a/src/usr/fapi2/test/fapi2TestUtils.C b/src/usr/fapi2/test/fapi2TestUtils.C index acf25eeb3..e3d07ec0e 100644 --- a/src/usr/fapi2/test/fapi2TestUtils.C +++ b/src/usr/fapi2/test/fapi2TestUtils.C @@ -45,7 +45,7 @@ #define NUM_MCBISTS 2 #define NUM_PECS 3 #define NUM_PHBS 6 -#define NUM_XBUS 1 +#define NUM_XBUS 2 #define NUM_OBUS 2 #define NUM_NV 2 #define NUM_PPES 21 @@ -195,7 +195,8 @@ void generateTargets(TARGETING::Target* i_pMasterProcChip, i_pMasterProcChip->tryGetAttr(l_epath); for(int i = 0; i < NUM_XBUS; i++) { - l_epath.addLast(TARGETING::TYPE_XBUS, i); + // Nimbus doesn't have the 0th xbus, so index from 1 for now + l_epath.addLast(TARGETING::TYPE_XBUS, i+1); if(TARGETING::targetService().toTarget(l_epath) != NULL) { o_targetList[MY_XBUS] = diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H index 02ece0841..b6aad2fa2 100644 --- a/src/usr/hwas/test/hwas1test.H +++ b/src/usr/hwas/test/hwas1test.H @@ -714,6 +714,12 @@ public: switch(l_type) { case TYPE_XBUS: + if((1 == l_chipUnit) || (2 == l_chipUnit)) + { + // XBUS1 & XBUS2 should be functional on Nimbus + continue; + } + sprintf(l_type_str, "XBUS"); sprintf(l_pgData, ", pgData = 0x%04x", pgData[VPD_CP00_PG_XBUS_INDEX]); diff --git a/src/usr/isteps/istep12/call_dmi_attr_update.C b/src/usr/isteps/istep12/call_dmi_attr_update.C index 4405afab0..bf1e4571a 100644 --- a/src/usr/isteps/istep12/call_dmi_attr_update.C +++ b/src/usr/isteps/istep12/call_dmi_attr_update.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -24,7 +24,7 @@ /* IBM_PROLOG_END_TAG */ #include #include - +#include using namespace ERRORLOG; using namespace ISTEP_ERROR; diff --git a/src/usr/isteps/istep14/call_host_startprd_dram.C b/src/usr/isteps/istep14/call_host_startprd_dram.C index 094293111..33b39ebf0 100644 --- a/src/usr/isteps/istep14/call_host_startprd_dram.C +++ b/src/usr/isteps/istep14/call_host_startprd_dram.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -23,6 +23,7 @@ /* */ /* IBM_PROLOG_END_TAG */ #include +#include using namespace ERRORLOG; diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl index 34b6885f8..2e332c252 100755 --- a/src/usr/targeting/common/genHwsvMrwXml.pl +++ b/src/usr/targeting/common/genHwsvMrwXml.pl @@ -51,7 +51,8 @@ use strict; use XML::Simple; use Data::Dumper; - +# Enables the state variable feature +use feature "state"; ################################################################################ # Set PREFERRED_PARSER to XML::Parser. Otherwise it uses XML::SAX which contains @@ -79,13 +80,14 @@ use constant MAX_MCA_PER_PROC => 8, MAX_MCBIST_PER_PROC => 2, MAX_PEC_PER_PROC => 3, - MAX_PHB_PER_PROC => 18, + MAX_PHB_PER_PROC => 6, MAX_MBA_PER_MEMBUF => 2, MAX_OBUS_PER_PROC => 4, MAX_PPE_PER_PROC => 21, MAX_PERV_PER_PROC => 42, MAX_CAPP_PER_PROC => 2, MAX_SBE_PER_PROC => 1, + MAX_NV_PER_PROC => 2, }; # for SPI connections in the @SPIs array @@ -3494,6 +3496,91 @@ sub generate_ex "; } +sub getPervasiveForUnit +{ + # Input should be of the form , example: "core0" + my ($unit) = @_; + + # The mapping is a static variable that is preserved across new calls to + # the function to speed up the mapping performance + state %unitToPervasive; + + if ( not %unitToPervasive ) + { + for my $core (0..MAX_CORE_PER_PROC-1) + { + $unitToPervasive{"core$core"} = 32 + $core; + } + for my $eq (0..MAX_EQ_PER_PROC-1) + { + $unitToPervasive{"eq$eq"} = 16 + $eq; + } + for my $xbus (0..MAX_XBUS_PER_PROC-1) + { + $unitToPervasive{"xbus$xbus"} = 6; + } + for my $obus (0..MAX_OBUS_PER_PROC-1) + { + $unitToPervasive{"obus$obus"} = 9 + $obus; + } + for my $capp (0..MAX_CAPP_PER_PROC-1) + { + $unitToPervasive{"capp$capp"} = 2 * ($capp+1); + } + for my $mcbist (0..MAX_MCBIST_PER_PROC-1) + { + $unitToPervasive{"mcbist$mcbist"} = 7 + $mcbist; + } + for my $mcs (0..MAX_MCS_PER_PROC-1) + { + $unitToPervasive{"mcs$mcs"} = 7 + ($mcs > 1); + } + for my $mca (0..MAX_MCA_PER_PROC-1) + { + $unitToPervasive{"mca$mca"} = 7 + ($mca > 3); + } + for my $pec (0..MAX_PEC_PER_PROC-1) + { + $unitToPervasive{"pec$pec"} = 13 + $pec; + } + for my $phb (0..MAX_PHB_PER_PROC-1) + { + $unitToPervasive{"phb$phb"} = 13 + ($phb>0) + ($phb>2); + } + #TODO: RTC 149326 add calls to addPervasiveParentLink for nv + # in the generate_nv function when it gets created + for my $nv (0..MAX_NV_PER_PROC-1) + { + $unitToPervasive{"nv$nv"} = 5; + } + } + + my $pervasive = "unknown"; + if(exists $unitToPervasive{$unit}) + { + $pervasive = $unitToPervasive{$unit}; + } + else + { + die "Cannot find pervasive for $unit"; + } + + return $pervasive +} + +sub addPervasiveParentLink +{ + my ($sys,$node,$proc,$unit,$type) = @_; + + my $pervasive = getPervasiveForUnit("$type$unit"); + + print " + + PARENT_PERVASIVE + physical:sys-$sys/node-$node/proc-$proc/perv-$pervasive + "; +} + sub generate_core { my ($proc, $core, $ordinalId, $ipath) = @_; @@ -3536,6 +3623,8 @@ sub generate_core $chipletId "; + addPervasiveParentLink($sys,$node,$proc,$core_orig,"core"); + # call to do any fsp per-ex_core attributes do_plugin('fsp_ex_core', $proc, $core, $ordinalId ); @@ -3613,6 +3702,8 @@ sub generate_eq $eq "; + addPervasiveParentLink($sys,$node,$proc,$eq,"eq"); + # call to do any fsp per-eq attributes do_plugin('fsp_eq', $proc, $eq, $ordinalId ); @@ -3698,6 +3789,8 @@ sub generate_mcs $msb_swap "; + addPervasiveParentLink($sys,$node,$proc,$mcs,"mcs"); + # call to do any fsp per-mcs attributes do_plugin('fsp_mcs', $proc, $mcs, $ordinalId ); @@ -3753,6 +3846,8 @@ sub generate_mca $mca_orig "; + addPervasiveParentLink($sys,$node,$proc,$mca_orig,"mca"); + # call to do any fsp per-mca attributes do_plugin('fsp_mca', $proc, $mca, $ordinalId ); @@ -3805,6 +3900,8 @@ sub generate_mcbist $mcbist "; + addPervasiveParentLink($sys,$node,$proc,$mcbist,"mcbist"); + # call to do any fsp per-mcbist attributes do_plugin('fsp_mcbist', $proc, $mcbist, $ordinalId ); @@ -3857,6 +3954,8 @@ sub generate_pec $pec "; + addPervasiveParentLink($sys,$node,$proc,$pec,"pec"); + # call to do any fsp per-pec attributes do_plugin('fsp_pec', $proc, $pec, $ordinalId ); @@ -3872,6 +3971,7 @@ sub generate_phb_chiplet my $mruData = get_mruid($ipath); my $pec = 0; + my $phbChipUnit = $phb; if($phb > 0 && $phb < 3) { $pec = 1; @@ -3902,7 +4002,7 @@ sub generate_phb_chiplet HUID${uidstr} PHYS_PATH - physical:sys-$sys/node-$node/proc-$proc/pec-$pec}phb-$phb + physical:sys-$sys/node-$node/proc-$proc/pec-$pec/phb-$phb MRU_ID @@ -3918,9 +4018,11 @@ sub generate_phb_chiplet CHIP_UNIT - $phb + $phbChipUnit "; + addPervasiveParentLink($sys,$node,$proc,$phbChipUnit,"phb"); + # call to do any fsp per-phb attributes do_plugin('fsp_phb', $proc, $phb, $ordinalId ); @@ -4026,6 +4128,8 @@ sub generate_obus $obus "; + addPervasiveParentLink($sys,$node,$proc,$obus,"obus"); + # call to do any fsp per-obus attributes do_plugin('fsp_obus', $proc, $obus, $ordinalId ); @@ -4078,6 +4182,8 @@ sub generate_xbus $xbus "; + addPervasiveParentLink($sys,$node,$proc,$xbus,"xbus"); + # call to do any fsp per-obus attributes do_plugin('fsp_xbus', $proc, $xbus, $ordinalId ); @@ -4182,6 +4288,8 @@ sub generate_capp $capp "; + addPervasiveParentLink($sys,$node,$proc,$capp,"capp"); + # call to do any fsp per-capp attributes do_plugin('fsp_capp', $proc, $capp, $ordinalId ); diff --git a/src/usr/targeting/common/test/testcommontargeting.H b/src/usr/targeting/common/test/testcommontargeting.H index d62c9d51b..56a6e3961 100644 --- a/src/usr/targeting/common/test/testcommontargeting.H +++ b/src/usr/targeting/common/test/testcommontargeting.H @@ -1960,7 +1960,110 @@ class CommonTargetingTestSuite: public CxxTest::TestSuite TARG_TS_TRACE(EXIT_MRK "testL4s" ); } + /** + * @brief Tests pervasive associations + * + * @par Detailed Description: + * An applicable pervasive target has a "PERVASIVE_CHILD" + * association that links it to a child unit target. For + * example, a pervasive target may have said link to a child + * core target. That child core target, in turn, will have + * a "PARENT_PERVASIVE" association back to it's parent, + * forming a bidirectional relationship, which can be navigated + * with target service getAssociated() calls. This test + * verifies that pervasive target A links to child target B, + * and that in turn, B links back to A. + */ + void testPervasiveRelationship() + { + TARG_TS_TRACE(ENTER_MRK "testPervasiveRelationship" ); + + using namespace TARGETING; + + // Get all pervasive targets in the model and loop through + // each one + PredicateCTM pervasiveUnit(CLASS_UNIT,TYPE_PERV); + TargetRangeFilter pervasiveUnitFilter( + targetService().begin(), + targetService().end(), + &pervasiveUnit); + + size_t pervasives = 0; + + for(;pervasiveUnitFilter;++pervasiveUnitFilter) + { + ++pervasives; + + // For each pervasive target, find all its children + // using the special PERVASIVE_CHILD association type + TargetHandleList pervasiveChildren; + (void)targetService().getAssociated( + pervasiveChildren, + *pervasiveUnitFilter, + TARGETING::TargetService::PERVASIVE_CHILD, + TARGETING::TargetService::ALL); + ATTR_PHYS_PATH_type pervasivePath = (*pervasiveUnitFilter)-> + getAttr(); + + TARG_TS_TRACE("Found %d children for pervasive w/ " + "path %s",pervasiveChildren.size(), + pervasivePath.toString()); + + // Then for each child, navigate back to what should be the original + // pervasive target + for(TARGETING::TargetHandleList::const_iterator child + = pervasiveChildren.begin(); + child != pervasiveChildren.end(); + ++child) + { + ATTR_PHYS_PATH_type childPath = (*child)-> + getAttr(); + + TARG_TS_TRACE("Child path is %s", + childPath.toString()); + + TargetHandleList parentPervasive; + (void)targetService().getAssociated( + parentPervasive, + *child, + TARGETING::TargetService::PARENT_PERVASIVE, + TARGETING::TargetService::ALL); + + // Make sure every child has exactly one parent pervasive + if(parentPervasive.size() != 1) + { + TARG_TS_FAIL("child of pervasive did not have exactly 1 " + "parent pervasive (had %d)",parentPervasive.size()); + } + + // Make sure that the parent of 'the child of the parent' is the + // parent + if(*parentPervasive.begin() != *pervasiveUnitFilter) + { + TARG_TS_FAIL("parent of child of pervasive was not the " + "original pervasive"); + } + + // Make sure that the parent is not accidentally the child + if(*parentPervasive.begin() == *child) + { + TARG_TS_FAIL("parent is equal to child"); + } + } + } + + if(!pervasives) + { + TARG_TS_FAIL("no pervasive units found in the model"); + } + else + { + TARG_TS_TRACE("Found total of %d pervasive targets",pervasives); + } + + TARG_TS_TRACE(EXIT_MRK "testPervasiveRelationship" ); + } }; #endif // __TARGETING_COMMON_TESTCOMMONTARGETING_H diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index 239ae3ed4..bc514ebc5 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -19980,4 +19980,17 @@ firmware notes: Platforms should initialize this attribute to AUTO (0) + + PARENT_PERVASIVE + + Physical entity path of the target's associated pervasive target + + + EntityPath + + non-volatile + + + + diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml index 5332f5c1a..bf639e453 100644 --- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml @@ -231,6 +231,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-16 + @@ -249,6 +253,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-17 + @@ -267,6 +275,10 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-18 + @@ -285,6 +297,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-19 + @@ -303,6 +319,10 @@ CHIP_UNIT 4 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-20 + @@ -321,6 +341,10 @@ CHIP_UNIT 5 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-21 + @@ -562,6 +586,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-32 + @@ -580,6 +608,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-33 + @@ -599,6 +631,10 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-34 + @@ -617,6 +653,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-35 + @@ -636,6 +676,10 @@ CHIP_UNIT 4 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-36 + @@ -654,6 +698,10 @@ CHIP_UNIT 5 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-37 + @@ -673,6 +721,10 @@ CHIP_UNIT 6 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-38 + @@ -691,6 +743,10 @@ CHIP_UNIT 7 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-39 + @@ -710,6 +766,10 @@ CHIP_UNIT 8 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-40 + @@ -728,6 +788,10 @@ CHIP_UNIT 9 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-41 + @@ -747,6 +811,10 @@ CHIP_UNIT 10 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-42 + @@ -765,6 +833,10 @@ CHIP_UNIT 11 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-43 + @@ -784,6 +856,10 @@ CHIP_UNIT 12 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-44 + @@ -802,6 +878,10 @@ CHIP_UNIT 13 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-45 + @@ -821,6 +901,10 @@ CHIP_UNIT 14 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-46 + @@ -839,6 +923,10 @@ CHIP_UNIT 15 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-47 + @@ -858,6 +946,10 @@ CHIP_UNIT 16 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-48 + @@ -876,6 +968,10 @@ CHIP_UNIT 17 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-49 + @@ -895,6 +991,10 @@ CHIP_UNIT 18 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-50 + @@ -913,6 +1013,10 @@ CHIP_UNIT 19 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-51 + @@ -932,6 +1036,10 @@ CHIP_UNIT 20 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-52 + @@ -950,6 +1058,10 @@ CHIP_UNIT 21 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-53 + @@ -969,6 +1081,10 @@ CHIP_UNIT 22 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-54 + @@ -987,6 +1103,10 @@ CHIP_UNIT 23 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-55 + @@ -1012,6 +1132,10 @@ EI_BUS_TX_MSBSWAP 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1036,6 +1160,10 @@ EI_BUS_TX_MSBSWAP 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1060,6 +1188,10 @@ EI_BUS_TX_MSBSWAP 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1084,6 +1216,10 @@ EI_BUS_TX_MSBSWAP 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1103,6 +1239,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1121,6 +1261,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1140,6 +1284,10 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1158,6 +1306,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1177,6 +1329,10 @@ CHIP_UNIT 4 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1195,6 +1351,10 @@ CHIP_UNIT 5 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1214,6 +1374,10 @@ CHIP_UNIT 6 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1232,6 +1396,10 @@ CHIP_UNIT 7 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1251,6 +1419,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1269,6 +1441,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1288,6 +1464,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-13 + @@ -1306,6 +1486,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-14 + @@ -1324,6 +1508,10 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-15 + @@ -1343,6 +1531,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-13 + @@ -1362,6 +1554,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-14 + @@ -1380,6 +1576,10 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-14 + @@ -1399,6 +1599,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-15 + @@ -1417,6 +1621,10 @@ CHIP_UNIT 4 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-15 + @@ -1435,6 +1643,10 @@ CHIP_UNIT 5 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-15 + @@ -1454,6 +1666,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-9 + @@ -1472,6 +1688,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-12 + @@ -1491,6 +1711,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-5 + @@ -1509,6 +1733,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-5 + - sys0node0proc0xbus0 + sys0node0proc0xbus1 unit-xbus-nimbus HUID0x000E0601 PHYS_PATH - physical:sys-0/node-0/proc-0/xbus-0 + physical:sys-0/node-0/proc-0/xbus-1 AFFINITY_PATH - affinity:sys-0/node-0/proc-0/xbus-0 + affinity:sys-0/node-0/proc-0/xbus-1 CHIP_UNIT - 0 + 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-6 + - sys0node0proc0xbus1 + sys0node0proc0xbus2 unit-xbus-nimbus HUID0x000E0602 PHYS_PATH - physical:sys-0/node-0/proc-0/xbus-1 + physical:sys-0/node-0/proc-0/xbus-2 AFFINITY_PATH - affinity:sys-0/node-0/proc-0/xbus-1 + affinity:sys-0/node-0/proc-0/xbus-2 CHIP_UNIT - 0 + 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-6 + @@ -2560,6 +2796,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-2 + @@ -2578,6 +2818,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-4 + diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index f4aeb08f8..9e1125653 100755 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -2204,6 +2204,7 @@ DECONFIG_GARDABLE1 SCRATCH_UINT8_15 + PARENT_PERVASIVE @@ -562,6 +586,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-32 + @@ -580,6 +608,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-33 + @@ -599,6 +631,10 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-34 + @@ -617,6 +653,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-35 + @@ -636,6 +676,10 @@ CHIP_UNIT 4 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-36 + @@ -654,6 +698,10 @@ CHIP_UNIT 5 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-37 + @@ -673,6 +721,10 @@ CHIP_UNIT 6 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-38 + @@ -691,6 +743,10 @@ CHIP_UNIT 7 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-39 + @@ -710,6 +766,10 @@ CHIP_UNIT 8 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-40 + @@ -728,6 +788,10 @@ CHIP_UNIT 9 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-41 + @@ -747,6 +811,10 @@ CHIP_UNIT 10 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-42 + @@ -765,6 +833,10 @@ CHIP_UNIT 11 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-43 + @@ -784,6 +856,10 @@ CHIP_UNIT 12 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-44 + @@ -802,6 +878,10 @@ CHIP_UNIT 13 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-45 + @@ -821,6 +901,10 @@ CHIP_UNIT 14 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-46 + @@ -839,6 +923,10 @@ CHIP_UNIT 15 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-47 + @@ -858,6 +946,10 @@ CHIP_UNIT 16 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-48 + @@ -876,6 +968,10 @@ CHIP_UNIT 17 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-49 + @@ -895,6 +991,10 @@ CHIP_UNIT 18 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-50 + @@ -913,6 +1013,10 @@ CHIP_UNIT 19 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-51 + @@ -932,6 +1036,10 @@ CHIP_UNIT 20 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-52 + @@ -950,6 +1058,10 @@ CHIP_UNIT 21 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-53 + @@ -969,6 +1081,10 @@ CHIP_UNIT 22 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-54 + @@ -987,6 +1103,10 @@ CHIP_UNIT 23 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-55 + @@ -1012,6 +1132,10 @@ EI_BUS_TX_MSBSWAP 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1036,6 +1160,10 @@ EI_BUS_TX_MSBSWAP 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1060,6 +1188,10 @@ EI_BUS_TX_MSBSWAP 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1084,6 +1216,10 @@ EI_BUS_TX_MSBSWAP 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1103,6 +1239,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1121,6 +1261,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1140,10 +1284,14 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + - sys0node0proc0mcs1mca3 + sys0node0proc0mcs1mca1 unit-mca-nimbus HUID0x000D0103 @@ -1158,6 +1306,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1177,6 +1329,10 @@ CHIP_UNIT 4 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1195,6 +1351,10 @@ CHIP_UNIT 5 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1214,6 +1374,10 @@ CHIP_UNIT 6 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1232,6 +1396,10 @@ CHIP_UNIT 7 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1251,6 +1419,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-7 + @@ -1269,6 +1441,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-8 + @@ -1288,6 +1464,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-13 + @@ -1306,6 +1486,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-14 + @@ -1324,6 +1508,10 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-15 + @@ -1343,6 +1531,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-13 + @@ -1362,6 +1554,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-14 + @@ -1380,6 +1576,10 @@ CHIP_UNIT 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-14 + @@ -1399,6 +1599,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-15 + @@ -1417,6 +1621,10 @@ CHIP_UNIT 4 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-15 + @@ -1435,6 +1643,10 @@ CHIP_UNIT 5 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-15 + @@ -1454,6 +1666,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-9 + @@ -1472,6 +1688,10 @@ CHIP_UNIT 3 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-12 + @@ -1491,6 +1711,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-5 + @@ -1509,6 +1733,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-5 + - sys0node0proc0xbus0 + sys0node0proc0xbus1 unit-xbus-nimbus HUID0x000E0601 PHYS_PATH - physical:sys-0/node-0/proc-0/xbus-0 + physical:sys-0/node-0/proc-0/xbus-1 AFFINITY_PATH - affinity:sys-0/node-0/proc-0/xbus-0 + affinity:sys-0/node-0/proc-0/xbus-1 CHIP_UNIT - 0 + 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-6 + - sys0node0proc0xbus1 + sys0node0proc0xbus2 unit-xbus-nimbus HUID0x000E0602 PHYS_PATH - physical:sys-0/node-0/proc-0/xbus-1 + physical:sys-0/node-0/proc-0/xbus-2 AFFINITY_PATH - affinity:sys-0/node-0/proc-0/xbus-1 + affinity:sys-0/node-0/proc-0/xbus-2 CHIP_UNIT - 0 + 2 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-6 + @@ -2560,6 +2796,10 @@ CHIP_UNIT 0 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-2 + @@ -2578,6 +2818,10 @@ CHIP_UNIT 1 + + PARENT_PERVASIVE + physical:sys-0/node-0/proc-0/perv-4 + diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index d5a3ad99b..c417bc763 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -50,6 +50,10 @@ use POSIX; use Env; use XML::LibXML; +# Provides object deep copy capability to support virtual +# attribute removal +use Storable 'dclone'; + ################################################################################ # Set PREFERRED_PARSER to XML::Parser. Otherwise it uses XML::SAX which contains # bugs that result in XML parse errors that can be fixed by adjusting white- @@ -144,10 +148,14 @@ use constant PARENT_BY_CONTAINMENT => "ParentByContainment"; use constant CHILD_BY_CONTAINMENT => "ChildByContainment"; use constant PARENT_BY_AFFINITY => "ParentByAffinity"; use constant CHILD_BY_AFFINITY => "ChildByAffinity"; +use constant PERVASIVE_CHILD => "PervasiveChild"; +use constant PARENT_PERVASIVE => "ParentPervasive"; my @associationTypes = ( PARENT_BY_CONTAINMENT, - CHILD_BY_CONTAINMENT, PARENT_BY_AFFINITY, CHILD_BY_AFFINITY ); + CHILD_BY_CONTAINMENT, PARENT_BY_AFFINITY, CHILD_BY_AFFINITY, + PERVASIVE_CHILD, PARENT_PERVASIVE ); # Constants for attribute names (minus ATTR_ prefix) +use constant ATTR_PARENT_PERVASIVE => "PARENT_PERVASIVE"; use constant ATTR_PHYS_PATH => "PHYS_PATH"; use constant ATTR_AFFINITY_PATH => "AFFINITY_PATH"; use constant ATTR_UNKNOWN => "UnknownAttributeName"; @@ -175,9 +183,11 @@ use Digest::MD5 qw(md5_hex); # Until full machine parseable workbook parsing splits out all the input files, # use the intermediate representation containing the full host boot model. # Aborts application if file name not found. -my $attributes = $xml->XMLin($cfgHbXmlFile, +# NOTE: the attribute list initially contains both real and virtual attributes +my $allAttributes = $xml->XMLin($cfgHbXmlFile, forcearray => ['enumerationType','attribute','hwpfToHbAttrMap', 'compileAttribute']); + my $fapiAttributes = {}; if ($cfgFapiAttributesXmlFile ne "") { @@ -188,10 +198,47 @@ if ($cfgFapiAttributesXmlFile ne "") my %Target_t = (); # Perform some sanity validation of the model (so we don't have to later) -validateAttributes($attributes); -validateTargetInstances($attributes); -validateTargetTypes($attributes); -validateTargetTypesExtension($attributes); +# Subject virtual attributes to same sanity checks +validateAttributes($allAttributes); +validateTargetInstances($allAttributes); +validateTargetTypes($allAttributes); +validateTargetTypesExtension($allAttributes); + +# Clone the attributes and strip out any references to virtual +# attributes, then continue forward using the result as the typical +# working attribute set. The original set containing virtual attributes +# will be used for very specific tasks, like computing associations +my $attributes = dclone $allAttributes; +my %virtualAttrIds = (); +for my $attr (reverse 0..((scalar @{$attributes->{attribute}})-1) ) +{ + if(exists $attributes->{attribute}[$attr]->{virtual}) + { + # Found a virtual attribute; note it and remove + $virtualAttrIds{$attributes->{attribute}[$attr]->{id}} = 1; + splice @{$attributes->{attribute}}, $attr, 1; + } +} + +foreach my $targetType (@{$attributes->{targetType}}) +{ + if(exists $targetType->{attribute}) + { + for my $attr (reverse 0..((scalar + @{$targetType->{attribute}})-1)) + { + my $currentAttr = $targetType->{attribute}[$attr]; + if( exists $currentAttr->{id} + && exists $virtualAttrIds{$currentAttr->{id}} ) + { + # A targetType refers to the virtual attribute + # so remove it + splice @{$targetType->{attribute}}, $attr, 1; + } + } + } +} + if($cfgIncludeFspAttributes) { handleTgtPtrAttributesFsp(\$attributes, \%Target_t); @@ -377,7 +424,7 @@ if( !($cfgImgOutputDir =~ "none") ) } #Pass the $addRO_Section_VerPage into the sub rotuine my $Data = generateTargetingImage($cfgVmmConstsFile,$attributes,\%Target_t, - $addRO_Section_VerPage); + $addRO_Section_VerPage,$allAttributes); open(PNOR_TARGETING_FILE,">$cfgImgOutputDir".$cfgImgOutputFile) or fatal ("Targeting image file: \"$cfgImgOutputDir" @@ -486,6 +533,7 @@ sub validateAttributes { $elements{"hwpfToHbAttrMap"} = { required => 0, isscalar => 0}; $elements{"display-name"} = { required => 0, isscalar => 1}; + $elements{"virtual"} = { required => 0, isscalar => 0}; foreach my $attribute (@{$attributes->{attribute}}) { @@ -5245,7 +5293,8 @@ sub serializeAssociations ################################################################################ sub generateTargetingImage { - my($vmmConstsFile, $attributes, $Target_t,$addRO_Section_VerPage) = @_; + my($vmmConstsFile, $attributes,$Target_t,$addRO_Section_VerPage, + $allAttributes) = @_; # 128 MB virtual memory offset between sections my $vmmSectionOffset = 128 * 1024 * 1024; # 128MB @@ -5466,6 +5515,8 @@ sub generateTargetingImage { my $ptrToChildByContainmentAssociations = INVALID_POINTER; my $ptrToParentByAffinityAssociations = INVALID_POINTER; my $ptrToChildByAffinityAssociations = INVALID_POINTER; + my $ptrToPervasiveChildAssociations = INVALID_POINTER; + my $ptrToParentPervasiveAssociations = INVALID_POINTER; my $id = $targetInstance->{id}; $targetAddrHash{$id}{offsetToPtrToParentByContainmentAssociations} = @@ -5484,10 +5535,20 @@ sub generateTargetingImage { $offsetWithinTargets + length $data; $data .= pack8byte($ptrToChildByAffinityAssociations); + $targetAddrHash{$id}{offsetToPtrToPervasiveChildAssociations} = + $offsetWithinTargets + length $data; + $data .= pack8byte($ptrToPervasiveChildAssociations); + + $targetAddrHash{$id}{offsetToPtrToParentPervasiveAssociations} = + $offsetWithinTargets + length $data; + $data .= pack8byte($ptrToParentPervasiveAssociations); + $targetAddrHash{$id}{ParentByContainmentAssociations} = [@NullPtrArray]; $targetAddrHash{$id}{ChildByContainmentAssociations} = [@NullPtrArray]; $targetAddrHash{$id}{ParentByAffinityAssociations} = [@NullPtrArray]; $targetAddrHash{$id}{ChildByAffinityAssociations} = [@NullPtrArray]; + $targetAddrHash{$id}{PervasiveChildAssociations} = [@NullPtrArray]; + $targetAddrHash{$id}{ParentPervasiveAssociations} = [@NullPtrArray]; if($id =~/^sys\d+$/) { @@ -5513,6 +5574,10 @@ sub generateTargetingImage { . "$targetAddrHash{$id}{offsetToPtrToParentByAffinityAssociations}"); ASSOC_DBG("Offset within targets to ptr to child affinity list = " . "$targetAddrHash{$id}{offsetToPtrToChildByAffinityAssociations}"); + ASSOC_DBG("Offset within targets to ptr to pervasive child list = " + . "$targetAddrHash{$id}{offsetToPtrToPervasiveChildAssociations}"); + ASSOC_DBG("Offset within targets to ptr to parent pervasive list = " + . "$targetAddrHash{$id}{offsetToPtrToParentPervasiveAssociations}"); $attrAddr += $attributeListTypeHoH{$targetInstance->{type}}{elements} * (length pack8byte(0)); @@ -5529,9 +5594,17 @@ sub generateTargetingImage { my $attributesWritten = 0; my %biosData = (); + # Cache the attribute definitions for all attributes, including virtual my %attributeDefCache = + map { $_->{id} => $_} @{$allAttributes->{attribute}}; + + # Cache separate attribute definitions for all non-virtual attributes + my %attributeDefCacheNoVirtual = map { $_->{id} => $_} @{$attributes->{attribute}}; + # For the main loop, use all attributes including virtual + my $attributeIdEnumerationAll = getAttributeIdEnumeration($allAttributes); + foreach my $targetInstance (@targetsAoH) { my $data; @@ -5541,7 +5614,8 @@ sub generateTargetingImage { # Ensure consistent ordering of attributes for each target type # Get the attribute list associated with each target type #@TODO Attributes must eventually be ordered correctly for code update - getTargetAttributes($targetInstance->{type}, $attributes,\%attrhash); + # Use all attributes including virtual for association processing + getTargetAttributes($targetInstance->{type}, $allAttributes,\%attrhash); # Update hash with any per-instance overrides, but only if that # attribute has already been defined @@ -5574,10 +5648,11 @@ sub generateTargetingImage { (keys %attrhash) ) { - # Save each target's physical + affinity path for association - # processing later on + # Save each target's physical + affinity + parent pervasive + # path for association processing later on if( ($attributeId eq ATTR_PHYS_PATH) - || ($attributeId eq ATTR_AFFINITY_PATH) ) + || ($attributeId eq ATTR_AFFINITY_PATH) + || ($attributeId eq ATTR_PARENT_PERVASIVE)) { $targetAddrHash{$targetInstance->{id}}{$attributeId} = $attrhash{$attributeId}->{default}; @@ -5598,7 +5673,7 @@ sub generateTargetingImage { } my $attrValue = - enumNameToValue($attributeIdEnumeration,$attributeId); + enumNameToValue($attributeIdEnumerationAll,$attributeId); $attrValue = sprintf ("%0x", $attrValue); my $attributeDef = $attributeDefCache{$attributeId}; if (not defined $attributeDef) @@ -5606,6 +5681,12 @@ sub generateTargetingImage { fatal("Attribute $attributeId is not found."); } + # Do not lay down virtual attributes into the binary + if(exists $attributeDef->{virtual}) + { + next + } + my $ifFspOnlyTargetWithCommonAttr = "false"; # Need to separate out the Fsp only target's common attributes if( ($fspTarget) && (!exists $attributeDef->{fspOnly}) && @@ -6014,6 +6095,7 @@ sub generateTargetingImage { { my $phys_attr = ATTR_PHYS_PATH; my $affn_attr = ATTR_AFFINITY_PATH; + my $parent_pervasive = ATTR_PARENT_PERVASIVE; my $phys_path = $targetAddrHash{$id}{$phys_attr}; my $parent_phys_path = substr $phys_path, 0, (rindex $phys_path, "/"); @@ -6021,6 +6103,33 @@ sub generateTargetingImage { my $affn_path = $targetAddrHash{$id}{$affn_attr}; my $parent_affn_path = substr $affn_path, 0, (rindex $affn_path, "/"); + # If this target has an associated pervasive target, create a + # bidirectional relationship between this target and the specified + # pervasive target. This target will point to the pervasive target via + # a "PARENT_PERVASIVE" association, and the pervasive target will + # point to this target via a "PERVASIVE_CHILD" association. + if (defined $targetAddrHash{$id}{$parent_pervasive}) + { + my $parent_pervasive_path = + $targetAddrHash{$id}{$parent_pervasive}; + + if(defined $targetPhysicalPath{$parent_pervasive_path}) + { + my $parent = $targetPhysicalPath{$parent_pervasive_path}; + unshift + @ { $targetAddrHash{$id} + {ParentPervasiveAssociations} }, + $firstTgtPtr + $targetAddrHash{$parent} + {OffsetToTargetWithinTargetList}; + + unshift + @ { $targetAddrHash{$parent} + {PervasiveChildAssociations} }, + $firstTgtPtr + $targetAddrHash{$id} + {OffsetToTargetWithinTargetList}; + } + } + if (defined $targetPhysicalPath{$parent_phys_path}) { my $parent = $targetPhysicalPath{$parent_phys_path}; @@ -6052,6 +6161,7 @@ sub generateTargetingImage { $firstTgtPtr + $targetAddrHash{$id} {OffsetToTargetWithinTargetList}; } + } # Serialize the association lists into a blob @@ -6326,7 +6436,8 @@ sub generateTargetingImage { Bios($cfgBiosXmlFile,$cfgBiosSchemaFile,$cfgBiosOutputFile); $bios->load(); $bios->processBios( - \%attributeDefCache,\$attributes,\%biosData,%targetPhysicalPath); + \%attributeDefCacheNoVirtual,\$attributes, + \%biosData,%targetPhysicalPath); $bios->export(); } -- cgit v1.2.3