From patchwork Sun Jun 16 17:10:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 1116602 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 45RgvQ3MJJz9s00 for ; Mon, 17 Jun 2019 03:14:58 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45RgvQ2JwCzDq9j for ; Mon, 17 Jun 2019 03:14:58 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=hegdevasant@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com 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 45RgqK6K8MzDqcM for ; Mon, 17 Jun 2019 03:11:25 +1000 (AEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5GH7Ec9017837 for ; Sun, 16 Jun 2019 13:11:23 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t5svxg2mp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 16 Jun 2019 13:11:23 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 16 Jun 2019 18:11:21 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 16 Jun 2019 18:11:18 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5GHBHeQ29425814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Jun 2019 17:11:17 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9845A404D; Sun, 16 Jun 2019 17:11:17 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 720E8A4040; Sun, 16 Jun 2019 17:11:15 +0000 (GMT) Received: from hegdevasant.in.ibm.com (unknown [9.85.84.197]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sun, 16 Jun 2019 17:11:15 +0000 (GMT) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Sun, 16 Jun 2019 22:40:15 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20190616171024.22799-1-hegdevasant@linux.vnet.ibm.com> References: <20190616171024.22799-1-hegdevasant@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19061617-4275-0000-0000-00000342CD49 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061617-4276-0000-0000-00003852EE0C Message-Id: <20190616171024.22799-16-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-16_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=562 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906160165 Subject: [Skiboot] [PATCH v8 15/24] MPIPL: Save crashing PIR 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: stewart@linux.vnet.ibm.com, mikey@neuling.org, hbathini@linux.vnet.ibm.com MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Crashing CPU PIR is required to get proper backtrace from core file. Save crashing CPU PIR before triggering MPIPL. Post MPIPL OPAL will pass saved PIR to kernel and kernel will use that to create OPAL dump. Signed-off-by: Vasant Hegde --- core/opal-dump.c | 7 +++++++ hw/sbe-p9.c | 4 ++++ include/opal-dump.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/core/opal-dump.c b/core/opal-dump.c index 5c1ce0c7b..7036a424a 100644 --- a/core/opal-dump.c +++ b/core/opal-dump.c @@ -16,6 +16,7 @@ #define pr_fmt(fmt) "DUMP: " fmt +#include #include #include #include @@ -303,6 +304,12 @@ static int64_t opal_mpipl_update(enum mpipl_ops ops, return rc; } +void opal_mpipl_save_crashing_pir(void) +{ + mpipl_metadata->crashing_pir = this_cpu()->pir; + prlog(PR_NOTICE, "Crashing PIR = 0x%x\n", this_cpu()->pir); +} + void opal_mpipl_init(void) { void *mdst_base = (void *)MDST_TABLE_BASE; diff --git a/hw/sbe-p9.c b/hw/sbe-p9.c index 58a296c00..01f41e8cb 100644 --- a/hw/sbe-p9.c +++ b/hw/sbe-p9.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -961,6 +962,9 @@ void p9_sbe_terminate(void) if (!dt_find_by_path(opal_node, "dump")) return; + /* Save crashing CPU details */ + opal_mpipl_save_crashing_pir(); + /* * Send S0 interrupt to all SBE. Sequence: * - S0 interrupt on secondary chip SBE diff --git a/include/opal-dump.h b/include/opal-dump.h index 9f5f102be..a7c825513 100644 --- a/include/opal-dump.h +++ b/include/opal-dump.h @@ -133,4 +133,7 @@ struct mpipl_metadata { /* init opal dump */ extern void opal_mpipl_init(void); +/* Save metadata before triggering MPIPL */ +void opal_mpipl_save_crashing_pir(void); + #endif /* __OPAL_DUMP_H */