summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2/test
diff options
context:
space:
mode:
authorBrian Stegmiller <bjs@us.ibm.com>2017-12-05 16:01:44 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-12-08 11:28:58 -0500
commit1eba8f47f718aa44800ed5be0f70b1cf795298c9 (patch)
tree70da207315086f33eb35c1791b5a865bf676c6e2 /src/usr/fapi2/test
parent18f9c896aa1e4b348d3ae2ed4ff641b91b36cd67 (diff)
downloadtalos-hostboot-1eba8f47f718aa44800ed5be0f70b1cf795298c9.tar.gz
talos-hostboot-1eba8f47f718aa44800ed5be0f70b1cf795298c9.zip
Avoid assert on invalid target types for PRD and HWP PLID association
Change-Id: I576559dba463bdc884e7929f731e5a098c6f7749 CQ:SW409720 Backport: release-op910 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50535 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/test')
-rw-r--r--src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C198
1 files changed, 197 insertions, 1 deletions
diff --git a/src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C b/src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C
index 4c62d2f03..6e4b7fff8 100644
--- a/src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C
+++ b/src/usr/fapi2/test/fapi2VerifyPrdAttrTest.C
@@ -30,6 +30,7 @@
#include <rcSupport.H>
#include <attributeenums.H>
#include "fapi2TestUtils.H"
+#include "diag/attn/attn.H"
#include <utils.H>
@@ -65,6 +66,10 @@ uint32_t verifyHwpPrdAssociaton()
TARGETING::Target * l_masterProc;
TARGETING::targetService().masterProcChipTargetHandle(l_masterProc);
+
+ // ==============================================================
+ // PROCESSOR TARGET should be good
+ // ==============================================================
// Using masterProc target as FAPI core target for test
Target<fapi2::TARGET_TYPE_CORE> fapi2_coreTarget(l_masterProc);
// We have to pass a FAPI RC so make one up
@@ -89,7 +94,198 @@ uint32_t verifyHwpPrdAssociaton()
TS_TRACE(" verifyHwpPrdAssociation GOOD on CORE");
}
- FAPI_INF("...verifyHwpPrdAssociation completed: PLID:%08X", l_plid);
+ FAPI_INF("...verifyHwpPrdAssociation BaseDone: PLID:%08X", l_plid);
+
+
+ // ==============================================================
+ // Verify MCA target is good (we expect them)
+ // ==============================================================
+ TargetHandleList l_mcaList;
+ getChildAffinityTargets( l_mcaList, l_masterProc,
+ TARGETING::CLASS_UNIT,
+ TARGETING::TYPE_MCA );
+
+ if (l_mcaList.size() >= 1)
+ {
+ FAPI_INF("...verifyHwpPrdAssociation MCA :%d",
+ l_mcaList.size());
+
+ // Using masterProc target as FAPI core target for test
+ Target<fapi2::TARGET_TYPE_CORE> fapi2_mcaTarget(l_mcaList[0]);
+ // We have to pass a FAPI RC so make one up
+ l_fapiRc = verifyPrd_get_fapi2_error();
+
+ // Init the attribute so we know if it changes
+ l_mcaList[0]->setAttr<TARGETING::ATTR_PRD_HWP_PLID>( 0x87654321 );
+
+ // Create/commit elog associated with PRD PLID attribute
+ fapi2::log_related_error( fapi2_mcaTarget, l_fapiRc );
+
+ // Verify that PLID attribute changed
+ l_plid = l_mcaList[0]->getAttr<TARGETING::ATTR_PRD_HWP_PLID>();
+
+ if (0x87654321 == l_plid)
+ { // PLID did not change so routine failed somehow
+ TS_FAIL(" verifyHwpPrdAssociation MCA No PLID change:%08X",
+ l_plid);
+ l_rc = 1;
+ }
+ else
+ { // PLID was altered, so that is good
+ TS_TRACE(" verifyHwpPrdAssociation GOOD on MCA");
+ }
+
+ FAPI_INF("...verifyHwpPrdAssociation MCA done: PLID %08X", l_plid);
+
+ // ==============================================================
+ // HW procedures might pass DIMM so verify that works
+ // ==============================================================
+ TargetHandleList l_dimmList;
+ getChildAffinityTargets( l_dimmList, l_mcaList[0],
+ TARGETING::CLASS_NA,
+ TARGETING::TYPE_DIMM );
+
+ if (l_dimmList.size() >= 1)
+ {
+ FAPI_INF("...verifyHwpPrdAssociation DIMM:%d",
+ l_dimmList.size() );
+
+ // Using masterProc target as FAPI core target for test
+ Target<fapi2::TARGET_TYPE_CORE> fapi2_dimmTarget(l_dimmList[0]);
+ // We have to pass a FAPI RC so make one up
+ l_fapiRc = verifyPrd_get_fapi2_error();
+
+ // Init the attribute so we know if it changes
+ l_mcaList[0]->setAttr<TARGETING::ATTR_PRD_HWP_PLID>( 0x33333333 );
+
+ // Create/commit elog associated with PRD PLID attribute
+ fapi2::log_related_error( fapi2_dimmTarget, l_fapiRc );
+
+ // Verify that PLID attribute changed
+ l_plid = l_mcaList[0]->getAttr<TARGETING::ATTR_PRD_HWP_PLID>();
+
+ if (0x33333333 == l_plid)
+ { // PLID did not change so routine failed somehow
+ TS_FAIL(" verifyHwpPrdAssociation DIMM No PLID change:%08X",
+ l_plid);
+ l_rc = 1;
+ }
+ else
+ { // PLID was altered, so that is good
+ TS_TRACE(" verifyHwpPrdAssociation GOOD on DIMM");
+ }
+
+ FAPI_INF("...verifyHwpPrdAssociation DIMM done: PLID %08X", l_plid);
+ } // end if any DIMMs
+
+ } // end if any MCAs
+
+
+ // ==============================================================
+ // Verify target we don't do anything with ... TYPE_EQ
+ // ==============================================================
+ TargetHandleList l_eqList;
+ getChildAffinityTargets( l_eqList, l_masterProc,
+ TARGETING::CLASS_UNIT,
+ TARGETING::TYPE_EQ );
+
+ if (l_eqList.size() >= 1)
+ {
+ FAPI_INF("...verifyHwpPrdAssociation EQ :%d",
+ l_eqList.size());
+
+ // Using masterProc target as FAPI core target for test
+ Target<fapi2::TARGET_TYPE_CORE> fapi2_eqTarget(l_eqList[0]);
+ // We have to pass a FAPI RC so make one up
+ l_fapiRc = verifyPrd_get_fapi2_error();
+
+
+ // We don't have an attribute for this target. Hence,
+ // we can't write/read this attribute, but I can at
+ // least run thru the code to ensure it doesn't crash
+
+ // Create/commit elog associated with PRD PLID attribute
+ fapi2::log_related_error( fapi2_eqTarget, l_fapiRc );
+
+ // If we make it here, we didn't crash with bad target
+ TS_TRACE(" verifyHwpPrdAssociation GOOD on EQ (ignored)");
+
+ FAPI_INF("...verifyHwpPrdAssociation EQ done");
+
+ } // end if any EQ units
+
+
+#if 0
+
+/* Bit of a hassle to try calling ATTN code here ...
+ but would be nice to do final verification.
+
+ fapi2Test.mk
+ but this pulls in more and more of attn code
+
+ EXTRAINCDIR += ${ROOTPATH}/src/usr/diag/attn/
+ EXTRAINCDIR += ${ROOTPATH}/src/usr/diag/attn/common
+ EXTRAINCDIR += ${ROOTPATH}/src/usr/diag/attn/ipl
+ EXTRAINCDIR += ${ROOTPATH}/src/include/usr/diag/
+
+ OBJS += attn.o attnsvc.o
+*/
+
+ // ==============================================================
+ // We should have the PLID set on a PROC and MCA target by now
+ // so let's see if ATTN code will clear them and return an elog.
+ // ==============================================================
+
+ errlHndl_t l_attnLog = ATTN::checkForIplAttentions();
+
+ if (NULL != l_attnLog)
+ { // we got elog as expected
+ TS_TRACE(" verifyHwpPrdAssociation chkIplAttns GOOD with ELOG");
+ }
+ else
+ { // Why did we not get ELOG? Something wrong here
+ TS_FAIL(" verifyHwpPrdAssociation chkIplAttns FAIL -no ELOG");
+ }
+
+ // ----------------------------------------------------------
+ // All targets should have been cleared too ... check that
+ // ----------------------------------------------------------
+ // Verify that PROC target PLID attribute was cleared
+ l_plid = l_masterProc->getAttr<TARGETING::ATTR_PRD_HWP_PLID>();
+
+ if (0 != l_plid)
+ { // PLID should have been cleared
+ TS_FAIL(" verifyHwpPrdAssociation PROC PLID not cleared:%08X",
+ l_plid);
+ l_rc = 1;
+ }
+ else
+ { // PLID was altered, so that is good
+ TS_TRACE(" verifyHwpPrdAssociation PROC PLID cleared");
+ }
+
+
+ // Verify that MCA target PLID attribute was cleared
+ if (l_mcaList.size() >= 1)
+ {
+ // Verify that PLID attribute changed
+ l_plid = l_mcaList[0]->getAttr<TARGETING::ATTR_PRD_HWP_PLID>();
+
+ if (0 != l_plid)
+ { // PLID should have been cleared
+ TS_FAIL(" verifyHwpPrdAssociation MCA PLID not cleared:%08X",
+ l_plid);
+ l_rc = 1;
+ }
+ else
+ { // PLID was altered, so that is good
+ TS_TRACE(" verifyHwpPrdAssociation MCA PLID cleared");
+ }
+ } // end if any MCAs to check PLIDs on
+#endif
+
+ // asdf tests here
+ FAPI_INF("verifyHwpPrdAssociation completed");
return l_rc;
}
OpenPOWER on IntegriCloud