From patchwork Fri Jul 12 11:17:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 1131300 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 45lVrV0rFWz9sBF for ; Fri, 12 Jul 2019 21:22:18 +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 45lVrT6bqKzDqy6 for ; Fri, 12 Jul 2019 21:22:17 +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 45lVmQ5xTXzDqgq for ; Fri, 12 Jul 2019 21:18:46 +1000 (AEST) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6CBHQKI125807 for ; Fri, 12 Jul 2019 07:18:43 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tprnb9hq9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 12 Jul 2019 07:18:43 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Jul 2019 12:18:41 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 12 Jul 2019 12:18:38 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6CBIOIO38535528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Jul 2019 11:18:24 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26CBA4C044; Fri, 12 Jul 2019 11:18:37 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 925534C040; Fri, 12 Jul 2019 11:18:34 +0000 (GMT) Received: from hegdevasant.in.ibm.com (unknown [9.199.176.57]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 12 Jul 2019 11:18:34 +0000 (GMT) From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Fri, 12 Jul 2019 16:47:48 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20190712111802.23560-1-hegdevasant@linux.vnet.ibm.com> References: <20190712111802.23560-1-hegdevasant@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19071211-0008-0000-0000-000002FCB24D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19071211-0009-0000-0000-0000226A1DD7 Message-Id: <20190712111802.23560-12-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-12_03:, , 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907120122 Subject: [Skiboot] [PATCH v9 11/25] MPIPL: Define OPAL metadata area 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" We want to save some information (like crashing CPU PIR, kernel tags, etc) before triggering MPIPL. Post MPIPL we will use this information to retrieve dump metadata and create dump. MDRT table doesn't need 64K. Hence split MDRT table to accommodate metadata area. Finally define metadata structure. Signed-off-by: Vasant Hegde --- core/opal-dump.c | 13 +++++++++++++ include/mem-map.h | 8 +++++++- include/opal-dump.h | 10 ++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/core/opal-dump.c b/core/opal-dump.c index 3d61f5092..56d6ba32e 100644 --- a/core/opal-dump.c +++ b/core/opal-dump.c @@ -37,6 +37,8 @@ static struct spira_ntuple *ntuple_mdst; static struct spira_ntuple *ntuple_mddt; static struct spira_ntuple *ntuple_mdrt; +static struct mpipl_metadata *mpipl_metadata; + static int opal_mpipl_add_entry(u8 region, u64 src, u64 dest, u64 size) { int i, max_cnt; @@ -134,6 +136,17 @@ void opal_mpipl_init(void) ntuple_mddt = &(spirah.ntuples.mdump_dst); ntuple_mdrt = &(spirah.ntuples.mdump_res); + /* Get metadata area pointer */ + mpipl_metadata = (void *)(DUMP_METADATA_AREA_BASE); + + /* Clear OPAL metadata area */ + if (sizeof(struct mpipl_metadata) > DUMP_METADATA_AREA_SIZE) { + prlog(PR_ERR, "INSUFFICIENT OPAL METADATA AREA\n"); + prlog(PR_ERR, "INCREASE OPAL MEDTADATA AREA SIZE\n"); + assert(false); + } + memset(mpipl_metadata, 0, sizeof(struct mpipl_metadata)); + /* Clear MDST and MDDT table */ memset(mdst_base, 0, MDST_TABLE_SIZE); ntuple_mdst->act_cnt = 0; diff --git a/include/mem-map.h b/include/mem-map.h index 0e03932a1..a29b8fb3e 100644 --- a/include/mem-map.h +++ b/include/mem-map.h @@ -106,7 +106,13 @@ * memory after moving memory content from source to destination memory. */ #define MDRT_TABLE_BASE (SKIBOOT_BASE + 0x01c00000) -#define MDRT_TABLE_SIZE 0x00010000 +#define MDRT_TABLE_SIZE 0x00008000 + +/* This is our dump metadata area. We will use this memory to save metadata + * (like crashing CPU details, payload tags) before triggering MPIPL. + */ +#define DUMP_METADATA_AREA_BASE (SKIBOOT_BASE + 0x01c08000) +#define DUMP_METADATA_AREA_SIZE 0x8000 /* Total size of the above area * diff --git a/include/opal-dump.h b/include/opal-dump.h index 0a86dcb1b..10a8df6ac 100644 --- a/include/opal-dump.h +++ b/include/opal-dump.h @@ -121,6 +121,16 @@ struct proc_reg_data { uint64_t reg_val; } __packed; +/* Metadata to capture before triggering MPIPL */ +struct mpipl_metadata { + /* Crashing PIR is required to create OPAL dump */ + uint32_t crashing_pir; + /* Kernel expects OPAL to presrve tag and pass it back via OPAL API */ + uint64_t kernel_tag; + /* Post MPIPL kernel boot memory size */ + uint64_t boot_mem_size; +} __packed; + /* init opal dump */ extern void opal_mpipl_init(void);