From patchwork Wed Aug 4 07:20:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 1513200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=fIQr8yKt; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gfjqg237pz9sT6 for ; Wed, 4 Aug 2021 17:22:23 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Gfjqg1Dcyz3bWW for ; Wed, 4 Aug 2021 17:22:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=fIQr8yKt; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0b-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=fIQr8yKt; dkim-atps=neutral Received: from mx0b-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 4GfjqX1ckGz3cJ8 for ; Wed, 4 Aug 2021 17:22:16 +1000 (AEST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17473m2n020651; Wed, 4 Aug 2021 03:22:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=SB7r159mCxjOgZVP+WJo94TVTKinu0y1TUnn0meVGb4=; b=fIQr8yKtqIOyIxmUGy8q4n3EHfkbLg5KvyYFkDdXormzifLZ+c0s5Uibl99ifDhsAJwj 8nOeDIE8HXUN7OYUvYWUXndYlBo9/nAYxXaTjYRBlmPHXue6dhmiivX8h7d+RM6VV2S3 Et0+SsHATqe3uCH86/WNj7aNdwMMlLT7RIN40G8Al2i4uyJwh9D41SD6YtIpc01Fzjs1 qGeyS1MCYf0Tfpk1Gx21lHty+8XwkzS2phuSllB/n5wWfBh7OiwI4XyTotRwrwG5332u 0sjj8ecOpeUBwmbMF2WIA6V7Mp3/w5a6iHkuZRSScGKYwoI3NLJfqpTxshNuZgjjWHtB Iw== Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3a7b77xkw2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Aug 2021 03:22:13 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1746lnhG012766; Wed, 4 Aug 2021 07:22:11 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04fra.de.ibm.com with ESMTP id 3a4x597unh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Aug 2021 07:22:11 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1747JERF61604264 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Aug 2021 07:19:14 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B8E13AE077; Wed, 4 Aug 2021 07:22:08 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE7D0AE067; Wed, 4 Aug 2021 07:22:07 +0000 (GMT) Received: from hegdevasant.in.ibm.com (unknown [9.85.83.73]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 4 Aug 2021 07:22:07 +0000 (GMT) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Wed, 4 Aug 2021 12:50:42 +0530 Message-Id: <20210804072137.1147875-5-hegdevasant@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210804072137.1147875-1-hegdevasant@linux.vnet.ibm.com> References: <20210804072137.1147875-1-hegdevasant@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 2Ut-edU8GgD-ZTdLECVNO6gMAkWKKl1p X-Proofpoint-ORIG-GUID: 2Ut-edU8GgD-ZTdLECVNO6gMAkWKKl1p X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-04_02:2021-08-03, 2021-08-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108040036 Subject: [Skiboot] [PATCH v2 04/59] p10: Workaround core recovery issue X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Neuling Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" From: Michael Neuling This works around a core recovery issue in P10. The workaround involves the CME polling for a core recovery and performing the recovery procedure itself. For this to happen, the host leaves core recovery off (HID[5]) and then masks the PC system checkstop. This patch does this. Firmware starts skiboot with recovery already off, so we just leave it off for longer and then mask the PC system checkstop. This makes the window longer where a core recovery can cause an xstop but this window is still small and can still only happens on boot. Signed-off-by: Michael Neuling [Added mambo check - Vasant] Signed-off-by: Vasant Hegde --- asm/head.S | 4 ++-- core/init.c | 36 ++++++++++++++++++++++++++++++++++++ include/xscom-p10-regs.h | 2 ++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/asm/head.S b/asm/head.S index f85b0fe29..fa8933b14 100644 --- a/asm/head.S +++ b/asm/head.S @@ -828,9 +828,9 @@ init_shared_sprs: /* HID0: * Boot with PPC_BIT(5) set (dis_recovery). - * Clear bit 5 to enable recovery. + * Leave bit 5 set to disable recovery (due to HW570622) */ - LOAD_IMM64(%r3, 0) + LOAD_IMM64(%r3, PPC_BIT(5)) sync mtspr SPR_HID0,%r3 isync diff --git a/core/init.c b/core/init.c index 65f136daa..0bf4ab269 100644 --- a/core/init.c +++ b/core/init.c @@ -47,6 +47,7 @@ #include #include #include +#include enum proc_gen proc_gen; unsigned int pcie_max_link_speed; @@ -989,6 +990,38 @@ bool verify_romem(void) return true; } +static void mask_pc_system_xstop(void) +{ + struct cpu_thread *cpu; + uint32_t chip_id, core_id; + int rc; + + if (proc_gen != proc_gen_p10) + return; + + if (chip_quirk(QUIRK_MAMBO_CALLOUTS)) + return; + + /* + * On P10 Mask PC system checkstop (bit 28). This is needed + * for HW570622. We keep processor recovery disabled via + * HID[5] and mask the checkstop that it can cause. CME does + * the recovery handling for us. + */ + for_each_cpu(cpu) { + chip_id = cpu->chip_id; + core_id = pir_to_core_id(cpu->pir); + + rc = xscom_write(chip_id, + XSCOM_ADDR_P10_EC(core_id, P10_CORE_FIRMASK_OR), + PPC_BIT(28)); + if (rc) + prerror("Error setting FIR MASK rc:%d on PIR:%x\n", + rc, cpu->pir); + } +} + + /* Called from head.S, thus no prototype. */ void __noreturn __nomcount main_cpu_entry(const void *fdt); @@ -1170,6 +1203,9 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt) if (proc_gen == proc_gen_p9 || proc_gen == proc_gen_p10) cpu_set_ipi_enable(true); + /* Once all CPU are up apply this workaround */ + mask_pc_system_xstop(); + /* Add the /opal node to the device-tree */ add_opal_node(); diff --git a/include/xscom-p10-regs.h b/include/xscom-p10-regs.h index 8096b2f91..6045152d2 100644 --- a/include/xscom-p10-regs.h +++ b/include/xscom-p10-regs.h @@ -4,6 +4,8 @@ /* Core FIR (Fault Isolation Register) */ #define P10_CORE_FIR 0x440 +#define P10_CORE_FIRMASK_OR 0x445 + /* Core WOF (Whose On First) */ #define P10_CORE_WOF 0x448