diff mbox

[1/4] Add fwts annotations for critical errors

Message ID 1466411300-10047-1-git-send-email-stewart@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Stewart Smith June 20, 2016, 8:28 a.m. UTC
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 core/hostservices.c | 8 ++++++++
 core/opal.c         | 5 +++++
 core/utils.c        | 7 +++++++
 3 files changed, 20 insertions(+)
diff mbox

Patch

diff --git a/core/hostservices.c b/core/hostservices.c
index 672b57f883cf..6aea670943ae 100644
--- a/core/hostservices.c
+++ b/core/hostservices.c
@@ -238,6 +238,10 @@  static void hservice_mark(void)
 
 static void hservice_assert(void)
 {
+	/**
+	 * @fwts-label HBRTassert
+	 * @fwts-advice HBRT triggered assert: you need to debug HBRT
+	 */
 	prlog(PR_EMERG, "HBRT: Assertion from hostservices\n");
 	abort();
 }
@@ -488,6 +492,10 @@  static int hservice_lid_load(uint32_t lid, void **buf, size_t *len)
 	prlog(PR_INFO, "HBRT: Lid load request for 0x%08x\n", lid);
 
 	if (list_empty(&hbrt_lid_list))	{ /* Should not happen */
+		/**
+		 * @fwts-label HBRTlidLoadFail
+		 * @fwts-advice Firmware should have aborted boot
+		 */
 		prlog(PR_CRIT, "HBRT: LID Load failed\n");
 		abort();
 	}
diff --git a/core/opal.c b/core/opal.c
index b6411f0c9b06..a9d3c41e4cd3 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -269,6 +269,11 @@  void opal_del_poller(void (*poller)(void *data))
 	 * if anybody uses it, print a warning and leak the entry, don't
 	 * free it.
 	 */
+	/**
+	 * @fwts-label UnsupportedOPALdelpoller
+	 * @fwts-advice Currently removing a poller is DANGEROUS and
+	 * MUST NOT be done in production firmware.
+	 */
 	prlog(PR_ALERT, "WARNING: Unsupported opal_del_poller."
 	      " Interesting locking issues, don't call this.\n");
 
diff --git a/core/utils.c b/core/utils.c
index 4bb89df06f63..d21881efed9b 100644
--- a/core/utils.c
+++ b/core/utils.c
@@ -27,6 +27,13 @@  unsigned long __stack_chk_guard = 0xdeadf00dbaad300dULL;
 
 void __noreturn assert_fail(const char *msg)
 {
+	/**
+	 * @fwts-label FailedAssert
+	 * @fwts-advice OPAL hit an assert(). During normal usage (even
+	 * testing) we should never hit an assert. There are other code
+	 * paths for controlled shutdown/panic in the event of catastrophic
+	 * errors.
+	 */
 	prlog(PR_EMERG, "Assert fail: %s\n", msg);
 	_abort(msg);
 }