diff options
Diffstat (limited to 'src/include/usr/errl')
-rw-r--r-- | src/include/usr/errl/errlentry.H | 18 | ||||
-rw-r--r-- | src/include/usr/errl/errlmanager.H | 71 | ||||
-rw-r--r-- | src/include/usr/errl/errludattribute.H | 87 | ||||
-rw-r--r-- | src/include/usr/errl/errludprintk.H | 6 |
4 files changed, 171 insertions, 11 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H index a41cb7bcf..905203a9e 100644 --- a/src/include/usr/errl/errlentry.H +++ b/src/include/usr/errl/errlentry.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2019 */ +/* Contributors Listed Below - COPYRIGHT 2011,2020 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -860,17 +860,15 @@ private: */ void addVersionInfo(void); -#ifdef CONFIG_BMC_IPMI /** - * @brief called by addHwCallout to retrieve the serial and part number - * from the current target. If the current target does not contain - * ATTR_PART_NUMBER or ATTR_SERIAL_NUMBER, find the first parent that does - * and adds the attribute to the error log. + * @brief called by addHwCallout to retrieve various pieces of card + * and/or chip data, e.g. part number, serial number, ecid. * * @param[in] i_target The target to get the numbers for */ - void addPartAndSerialNumbersToErrLog(const TARGETING::Target * i_target); + void addPartIdInfoToErrLog(const TARGETING::Target * i_target); +#ifdef CONFIG_BMC_IPMI /** * @brief called by addHwCallout to retrieve the FRU ID and sensor ID * from the current target. If the current target does not contain @@ -1146,4 +1144,10 @@ inline bool ErrlEntry::getDoHbDump() */ #define ERRL_GETEID_SAFE(errhdl) (errhdl == NULL ? 0 : errhdl->eid()) +// These defines allow standard logging of error information in traces +#define TRACE_ERR_FMT "Error info: PLID=0x%08X, EID=0x%08X, Reason=0x%04X. " + +#define TRACE_ERR_ARGS(pError) \ + ERRL_GETPLID_SAFE(pError), ERRL_GETEID_SAFE(pError), ERRL_GETRC_SAFE(pError) + #endif //ERRLENTRY_H diff --git a/src/include/usr/errl/errlmanager.H b/src/include/usr/errl/errlmanager.H index f7407d8c4..cfd5ee21d 100644 --- a/src/include/usr/errl/errlmanager.H +++ b/src/include/usr/errl/errlmanager.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -35,7 +35,6 @@ /*****************************************************************************/ // I n c l u d e s /*****************************************************************************/ -#include <config.h> #include <util/singleton.H> #include <errl/errlentry.H> #include <errldisplay/errldisplay.H> @@ -82,6 +81,32 @@ void errlCommit(errlHndl_t& io_err, compId_t i_committerComp ); uint8_t getHiddenLogsEnable(); /** + * @brief Returns the cached VERSION partition, if any. Makes a call to + * ErrlManager::getCachedVersionPartition + * @return uint8_t* The pointer to the binary contents of the VERSION + * partition; nullptr will be returned if VERSION hasn't been + * cached yet of if there was an error during caching + */ +const uint8_t* getCachedVersionPartition(); + +/** + * @brief Returns the size of the cached VERSION partition. Makes a call + * to ErrlManager::getCachedVersionPartitionSize + * @return size_t The size of the cached VERSION partition. A 0 will be + * returned if VERSION hasn't been cached yet or if there was an + * error during caching + */ +size_t getCachedVersionPartitionSize(); + +/* + * @brief Call to ErrlManager to cache the VERSION PNOR partition into an + * internal buffer. + * + * @return errlHndl_t nullptr on success; non-nullptr on error. + */ +errlHndl_t cacheVersionPartition(); + +/** * @brief Global enums used by static errlResourceReady function */ enum errlManagerNeeds @@ -209,6 +234,34 @@ public: */ static bool errlCommittedThisBoot(); + /** + * @brief Returns the cached VERSION partition, if any + * @return uint8_t* The pointer to the binary contents of the VERSION + * partition + */ + const uint8_t* getCachedVersionPartition() const; + + /** + * @brief Returns the size of the cached VERSION partition + * @return size_t The size of the cached VERSION partition + */ + size_t getCachedVersionPartitionSize() const; + + /** + * @brief Cache the VERSION PNOR partition into a member buffer. The + * buffer is dynamically allocated here to hold the contents of the + * partition. If any error occurs during the execution, the buffer + * is deleted and the error is returned. This function is not + * supposed to be called within ErrlManager message handler, since + * the function itself makes synchronous calls to various message + * handlers. Note that once the partition is cached, the cache is + * never purged to make sure all possible error logs receive the + * VERSION field. No-op on FSP systems. + * + * @return errlHndl_t nullptr on success; non-nullptr on error. + */ + errlHndl_t cacheVersionPartition(); + /** * @brief Value to determine what logs are to be skipped. Mirrors @@ -424,6 +477,11 @@ private: bool iv_pnorReadyForErrorLogs; /** + * @brief Indicates if we have processed a shutdown event message + */ + bool iv_recvdShutdownEvent; + + /** * @brief * Pointer to the header that precedes the error log storage buffer * in L3 RAM. This may go away when we adopt PNOR, or else become @@ -634,6 +692,15 @@ private: bool allowCallHomeEselsToBmc(void); #endif + const uint8_t* iv_versionPartitionCache; // The bin contents of the VERSION + // partition; once cached, the + // constents are never removed + + size_t iv_versionPartitionCacheSize; // The size of the VERSION partition + + bool iv_isVersionPartitionCached; // Whether the caching of the VERSION + // partition has been attempted + }; diff --git a/src/include/usr/errl/errludattribute.H b/src/include/usr/errl/errludattribute.H new file mode 100644 index 000000000..8321785cb --- /dev/null +++ b/src/include/usr/errl/errludattribute.H @@ -0,0 +1,87 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/errl/errludattribute.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2019 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef ERRL_UDATTRIBUTE_H +#define ERRL_UDATTRIBUTE_H + +/** + * Defines the classes that allow you to save attribute data to + * an error log. + */ + +#include <errl/errluserdetails.H> + +namespace TARGETING // Forward reference +{ class Target; } + +namespace ERRORLOG +{ +class ErrlUserDetailsAttribute : public ErrlUserDetails { + public: + + /** + * @brief Constructor to add a single attribute + * + * @param i_target Target from whom the attribute is being read + * @param i_attr Attribute id/hash + */ + ErrlUserDetailsAttribute(const TARGETING::Target * i_pTarget, + uint32_t i_attr); + + /** + * @brief Constructor to add no attributes (need to call addData) + * + * @param i_target Target from whom the attribute is being read + */ + ErrlUserDetailsAttribute(const TARGETING::Target * i_pTarget); + + /** + * @brief Add an additional attribute to the log + * + * @param i_attr Attribute id/hash + */ + void addData(uint32_t i_attr); + + + /** + * @brief Destructor + */ + virtual ~ErrlUserDetailsAttribute(); + + private: + + // Disabled + ErrlUserDetailsAttribute(const ErrlUserDetailsAttribute &); + ErrlUserDetailsAttribute & operator=(const ErrlUserDetailsAttribute &); + + // internal function + void dumpAll(); + + const TARGETING::Target * iv_pTarget; + uint32_t iv_dataSize; +}; +} + +#endif //ERRL_UDATTRIBUTE_H diff --git a/src/include/usr/errl/errludprintk.H b/src/include/usr/errl/errludprintk.H index 4d304ff46..629716e68 100644 --- a/src/include/usr/errl/errludprintk.H +++ b/src/include/usr/errl/errludprintk.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2014 */ +/* Contributors Listed Below - COPYRIGHT 2014,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -39,7 +41,7 @@ namespace ERRORLOG class ErrlUserDetailsPrintk : public ErrlUserDetails { public: - enum { DEFAULT_SIZE_BYTES = 256 }; + enum { DEFAULT_SIZE_BYTES = 1280 }; /** @brief Constructor * |