From c16b08724607d021f9d1b2a90cb7480ccdb5ddaa Mon Sep 17 00:00:00 2001 From: Dean Sanner Date: Mon, 27 Jan 2020 13:09:07 -0600 Subject: [PATCH] Update HDAT flags to indicate memory dump On all OpenPOWER MPIPLs there is a memory dump present. Update HDAT flags to inidicate so Change-Id: I3cc124a7c041c96d6c1b7af960271f149d7e1719 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90637 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Jayashankar Padath Reviewed-by: Daniel M Crowell --- src/usr/hdat/hdatiplparms.C | 25 +++++++++++++++++++++---- src/usr/hdat/hdatiplparms.H | 34 ++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/src/usr/hdat/hdatiplparms.C b/src/usr/hdat/hdatiplparms.C index c0b24e49d30..8c991f54871 100755 --- a/src/usr/hdat/hdatiplparms.C +++ b/src/usr/hdat/hdatiplparms.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2019 */ +/* Contributors Listed Below - COPYRIGHT 2016,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -966,7 +966,6 @@ void hdatGetMnfgFlags(hdatManf_t &o_hdatManfFlags) */ void hdatGetPlatformDumpData(hdatDump_t &o_hdatDump) { - o_hdatDump.hdatReserved2 = 0; o_hdatDump.hdatHypDumpPolicy = 0; memset(o_hdatDump.hdatReserved3, 0 , sizeof(o_hdatDump.hdatReserved3)); @@ -974,9 +973,27 @@ void hdatGetPlatformDumpData(hdatDump_t &o_hdatDump) o_hdatDump.hdatActHdwSize = 0; o_hdatDump.hdatMaxSpSize = 0; - o_hdatDump.hdatFlags = 0; + o_hdatDump.hdatFlags = 0x0; + + //For the current OpenPOWER P9 systems (where hostboot + // builds the HDAT) anytime we do an MPIPL there + //will a memory dump. Use the HDAT flags to indicate this + //Note that in the future there will be MPIPLs that + //are not dumps -- but will deal with that when the function + //has been added + // flags - set hdatRptPending, hdatMemDumpExists, hdatMemDumpReq: + TargetService& l_targetService = targetService(); + Target* l_sys = nullptr; + l_targetService.getTopLevelTarget(l_sys); + if(l_sys->getAttr()) + { + o_hdatDump.hdatRptPending = 0x1; + o_hdatDump.hdatMemDumpExists = 0x1; + o_hdatDump.hdatMemDumpReq = 0x1; + } + o_hdatDump.hdatDumpId = 0; - o_hdatDump.hdatActPlatformDumpSize = 0; + o_hdatDump.hdatActPlatformDumpSize = 0; // PHYP/OPAL can query from MDRT o_hdatDump.hdatPlid = 0; } diff --git a/src/usr/hdat/hdatiplparms.H b/src/usr/hdat/hdatiplparms.H index 7e7380e9364..a70b66f2fac 100755 --- a/src/usr/hdat/hdatiplparms.H +++ b/src/usr/hdat/hdatiplparms.H @@ -191,21 +191,27 @@ struct hdatIplSpPvt_t */ struct hdatDump_t { - union {uint16_t hdatFlags; // word view unioned with bit view - uint16_t hdatRptPending : 1, // 1 = A dump exists and is - // waiting to be extracted - hdatHdwDumpExists : 1, // 1 = Hardware dump exists - hdatMemDumpExists : 1, // 1 = Memory dump exists - hdatHdwDumpErrs : 1, // 1 = Errors occurred during - // hardware dump collection - hdatMemDumpErrs : 1, // 1 = Errors occurred during + union + { + uint16_t hdatFlags; // word view unioned with bit view + struct + { + uint16_t hdatRptPending : 1; // 1 = A dump exists and is + // waiting to be extracted + uint16_t hdatHdwDumpExists : 1; // 1 = Hardware dump exists + uint16_t hdatMemDumpExists : 1; // 1 = Memory dump exists + uint16_t hdatHdwDumpErrs : 1; // 1 = Errors occurred during + // hardware dump collection + uint16_t hdatMemDumpErrs : 1; // 1 = Errors occurred during // memory dump collection - hdatHdwDumpReq : 1, // 1 = Hardware dump requested - hdatMemDumpReq : 1, // 1 = Memory dump requested - hdatUserReq : 1, // 1 = User requested the dump - hdatErrReq : 1, // 1 = Hardware or software - // error caused the dump - hdatReserved1 : 7;}; // Reserved for future use + uint16_t hdatHdwDumpReq : 1; // 1 = Hardware dump requested + uint16_t hdatMemDumpReq : 1; // 1 = Memory dump requested + uint16_t hdatUserReq : 1; // 1 = User requested the dump + uint16_t hdatErrReq : 1; // 1 = Hardware or software + // error caused the dump + uint16_t hdatReserved1 : 7; // Reserved for future use + } PACKED; + }; uint8_t hdatReserved2; uint8_t hdatHypDumpPolicy; uint32_t hdatDumpId;