summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorIlya Smirnov <ismirno@us.ibm.com>2019-07-29 09:54:40 -0500
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-08-29 16:34:42 -0500
commit3db6c1479f40d745525e3414bdce95d5f280a660 (patch)
tree5fe237ba93c74fc36e502dd25ec373717058cb05 /src/include
parentc4df5e9188e2e6faed08eb10de3386673b64adfa (diff)
downloadtalos-hostboot-3db6c1479f40d745525e3414bdce95d5f280a660.tar.gz
talos-hostboot-3db6c1479f40d745525e3414bdce95d5f280a660.zip
Cache VERSION Partition
This commit adds logic to cache the VERSION partition so that errl commit function is able to use the cached data instead of sending messages to SPnorRP queue. Said messages also cause deadlocks if secureboot verifications fail, since the code attempts to send a synch message to the SPnorRP queue while it's handling another synch message. These changes only impact OP systems and code paths. Change-Id: I9eeb05878d98fb2891fe76adc06ad376edc77fbe CQ: SW465038 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82304 Reviewed-by: Nicholas E Bofferding <bofferdn@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Glenn Miles <milesg@ibm.com> Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/usr/errl/errlmanager.H65
1 files changed, 64 insertions, 1 deletions
diff --git a/src/include/usr/errl/errlmanager.H b/src/include/usr/errl/errlmanager.H
index f7407d8c4..5bd2aa196 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. */
/* */
@@ -82,6 +82,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 +235,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
@@ -634,6 +688,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
+
};
OpenPOWER on IntegriCloud