From patchwork Mon Oct 24 06:28:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 685704 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 3t2RFP2v6fz9t14 for ; Mon, 24 Oct 2016 17:28:57 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3t2RFP2Dp0zDvZr for ; Mon, 24 Oct 2016 17:28:57 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3t2RFJ1FB1zDt3M for ; Mon, 24 Oct 2016 17:28:51 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9O6NcoE135564 for ; Mon, 24 Oct 2016 02:28:49 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 2692jqmf6r-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 24 Oct 2016 02:28:49 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Oct 2016 00:28:48 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 24 Oct 2016 00:28:47 -0600 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id C7C0419D8040 for ; Mon, 24 Oct 2016 00:28:11 -0600 (MDT) Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9O6SRpg6881726 for ; Mon, 24 Oct 2016 06:28:46 GMT Received: from localhost (unknown [127.0.0.1]) by IMSVA (Postfix) with SMTP id 4C9E7112067 for ; Mon, 24 Oct 2016 02:28:46 -0400 (EDT) X-IMSS-HAND-OFF-DIRECTIVE: 127.0.0.1:10026 Received: from birb.localdomain (unknown [9.83.7.67]) by b01ledav004.gho.pok.ibm.com (Postfix) with SMTP id 699CC112051; Mon, 24 Oct 2016 02:28:36 -0400 (EDT) Received: from ka1.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by birb.localdomain (Postfix) with ESMTP id A3A60229DB26; Mon, 24 Oct 2016 17:28:30 +1100 (AEDT) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Mon, 24 Oct 2016 17:28:29 +1100 X-Mailer: git-send-email 2.1.4 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102406-0028-0000-0000-000005DEF3C8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005968; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000187; SDB=6.00771959; UDB=6.00370455; IPR=6.00548747; BA=6.00004824; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013086; XFM=3.00000011; UTC=2016-10-24 06:28:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102406-0029-0000-0000-00003043F021 Message-Id: <1477290509-31620-1-git-send-email-stewart@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-23_18:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610240113 Subject: [Skiboot] [PATCH] fast-reboot: disable on FSP code update or unrecoverable HMI X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 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 Reviewed-by: Andrew Donnellan --- core/fast-reboot.c | 18 ++++++++++++++++++ core/hmi.c | 2 ++ hw/fsp/fsp-codeupdate.c | 2 ++ include/skiboot.h | 1 + 4 files changed, 23 insertions(+) diff --git a/core/fast-reboot.c b/core/fast-reboot.c index 66b31824c9eb..7f861b9760cd 100644 --- a/core/fast-reboot.c +++ b/core/fast-reboot.c @@ -281,6 +281,16 @@ static bool fast_reset_p8(void) extern void *fdt; extern struct lock capi_lock; +static const char *fast_reboot_disabled = NULL; +static struct lock fast_reboot_disabled_lock = LOCK_UNLOCKED; + +void disable_fast_reboot(const char *reason) +{ + lock(&fast_reboot_disabled_lock); + fast_reboot_disabled = reason; + unlock(&fast_reboot_disabled_lock); +} + void fast_reboot(void) { bool success; @@ -298,6 +308,14 @@ void fast_reboot(void) return; } + lock(&fast_reboot_disabled_lock); + if (fast_reboot_disabled) { + prlog(PR_DEBUG, "RESET: Fast reboot disabled because %s\n", + fast_reboot_disabled); + return; + } + unlock(&fast_reboot_disabled_lock); + lock(&capi_lock); for_each_chip(chip) { if (chip->capp_phb3_attached_mask) { diff --git a/core/hmi.c b/core/hmi.c index 69403c6db350..6fe060dc7c56 100644 --- a/core/hmi.c +++ b/core/hmi.c @@ -836,6 +836,8 @@ int handle_hmi_exception(uint64_t hmer, struct OpalHMIEvent *hmi_evt) } } + if (recover == 0) + disable_fast_reboot("Unrecoverable HMI"); /* * HMER bits are sticky, once set to 1 they remain set to 1 until * they are set to 0. Reset the error source bit to 0, otherwise diff --git a/hw/fsp/fsp-codeupdate.c b/hw/fsp/fsp-codeupdate.c index 2263bf36dcc8..ae1c4b6c5a42 100644 --- a/hw/fsp/fsp-codeupdate.c +++ b/hw/fsp/fsp-codeupdate.c @@ -1126,6 +1126,8 @@ static int64_t fsp_opal_update_flash(struct opal_sg_list *list) struct opal_sg_entry *entry; int length, num_entries, result = 0, rc = OPAL_PARAMETER; + disable_fast_reboot("FSP Code Update"); + /* Ensure that the sg list honors our alignment requirements */ rc = validate_sglist(list); if (rc) { diff --git a/include/skiboot.h b/include/skiboot.h index b50868d2d8c7..45f230a37635 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -190,6 +190,7 @@ extern unsigned long get_symbol(unsigned long addr, char **sym, char **sym_end); /* Fast reboot support */ +extern void disable_fast_reboot(const char *reason); extern void fast_reboot(void); extern void __noreturn __secondary_cpu_entry(void); extern void __noreturn load_and_boot_kernel(bool is_reboot);