diff options
-rw-r--r-- | src/include/usr/runtime/runtime.H | 7 | ||||
-rw-r--r-- | src/include/usr/sbeio/sbeioif.H | 7 | ||||
-rw-r--r-- | src/include/usr/targeting/attrrp.H | 8 | ||||
-rw-r--r-- | src/usr/dump/dumpCollect.C | 5 | ||||
-rw-r--r-- | src/usr/runtime/hdatservice.C | 27 | ||||
-rw-r--r-- | src/usr/runtime/hdatservice.H | 17 | ||||
-rwxr-xr-x | src/usr/targeting/attrrp.C | 19 |
7 files changed, 87 insertions, 3 deletions
diff --git a/src/include/usr/runtime/runtime.H b/src/include/usr/runtime/runtime.H index c508cc13f..9b8112a2b 100644 --- a/src/include/usr/runtime/runtime.H +++ b/src/include/usr/runtime/runtime.H @@ -299,6 +299,13 @@ void saveActualCount( SectionId i_id, errlHndl_t writeActualCount( SectionId i_id ); /** + * @brief Use relocated payload base address + * + * @param[in] val 'true' for post dump data collection + */ +void useRelocatedPayloadAddr(bool val); + +/** * @brief Retrieve and log FFDC data relevant to a given section of * host data memory * diff --git a/src/include/usr/sbeio/sbeioif.H b/src/include/usr/sbeio/sbeioif.H index 12881c939..3e68599f3 100644 --- a/src/include/usr/sbeio/sbeioif.H +++ b/src/include/usr/sbeio/sbeioif.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2017 */ +/* Contributors Listed Below - COPYRIGHT 2013,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -31,8 +31,9 @@ namespace SBEIO { enum KeyAddrStashKeys { - RSV_MEM_ATTR_ADDR = 0x01, //Start at non-zero - HYPERVISOR_HRMOR = 0x02, + RSV_MEM_ATTR_ADDR = 0x01, //Start at non-zero + HYPERVISOR_HRMOR = 0x02, + RELOC_PAYLOAD_ADDR = 0x03, //On SBE side struct is defaulted so that //Keys are 0xFF and Vals are 0xFFFFFFFFFFFFFFFF //So a key w/ FF means its empty or at its default val diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H index cb7e9e35e..0c6f1aa8d 100644 --- a/src/include/usr/targeting/attrrp.H +++ b/src/include/usr/targeting/attrrp.H @@ -159,6 +159,14 @@ class AttrRP #endif /** + * @brief Returns relocated absolute address of payload + * + * @return phys addr of payload + * + */ + static uint64_t getHbDataRelocPayloadAddr(); + + /** * @brief Returns base address of the RO section containing the * targets * diff --git a/src/usr/dump/dumpCollect.C b/src/usr/dump/dumpCollect.C index 91c7d1acf..6c3bf8ac6 100644 --- a/src/usr/dump/dumpCollect.C +++ b/src/usr/dump/dumpCollect.C @@ -60,6 +60,9 @@ errlHndl_t doDumpCollect(void) { TRACFCOMP(g_trac_dump, "doDumpCollect - start "); + // Use relocated payload base to get MDST, MDDT, MDRT details + RUNTIME::useRelocatedPayloadAddr(true); + errlHndl_t l_err = NULL; // Table Sizes @@ -100,6 +103,8 @@ errlHndl_t doDumpCollect(void) }while (0); + RUNTIME::useRelocatedPayloadAddr(false); + return (l_err); } diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C index 4fd752653..88e80e9a0 100644 --- a/src/usr/runtime/hdatservice.C +++ b/src/usr/runtime/hdatservice.C @@ -38,6 +38,7 @@ #include "hdatservice.H" #include "errlud_hdat.H" #include <errl/errlmanager.H> +#include <targeting/attrrp.H> //#define REAL_HDAT_TEST @@ -316,6 +317,7 @@ hdatService::hdatService(void) :iv_spiraL(NULL) ,iv_spiraH(NULL) ,iv_spiraS(NULL) +,iv_useRelocatedPayload(false) { for( uint8_t id = static_cast<uint8_t>(RUNTIME::FIRST_SECTION); id <= static_cast<uint8_t>(RUNTIME::LAST_SECTION); @@ -492,6 +494,26 @@ errlHndl_t hdatService::loadHostData(void) uint64_t hdat_start = payload_base*MEGABYTE; uint64_t hdat_size = HDAT_MEM_SIZE; + // OPAL relocates itself after boot. Hence get relocated payload + // address. If relocated address not available then use normal + // base address (as OPAL would have crashed during early init). + if (iv_useRelocatedPayload == true && + TARGETING::PAYLOAD_KIND_SAPPHIRE == payload_kind) + { + uint64_t reloc_base; + + reloc_base = TARGETING::AttrRP::getHbDataRelocPayloadAddr(); + if (reloc_base != 0) + { + hdat_start = reloc_base; + TRACFCOMP( g_trac_runtime, "Relocated payload base =%p", hdat_start); + } + else + { + TRACFCOMP( g_trac_runtime, "No relocated payload base found, continuing on"); + } + } + #ifdef REAL_HDAT_TEST hdat_start = 256*MEGABYTE; #endif @@ -1745,6 +1767,11 @@ errlHndl_t writeActualCount( SectionId i_id ) return Singleton<hdatService>::instance().writeActualCount(i_id); } +void useRelocatedPayloadAddr(bool val) +{ + return Singleton<hdatService>::instance().useRelocatedPayloadAddr(val); +} + /** * @brief Retrieve and log FFDC data relevant to a given section of * host data memory diff --git a/src/usr/runtime/hdatservice.H b/src/usr/runtime/hdatservice.H index 9e3be107b..44ff12a58 100644 --- a/src/usr/runtime/hdatservice.H +++ b/src/usr/runtime/hdatservice.H @@ -303,6 +303,12 @@ namespace RUNTIME uint16_t iv_actuals[RUNTIME::LAST_SECTION+1]; /** + * Used to identify whether to use relocated payload base address + * or normal address. + */ + bool iv_useRelocatedPayload; + + /** * Dummy value for unassigned actual */ enum { @@ -339,6 +345,17 @@ namespace RUNTIME } return l_err; } + + /** + * @brief Use relocated payload base address + * + * @param[in] val 'true' for post dump data collection + * + */ + void useRelocatedPayloadAddr(bool val) + { + iv_useRelocatedPayload = val; + } }; }; diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C index a8978010d..defe5ceed 100755 --- a/src/usr/targeting/attrrp.C +++ b/src/usr/targeting/attrrp.C @@ -361,6 +361,25 @@ namespace TARGETING return l_toc_addr; } + uint64_t AttrRP::getHbDataRelocPayloadAddr() + { + uint64_t payload_addr = 0; + Bootloader::keyAddrPair_t l_keyAddrPairs = + g_BlToHbDataManager.getKeyAddrPairs(); + + for (uint8_t keyIndex = 0; keyIndex < MAX_ROW_COUNT; keyIndex++) + { + if(l_keyAddrPairs.key[keyIndex] == SBEIO::RELOC_PAYLOAD_ADDR) + { + payload_addr = l_keyAddrPairs.addr[keyIndex]; + break; + } + } + + // return relocated payload physical address + return payload_addr; + } + errlHndl_t AttrRP::parseAttrSectHeader() { errlHndl_t l_errl = NULL; |