From patchwork Tue Apr 3 12:04:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 894547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40FnqV01SWz9s37 for ; Tue, 3 Apr 2018 22:05: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 40FnqT5byVzF28G for ; Tue, 3 Apr 2018 22:05:57 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com 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.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=prvs=0631b20b45=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 (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 40Fnpk49xBzF26F for ; Tue, 3 Apr 2018 22:05:18 +1000 (AEST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w33BxlJY003228 for ; Tue, 3 Apr 2018 08:05:15 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2h48v5hgcc-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Tue, 03 Apr 2018 08:05:15 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Apr 2018 13:05:12 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 3 Apr 2018 13:05:10 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w33C59mw24510608; Tue, 3 Apr 2018 12:05:10 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7FC1F4205F; Tue, 3 Apr 2018 12:57:01 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 233AD42047; Tue, 3 Apr 2018 12:57:00 +0100 (BST) Received: from hegdevasant.in.ibm.com (unknown [9.109.198.179]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 3 Apr 2018 12:56:59 +0100 (BST) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Tue, 3 Apr 2018 17:34:31 +0530 X-Mailer: git-send-email 2.14.3 X-TM-AS-GCONF: 00 x-cbid: 18040312-0040-0000-0000-000004492355 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040312-0041-0000-0000-000020ED2E0C Message-Id: <20180403120447.24364-1-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-04-03_05:, , 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804030128 Subject: [Skiboot] [RFC PATCH 00/16] MPIPL support X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 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 MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Memory Preserving Initial Program Load (MPIPL) is a Power feature where the contents of memory are preserved while the system reboots after a failure. This is accomplished by the firmware/OS publishing ranges of memory to be preserved across boots. In the OPAL context, OPAL and host Linux communicate the memory ranges to be preserved via source descriptor tables in the HDAT. This data is updated at runtime via the SBE. When OPAL or Linux crashes, SBE gets to know of the event via a special interrupt which causes it to trigger the MPIPL. Hostboot then re-IPLs the machine taking care to copy over contents of the source descriptor tables to a alternate memory locations and publishes this information in the destination descriptor tables. The success/failure of the copy is indicated by a results table. Hostboot also does the requisite procedures to gather hardware register states for all active threads at the time of the crash. On an MPIPL boot, OPAL exports the results information to the host Linux kernel, which then uses its existing logic (kdump/fadump) to write out a core dump of OPAL and Linux kernel in a format that GDB and crash can understand. design: - OPAL hardcodes few entries in MDST, MDDT table so that we can capture early opal crash - OPAL passes relocated base address to SBE via 'MPIPL stash chip-op' so that hostboot can use relocated address to get MDST, MDDT table. - OPAL passes dump details to host via device tree (/ibm,dump node) - OPAL provides new API to MPIPL registration/unregistration - Enhance reboot2 API to support MPIPL - Add SBE s0/s1 interrupt support to initiate MPIPL on BMC based system. Dependency: - We have dependency on SBE and hostboot. Firmware folks are working on getting hostboot and SBE changes. - We need Linux kernel changes to generate opal core. Hari will post Linux side patches. - This patchset depends on below OPAL patchset - Add SBE driver support https://lists.ozlabs.org/pipermail/skiboot/2018-April/010903.html - hdata: Move 'HRMOR_BIT' macro to header file https://lists.ozlabs.org/pipermail/skiboot/2018-March/010811.html - Fix post MPIPL PHB4 reset issue https://lists.ozlabs.org/pipermail/skiboot/2018-April/010895.html Testing: - I've tested this patchset with custom hostboot and SBE changes. Its workign fine. We are able to get vmcore and opalcore. TODO: - Add support to get architected register state - Add documentation for device tree node and OPAL API Vasant Hegde (16): FSP/MDST: Rename fsp-mdst-table.c -> fsp-sysdump.c hdata: Fix MDST structure hdata: Define MDDT and MDRT table hdata: Setup memory for MDDT table hdata: Setup memory for MDRT table fadump: Define destination memory for boot crash hdata: Add support for early OPAL crash hdata: Adjust various structure offset after relocation fadump: Define FADUMP structure hdata: Create ibm,dump DT node hdata: Add result table property to ibm,dump node fadump: Add fw-source-table to ibm,dump node fadump: Add OPAL API to register for fadump fadump: Introduce new reboot type dump: Send OPAL relocated base address to SBE Add support to trigger memory preserving IPL on BMC system core/Makefile.inc | 2 +- core/init.c | 4 + core/opal-dump.c | 350 +++++++++++++++++++++++++++++ core/platform.c | 4 + doc/opal-api/opal-cec-reboot-6-116.rst | 7 + hdata/spira.c | 188 +++++++++++++++- hdata/spira.h | 3 + hdata/test/hdata_to_dt.c | 1 + hw/fsp/Makefile.inc | 2 +- hw/fsp/{fsp-mdst-table.c => fsp-sysdump.c} | 16 +- hw/ipmi/ipmi-attn.c | 4 + hw/sbe-p9.c | 79 +++++++ include/fsp-mdst-table.h | 48 ---- include/mem-map.h | 29 ++- include/opal-api.h | 44 +++- include/opal-dump.h | 87 +++++++ include/sbe-p9.h | 16 ++ skiboot.lds.S | 5 + 18 files changed, 821 insertions(+), 68 deletions(-) create mode 100644 core/opal-dump.c rename hw/fsp/{fsp-mdst-table.c => fsp-sysdump.c} (96%) delete mode 100644 include/fsp-mdst-table.h create mode 100644 include/opal-dump.h