From patchwork Mon Jun 20 08:28:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 637871 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rY3sp22lZz9sBm for ; Mon, 20 Jun 2016 18:28:46 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rY3sp1DSczDqCr for ; Mon, 20 Jun 2016 18:28:46 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rY3sY0bLpzDq60 for ; Mon, 20 Jun 2016 18:28:32 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5K8Nskc070750 for ; Mon, 20 Jun 2016 04:28:30 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 23n1ku8m7t-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Jun 2016 04:28:30 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Jun 2016 04:28:29 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Jun 2016 04:28:28 -0400 X-IBM-Helo: d01dlp01.pok.ibm.com X-IBM-MailFrom: stewart@linux.vnet.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id DE6AA38C803B for ; Mon, 20 Jun 2016 04:28:27 -0400 (EDT) Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5K8STcd44171428; Mon, 20 Jun 2016 08:28:29 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9281AC040; Mon, 20 Jun 2016 04:28:27 -0400 (EDT) Received: from birb.localdomain (unknown [9.83.5.130]) by b01ledav006.gho.pok.ibm.com (Postfix) with SMTP id E77A5AC03C; Mon, 20 Jun 2016 04:28:26 -0400 (EDT) Received: from ka1.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by birb.localdomain (Postfix) with ESMTP id 9B445229EAB0; Mon, 20 Jun 2016 18:28:21 +1000 (AEST) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Mon, 20 Jun 2016 18:28:17 +1000 X-Mailer: git-send-email 2.1.4 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062008-0056-0000-0000-000000914515 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062008-0057-0000-0000-000004AAAABC Message-Id: <1466411300-10047-1-git-send-email-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-20_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606200101 Subject: [Skiboot] [PATCH 1/4] Add fwts annotations for critical errors X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Stewart Smith --- core/hostservices.c | 8 ++++++++ core/opal.c | 5 +++++ core/utils.c | 7 +++++++ 3 files changed, 20 insertions(+) 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); }